:root {
  color-scheme: dark;
  --bg: #0d0c16;
  --panel: #151321;
  --border: #2b263b;
  --text: #f4f1ff;
  --muted: #b2a9c7;
  --subtle: #a198b1;
  --purple: #bba4ff;
  --mint: #77e4db;
  --pink: #ff9cb9;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: radial-gradient(ellipse at 48% 0%, #171026 0%, transparent 54%); }
button, input { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; opacity: .48; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid #b99dff; outline-offset: 4px; }
button:focus:not(:focus-visible), main:focus { outline: none; }
[hidden] { display: none !important; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
[data-icon] svg, button > svg { width: 1.15em; height: 1.15em; }
.shell { width: min(1120px, calc(100% - 80px)); margin-inline: auto; }
.header { border-bottom: 1px solid #ffffff0b; background: #100e1ac9; }
.header-inner { height: 72px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.brand, .profile, .nav-link, .icon-button, .text-button, .card-action { border: 0; background: transparent; }
.brand { justify-self: start; display: flex; align-items: center; gap: 11px; padding: 0; text-align: left; }
.brand-mark { width: 40px; height: 40px; border-radius: 13px; color: white; font-size: 23px; background: linear-gradient(145deg, #9d74ff, #6f48db); border: 1px solid #bba5ff6b; box-shadow: 0 4px 20px #8156ee38; }
.wordmark { font-size: 20px; font-weight: 800; letter-spacing: .09em; line-height: 1.16; }
.wordmark span { display: block; font: 650 8px/1.65 Inter, system-ui, sans-serif; letter-spacing: .21em; color: #b5a9cc; }
.nav { display: flex; gap: 30px; align-self: stretch; }
.nav-link { position: relative; padding: 2px 10px 0; color: var(--muted); font-size: 13px; letter-spacing: .04em; }
.nav-link.active { color: #eee4ff; }
@media (hover: hover) { .nav-link:hover { color: #eee4ff; } }
.nav-link.active::after { content: ""; position: absolute; height: 2px; border-radius: 2px 2px 0 0; background: #a17bf6; left: 10px; right: 10px; bottom: 0; }
.header-end { justify-self: end; display: flex; align-items: center; gap: 14px; }
.icon-button { border-radius: 10px; color: #c5badc; width: 38px; height: 38px; padding: 0; font-size: 16px; }
@media (hover: hover) { .icon-button:hover, .profile:hover { background: #2b223e; color: #fff; } }
.profile { display: flex; align-items: center; gap: 8px; padding: 5px 11px 5px 5px; border: 1px solid #2e2740; border-radius: 30px; font-size: 12px; color: #d6cee6; }
#profile-name { max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 44px; height: 44px; border-radius: 50%; color: #ceb8ff; background: #392651; font-size: 18px; }
.avatar-small { width: 25px; height: 25px; font-size: 12px; }
.hero { position: relative; overflow: hidden; isolation: isolate; min-height: 260px; display: flex; align-items: center; margin-top: 28px; border: 1px solid #39304f; border-radius: 25px; background: #161127; }
.hero-art { inset: 0; position: absolute; z-index: -1; background: radial-gradient(ellipse at 77% 48%, #3f246a, transparent 53%), #171128; }
.hero-art::before { content: ""; position: absolute; inset: 0 0 0 26%; background: url("/assets/orbits.webp") center right / cover no-repeat; }
.hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #171128 3%, #171128 21%, #171128e8 34%, #17112836 61%, transparent 85%); }
.hero-content { padding: 32px clamp(28px, 4.2vw, 59px); }
.signal-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: #af85ff; box-shadow: 0 0 9px #ab7cff9e; }
.hero h1 { font-size: clamp(42px, 5vw, 66px); margin: 0 0 11px; letter-spacing: .015em; line-height: 1.15; font-weight: 850; }
.hero h1 span { display: block; color: #c2aaff; }
.hero-detail span { display: inline-block; }
.hero-detail { color: #c7bdd9; font-size: 1rem; line-height: 1.55; margin: 0; }
.hero-actions { display: flex; margin-top: 21px; }
.button { border: 1px solid transparent; border-radius: 11px; min-height: 45px; padding: 10px 17px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-size: 13px; font-weight: 700; transition: background-color .18s, border-color .18s, color .18s, box-shadow .2s, transform .14s cubic-bezier(.3,.7,.4,1); }
.button:not(:disabled):active { transform: scale(.96); }
.button.primary { background: linear-gradient(112deg, #9b75fa, #7552e8); border-color: #af91ff7a; color: white; box-shadow: 0 5px 20px #8156ec42; }
@media (hover: hover) { .button.primary:hover:enabled { background: linear-gradient(112deg, #a78aff, #8769ef); } }
.button.outline { border-color: #493961; color: #e0d5f5; background: #231932a1; }
@media (hover: hover) { .button.outline:hover:enabled { background: #37284e; border-color: #725795; } }
.button.danger { background: #492439; color: #ffc2d3; border-color: #71364d; }
@media (hover: hover) { .button.danger:hover:enabled { background: #5a2c46; } }
.directory-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.directory-nav .button { position: relative; min-height: 47px; padding-inline: 8px; background: #1b1528; white-space: nowrap; font-size: .875rem; }
.directory-nav .button[aria-expanded="true"] { background: #34234f; border-color: #946fd0; color: #f1e6ff; }
.history-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.history-actions button[aria-pressed="true"] { border-color: #946fd0; background: #34234f; }
.history-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.history-search .field { margin: 0; }
.history-list { list-style: none; padding: 0; margin: 10px 0 0; }
.history-list li { padding: 10px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.history-list li p { margin: 5px 0 0; font-size: .875rem; color: var(--muted); }
.history-status:empty { display: none; }
.modes { margin-top: 32px; }
.section-label { display: flex; align-items: end; justify-content: space-between; margin: 0 0 16px; }
.section-label h2 { margin: 0 0 5px; font-size: 23px; letter-spacing: .02em; font-weight: 800; }
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mode-card { --accent: #c5acff; --tone: #2c2047; display: flex; flex-direction: column; position: relative; border: 1px solid #332946; border-radius: 17px; padding: 19px 19px 15px; background: radial-gradient(ellipse at 6% 0%, #2d204333, transparent 66%), #171321; transition: border-color .18s, background .18s; }
@media (hover: hover) { .mode-card:hover { border-color: color-mix(in srgb, var(--accent) 52%, transparent); } }
.mode-card.friend-card { --accent: #83e7e0; --tone: #163436; border-color: #263c42; background: radial-gradient(ellipse at 6% 0%, #22484938, transparent 67%), #131b23; }
.mode-card.solo-card { --accent: #f4acce; --tone: #3d2336; border-color: #402d42; background: radial-gradient(ellipse at 6% 0%, #59274338, transparent 67%), #1c1422; }
.mode-top { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.mode-icon { width: 43px; height: 43px; border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent); border-radius: 12px; color: var(--accent); background: var(--tone); font-size: 20px; }
.mode-card h3 { margin: 12px 0 5px; font-size: 18px; letter-spacing: .02em; }
.mode-card p { margin: 0 0 13px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.card-action { position: static; margin-top: auto; border-top: 1px solid #ffffff11; padding: 11px 0 0; width: 100%; display: flex; align-items: center; justify-content: space-between; color: var(--accent); font-size: 12px; font-weight: 700; text-align: left; }
.card-action::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
@media (hover: hover) { .card-action:hover { color: #fff; } }
.footer { margin-top: 26px; margin-bottom: 24px; padding: 12px 15px; min-height: 60px; border: 1px solid #262133; background: #151220; border-radius: 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.footer-note { display: flex; gap: 10px; align-items: center; }
.footer-shield { width: 34px; height: 34px; border-radius: 9px; background: #28203b; color: #b99aed; font-size: 16px; }
.footer-note strong, .footer-note small { display: block; }
.footer-note strong { font-size: 11px; color: #ddd3ee; margin-bottom: 3px; }
.footer-note small, .text-button { font-size: 11px; color: #ae9fc6; }
.text-button { padding: 5px; display: inline-flex; align-items: center; gap: 5px; }
@media (hover: hover) { .text-button:hover { color: #f0e6ff; } }

.room { margin-top: 31px; }
.room-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 16px; }
.room-head h1 { margin: 5px 0 0; font-size: clamp(24px, 4vw, 32px); font-weight: 800; }
.room-heading .text-button { padding: 0; }
.room-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(245px, .38fr); gap: 16px; }
.room-grid.practice { grid-template-columns: minmax(0,1fr); max-width: 760px; margin: 0 auto; }
.room-stage, .room-side, .dialog-panel { border: 1px solid var(--border); border-radius: 19px; background: #161222; }
@property --stage-core { syntax: '<color>'; inherits: false; initial-value: #2c1949; }
@property --stage-edge { syntax: '<color>'; inherits: false; initial-value: #181324; }
@property --phase { syntax: '<color>'; inherits: true; initial-value: #c6a8ff; }
.room-stage { --stage-core: #2c1949; --stage-edge: #181324; min-height: 433px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 22px; position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 40%, var(--stage-core) 0%, var(--stage-edge) 66%); transition: --stage-core .7s ease, --stage-edge .7s ease, --phase .5s ease; }
.room-stage[data-cue="fast"] { --phase: #8aebdb; --stage-core: #103937; --stage-edge: #141f29; }
.room-stage[data-cue="slow"] { --phase: #f4d29c; --stage-core: #443327; --stage-edge: #231c2a; }
.room-stage[data-cue="stop"] { --phase: #ff9fbd; --stage-core: #4d2038; --stage-edge: #251a29; }
.room-side { padding: 20px; }
.room-stage h2 { font-size: clamp(27px, 5vw, 42px); line-height: 1.2; margin: 15px 0 7px; }
.room-stage p { color: #d5c9e2; font-size: 13px; line-height: 1.8; margin: 0; }
.orb { width: 112px; height: 112px; border-radius: 50%; color: var(--phase, #c6a8ff); border: 1px solid currentColor; box-shadow: 0 0 27px #b590ff36, inset 0 0 30px #ad8bff27; background: #17112882; font-size: 39px; position: relative; }
.orb::before, .orb::after { content: ""; border: 1px solid currentColor; opacity: .18; border-radius: 50%; position: absolute; inset: -9px; }
.orb::after { inset: -18px; opacity: .10; }
.loading-orb::before { animation: ripple 2.4s infinite; }
@keyframes ripple { 50% { transform: scale(1.15); opacity: .06; } }
.room-stage .time-label { color: #e6d9f4; font-variant-numeric: tabular-nums; position: absolute; top: 20px; right: 21px; font-size: 15px; }
.stage-badges { display: flex; gap: 8px; justify-content: center; margin-top: 13px; flex-wrap: wrap; }
.stage-badges span, .room-code { font-size: 12px; border: 1px solid #bda7dc40; border-radius: 8px; padding: 5px 8px; color: #eee1ff; background: #17122273; }
.stage-controls { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 9px; margin-top: 19px; }
.stage-watch-option { margin-top: 14px; font-size: .875rem; }
.stage-watch-option label { display: flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; }
.stage-watch-option input { width: 16px; height: 16px; accent-color: var(--purple); }
.stage-watch-option small { display: block; margin-top: 5px; color: var(--muted); font-size: .875rem; }
.progress { height: 4px; background: #ffffff13; position: absolute; bottom: 0; left: 0; right: 0; }
.progress span { display: block; height: 100%; background: var(--phase, #a47aff); width: 0; border-radius: 4px; box-shadow: 0 0 12px var(--phase, #a47aff); transition: width .2s linear; }
.room-side h2 { font-size: 16px; margin: 0 0 12px; }
.participant { display: flex; align-items: center; gap: 10px; border: 1px solid #2d263c; border-radius: 11px; padding: 9px; margin-bottom: 8px; min-width: 0; }
.participant .avatar { width: 32px; height: 32px; font-size: 14px; }
.participant div { min-width: 0; flex: 1; }
.participant strong, .participant small { display: block; }
.participant strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.participant small { font-size: 10px; margin-top: 2px; color: var(--muted); }
.participant .mic-status { color: var(--muted); font-size: 13px; }
.participant .mic-status.enabled { color: var(--mint); }
.room-voice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 13px; padding: 10px 13px; border: 1px solid #43345c; border-radius: 13px; background: #20182d; }
.room-voice[data-incoming] { position: sticky; top: max(8px, env(safe-area-inset-top)); z-index: 5; border-color: #bd99ff; background: #372357; box-shadow: 0 6px 24px #0c081bb3; }
.room-voice-icon { width: 33px; height: 33px; border-radius: 9px; background: #3b2856; color: #e1ccff; }
.room-voice[data-incoming] .room-voice-icon { background: #5a397c; }
.room-voice-copy { flex: 1 1 165px; }
.room-voice-preference { display: block; margin-top: 5px; color: #d7bfef; font-size: .875rem; }
.room-voice h2 { margin: 0; font-size: 14px; }
.room-voice p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.room-voice[data-incoming] p { color: #e0d1f4; }
.voice-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.voice-actions .button { min-height: 40px; padding: 6px 11px; font-size: 12px; }
.room-stage .peer-feedback { margin: 12px 0 0; padding: 5px 9px; border: 1px solid #af8ef266; border-radius: 8px; color: #f1e6ff; background: #231734; line-height: 1.5; }
.standby-panel { margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--border); }
.standby-panel h2 { margin: 0 0 5px; }
.standby-panel p { margin: 5px 0 9px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.standby-panel .button { min-height: 35px; padding: 5px 10px; font-size: 12px; }
.standby-heading { margin: 16px 0 8px; font-size: 14px; }

@media (max-width: 580px) {
  .voice-actions { flex-basis: 100%; }
  .voice-actions .button { flex: 1 1 auto; }
}

.social-panel, #lobby-notices { margin-top: 18px; padding: 16px 20px; border: 1px solid var(--border); border-radius: 16px; background: #161222; }
.social-heading, .social-row, .social-options { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; }
.social-heading h2 { margin: 0; font-size: 19px; }
.active-rooms #active-room-list { margin-top: 8px; }
.active-rooms .social-row { border-top: 1px solid var(--border); }
.active-rooms .social-row small, .active-rooms .social-message, .active-rooms .social-actions .button { font-size: .875rem; }
.social-options { justify-content: flex-start; margin-top: 12px; }

.directory-tools { display: grid; gap: 8px; margin: 12px 0; }
#online-filters { min-width: 0; margin: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
#online-filters legend { font-size: .875rem; padding-inline: 5px; }
.online-filter-groups { display: grid; gap: 10px; margin-top: 4px; }
.filter-row { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); align-items: center; gap: 4px 10px; min-width: 0; }
.filter-label { color: var(--muted); font-size: .8125rem; }
.filter-row .chip-group { margin: 0; }
.online-filter-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-top: 10px; }
#online-compatible-hint { color: var(--muted); font-size: .875rem; margin: 6px 0 0; }
@media (max-width: 580px) {
  .filter-row { grid-template-columns: minmax(0, 1fr); }
}
.online-settings { padding: 8px 0; color: #ddccef; font-size: .875rem; }
.online-settings summary { cursor: pointer; }
#friend-sync { margin: 14px 0; }
#friend-presence-option { margin-bottom: 12px; }
.social-options p { flex: 1 0 100%; font-size: 12px; color: var(--muted); margin: 0 0 7px; }
.online-limits-form { flex: 1 0 100%; min-width: 0; margin-bottom: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: #1b1628; }
.online-limits-form > .button { min-height: 36px; margin-top: 8px; }
.round-preferences { min-width: 0; }
.round-preferences legend { font-size: 13px; font-weight: 650; }
.round-preferences-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 7px 0; }
.round-preferences-grid .field { display: block; margin: 0; font-size: 12px; }
.room-limits { margin: 12px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.social-row { padding: 12px 0; }
#social-list .social-row, .social-row + .social-row { border-top: 1px solid var(--border); }
.social-row strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.social-row small, .social-message { color: var(--muted); font-size: 12px; line-height: 1.6; }
.social-message { margin: 8px 0; }
.social-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.social-actions .button { min-height: 34px; padding: 6px 11px; font-size: 12px; }
#friend-count { color: #221034; background: #e1bcff; border-radius: 20px; font-size: 11px; min-width: 18px; padding: 1px 4px; text-align: center; }
.invite-info { margin-top: 17px; border-top: 1px solid #2d263c; padding-top: 15px; }
.room-code { font-size: 14px; font-family: ui-monospace, monospace; letter-spacing: .14em; user-select: all; }

dialog { color: var(--text); border: 1px solid #423353; padding: 0; border-radius: 18px; background: #1a1528; width: min(460px, calc(100% - 28px)); max-height: 90dvh; box-shadow: 0 20px 95px #000a; }
dialog::backdrop { background: #090711b8; backdrop-filter: blur(5px); }
.dialog-panel { padding: 24px; background: transparent; border: 0; }
.dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.dialog-top h2 { margin: 0; font-size: 23px; }
.dialog-top .icon-button { margin: -6px -7px -6px 0; }
.dialog-panel p { color: var(--muted); margin: 12px 0; font-size: 13px; line-height: 1.75; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.dialog-actions .primary:last-child { flex: 1; }
.dialog-panel label, .dialog-panel legend { font-weight: 650; font-size: 13px; }
.field { display: block; margin: 14px 0 8px; }
.field input { width: 100%; margin-top: 7px; height: 42px; background: #100e1b; color: #eee5ff; border: 1px solid #41334f; border-radius: 9px; padding: 8px 11px; }
.field input::placeholder { color: #a195b3; }
.room-field input { text-transform: uppercase; letter-spacing: .12em; }
fieldset { margin: 15px 0 0; padding: 0; border: 0; }
.choices { display: flex; gap: 7px; margin-top: 8px; }
.choice { display: flex; flex: 1; align-items: center; justify-content: center; gap: 5px; padding: 10px 5px; cursor: pointer; border: 1px solid #433454; background: #1b1428; color: #d7c9ed; border-radius: 8px; }
.choice:has(input:checked) { background: #352451; border-color: #8564c6; }
input[type="radio"], input[type="checkbox"] { accent-color: #9b76ed; }
.toggle { display: flex; align-items: start; gap: 8px; padding: 8px 0; color: #ddcfee; }
.toggle input { margin-top: 4px; }
.rule { display: flex; align-items: flex-start; gap: 10px; margin-top: 11px; }
.rule [data-icon] { min-width: 30px; min-height: 30px; border-radius: 9px; background: #2d2245; color: var(--purple); }
.rule p { margin: 3px 0; }
.form-error { color: #ffa3bb !important; min-height: 1.4em; }
.toast { position: fixed; z-index: 2; bottom: 20px; left: 50%; transform: translate(-50%, 16px); padding: 10px 15px; border-radius: 10px; border: 1px solid #57436f; background: #2a1d3b; color: #f3e8ff; font-size: 13px; max-width: calc(100% - 32px); width: max-content; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 820px) {
  .shell { width: calc(100% - 44px); }
  .hero { min-height: 230px; }
  .hero-art::before { left: 25%; background-position: 61% center; }
  .hero-art::after { background: linear-gradient(90deg, #171128 7%, #171128ef 26%, #17112838 70%, transparent); }
  .mode-card { padding: 14px 13px 13px; }
}
@media (max-width: 580px) {
  .shell { width: calc(100% - 28px); }
  .header-inner { height: 61px; grid-template-columns: 1fr auto; }
  .nav { display: none; }
  .header-end { gap: 7px; }
  .hero { margin-top: 17px; min-height: 212px; border-radius: 18px; }
  .hero-content { padding: 25px 19px; }
  .hero h1 { font-size: clamp(35px, 9vw, 47px); }
  .hero-art::before { left: 10%; background-position: 58% center; }
  .hero-art::after { background: linear-gradient(90deg, #171128f2 0%, #171128ea 22%, #17112877 67%, #17112831); }
  .directory-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .directory-nav .button { gap: 5px; padding-inline: 4px; }
  .modes { margin-top: 21px; }
  .section-label h2 { font-size: 20px; }
  .mode-grid { grid-template-columns: minmax(0,1fr); gap: 9px; }
  .mode-card { padding: 13px; }
  .mode-icon { width: 36px; height: 36px; }
  .mode-card h3 { margin-top: 9px; }
  .footer { margin-top: 15px; padding-inline: 10px; }
  .room { margin-top: 17px; }
  .room-grid { grid-template-columns: minmax(0,1fr); }
  .room-stage { min-height: 365px; padding: 14px; }
  .room-stage .time-label { right: 12px; top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.room-tags { justify-content: start; margin-top: 8px; }
.stage-content { display: flex; flex-direction: column; align-items: center; }
.stage-content .orb { margin-bottom: 6px; }
.room-side h2 small { color: var(--muted); font: 500 11px/1 system-ui, sans-serif; margin-left: 5px; }

select {
  font: inherit;
  color: #eee5ff;
  border: 1px solid #41334f;
  background: #100e1b;
  border-radius: 9px;
  padding: 8px 10px;
}
select:focus-visible { outline: 2px solid #b99dff; outline-offset: 2px; }
.field select { width: 100%; min-height: 42px; margin-top: 7px; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.role-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 8px 0 3px; }
.role-option {
  display: flex; align-items: start; gap: 4px; min-height: 54px; padding: 8px 6px;
  border: 1px solid #433454; border-radius: 9px; background: #1b1428; cursor: pointer;
}
.role-option:has(input:checked) { background: #352451; border-color: #8564c6; }
.role-option input { margin: 3px 2px 0 0; flex: 0 0 auto; }
.role-option strong, .role-option small { display: block; }
.role-option small { margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 500; }
.dialog-panel .profile-hint { margin: 7px 0 10px; font-size: 11px; }
.room-head-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.playfield > *, .stage-stack, .media-panel { min-width: 0; }
.playfield.media-open { display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr); align-items: start; gap: 14px; }
.media-open .room-stage { min-height: 325px; padding-inline: 13px; }
.media-open .room-stage .orb { width: 89px; height: 89px; font-size: 30px; }
.control-dock, .media-panel { background: #171322; border: 1px solid var(--border); border-radius: 15px; padding: 13px; }
.control-dock { margin-top: 12px; }
.dock-heading, .media-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dock-heading h2, .media-heading h2 { margin: 0; font-size: 15px; }
.dock-heading span { color: var(--purple); font-size: 11px; }
.dock-actions, .media-player-actions, .media-add { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.dock-actions .button { min-height: 38px; padding: 8px 10px; flex: 1 1 auto; }
.cue-option[aria-pressed="true"] { color: #eadfff; border-color: #8d69c1; background: #36234e; }
.cue-option[aria-pressed="true"][data-cue="fast"] { background: #133e37; border-color: #3d8d80; color: #a7f1df; }
.cue-option[aria-pressed="true"][data-cue="slow"] { background: #463422; border-color: #927041; color: #f4d29c; }
.cue-option[aria-pressed="true"][data-cue="stop"] { background: #4a2638; border-color: #a05c77; color: #ffc3d5; }
.media-heading p { margin: 4px 0 0; font-size: 11px; color: var(--muted); }
.media-heading .icon-button { font-size: 24px; }
.media-preference { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.media-preference select { min-width: 100px; max-width: 65%; min-height: 34px; font-size: 12px; }
.media-viewer { margin-top: 10px; }
.media-viewer :is(img, video) { display: block; max-width: 100%; height: auto; margin-inline: auto; border-radius: 11px; object-fit: contain; }
.media-viewer img { width: 100%; max-height: 390px; }
.media-viewer video { width: auto; max-height: 390px; max-height: min(390px, 50dvh); background: #0d0b13; }
.media-empty, .media-error { color: var(--muted); text-align: center; font-size: 12px; line-height: 1.6; padding: 0 12px; }
.media-empty { margin: 0; padding-block: 12px; border: 1px solid #332742; border-radius: 11px; }
.media-error { color: var(--pink); text-align: left; padding: 0; overflow-wrap: anywhere; }
.media-player-actions { flex-wrap: nowrap; }
.media-player-actions > .button, .media-add .button, .media-link .button { padding: 6px 9px; min-height: 34px; font-size: 11px; flex: 0 0 auto; }
.media-player-actions > [data-media="prev"], .media-player-actions > [data-media="next"] { font-size: 17px; min-width: 30px; line-height: 1; }
.media-choice { flex: 1; min-width: 30px; }
.media-choice select { width: 100%; min-height: 34px; font-size: 11px; padding-inline: 5px; }
.media-file { position: relative; cursor: pointer; }
.media-file:focus-within { outline: 2px solid #b99dff; outline-offset: 2px; }
.media-file input, .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.media-link { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.media-link input { flex: 1 0 100%; min-width: 0; border: 1px solid #41334f; border-radius: 8px; background: #100e1b; color: #eee5ff; padding: 7px 9px; }
.media-link select { flex: 1; min-width: 0; font-size: 11px; }
.media-toggle { font-size: 11px; padding-bottom: 0; }
@media (max-width: 895px) {
  .playfield.media-open { grid-template-columns: minmax(0, 1fr); }
  .media-open .room-stage { min-height: 286px; }
}
@media (max-width: 580px) {
  .room-head-actions { gap: 5px; }
  .room-head-actions .button { min-height: 38px; padding: 6px 8px; font-size: 11px; }
  .room-head-actions .button [data-icon] { display: none; }
  .role-option { padding-inline: 4px; }
}

.duration-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}
.duration-option {
  min-height: 37px;
  padding: 5px;
  border: 1px solid #433454;
  border-radius: 8px;
  background: #1b1428;
  color: #d7c9ed;
  font-size: 12px;
}
@media (hover: hover) { .duration-option:hover:enabled { border-color: #8564c6; } }
.duration-option[aria-pressed="true"] {
  border-color: #ad86ee;
  background: #3b2859;
  color: #f5edff;
  font-weight: 700;
}
.duration-custom { display: flex; align-items: center; gap: 7px; margin-top: 10px; }
.duration-custom input {
  width: 76px;
  min-height: 36px;
  padding: 5px 8px;
  border: 1px solid #41334f;
  border-radius: 8px;
  background: #100e1b;
  color: #eee5ff;
  font-variant-numeric: tabular-nums;
}
.dialog-panel .duration-hint { margin: 4px 0 0; font-size: 11px; }

.media-sites { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--border); }
.media-sites-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.media-sites-heading h3 { margin: 0; font-size: 13px; }
.media-site-picker { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.media-site-picker select { flex: 1 1 105px; min-width: 0; min-height: 34px; font-size: 11px; padding-inline: 7px; }
.media-site-open, .media-site-form .button { min-height: 34px; padding: 6px 9px; font-size: 11px; }
.media-site-form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; margin-top: 8px; }
.media-site-form input { min-width: 0; min-height: 34px; border: 1px solid #41334f; border-radius: 8px; background: #100e1b; color: #eee5ff; padding: 7px 8px; font-size: 12px; }
.media-site-form input[name="siteAddress"] { grid-column: 1 / -1; }
.media-site-hint, .media-site-error { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.media-site-error { color: var(--pink); }

.playfield.media-open.website-open { grid-template-columns: minmax(205px, .75fr) minmax(0, 1.25fr); }
.website-open .stage-stack { position: sticky; top: 12px; z-index: 2; }
.media-web { margin-top: 10px; scroll-margin-top: 12px; }
.media-web-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; margin-bottom: 7px; }
.media-web-heading h3 { font-size: 13px; margin: 0; overflow-wrap: anywhere; }
.media-web-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.media-web-heading .text-button { flex: 0 0 auto; }
.media-frame-ratio { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.media-frame-ratio select { min-height: 30px; padding: 3px 6px; font-size: 11px; }
.website-open .media-toggle { display: none; }
.media-web-frame { border: 1px solid #332742; border-radius: 11px; overflow: hidden; background: #0d0b13; }
.media-web-frame iframe { display: block; width: 100%; height: clamp(240px, 52dvh, 520px); border: 0; }
.media-web-frame:not([data-ratio="page"]) {
  --frame-ratio: calc(16 / 9);
  --frame-max-height: clamp(145px, 46dvh, 390px);
  position: relative;
  width: min(100%, calc(var(--frame-max-height) * var(--frame-ratio)));
  aspect-ratio: var(--frame-ratio);
  margin-inline: auto;
}
.media-web-frame[data-ratio="classic"] { --frame-ratio: calc(4 / 3); }
.media-web-frame[data-ratio="square"] { --frame-ratio: 1; }
.media-web-frame[data-ratio="portrait"] { --frame-ratio: calc(9 / 16); }
.media-web-frame:not([data-ratio="page"]) iframe { position: absolute; inset: 0; height: 100%; }
@media (max-width: 895px) {
  .playfield.media-open.website-open { grid-template-columns: minmax(0, 1fr); }
  .website-open .stage-stack { top: 0; }
  .website-open .room-stage { min-height: 0; padding: 13px 10px; }
  .website-open .room-stage .orb { display: none; }
  .website-open .room-stage h2 { margin: 0 0 4px; font-size: 23px; }
  .website-open .room-stage p { font-size: 11px; }
  .website-open .stage-badges { margin-top: 5px; }
  .website-open .stage-controls { margin-top: 7px; gap: 6px; }
  .website-open .stage-controls .button { min-height: 34px; padding: 5px 8px; }
  .website-open .control-dock { margin-top: 4px; padding: 7px; }
  .website-open .dock-actions { margin-top: 4px; }
  .website-open .dock-actions .button { min-height: 31px; padding: 4px 7px; }
  .website-open .media-web { scroll-margin-top: 200px; }
}

.round-details { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.round-details summary { color: var(--purple); font-size: 12px; cursor: pointer; }
.round-fields { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.round-select { display: flex; flex: 1 1 100%; min-width: 0; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); }
.round-action-group { margin-top: 9px; }
.round-action-group strong { color: var(--muted); font-size: 11px; }
.round-action-group .dock-actions { margin-top: 4px; }
.address-fields { min-width: 0; margin-bottom: 12px; }
.address-fields .toggle { font-size: .875rem; color: var(--muted); }
.round-status { margin: 7px 0 0; color: var(--text); font-size: 12px; line-height: 1.5; }
.round-extension { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; background: #2a2040; border: 1px solid var(--border); border-radius: 8px; margin-top: 8px; padding: 7px; }
.round-extension span { font-size: 11px; color: var(--text); }
.round-extension .button { font-size: 11px; min-height: 30px; padding: 4px 8px; }
@media (max-width: 895px) {
  .website-open .control-dock { max-height: 34dvh; overflow: auto; }
}

.voice-audience { flex: 1 1 100%; border-top: 1px solid #8e74c05c; }
.voice-audience .social-row { padding: 7px 0; }
.public-audio-settings { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-top: 8px; }
.public-audio-settings p { flex: 1 1 240px; margin: 0; font-size: .875rem; }
.public-audio-settings .button { min-height: 40px; font-size: .875rem; }
.room-voice[data-public-audio] .public-audio-settings p { color: var(--mint); }
.watch-panel, .admin-card { margin-top: 19px; padding: clamp(14px, 3vw, 24px); border: 1px solid var(--border); border-radius: 16px; background: #181324; }
.watch-heading, .watch-actions, .admin-summary, .admin-header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.watch-heading, .admin-header { justify-content: space-between; }
.watch-heading h2, .admin-card h2, .admin-header h1 { margin: 0; font-size: clamp(17px, 3vw, 22px); }
.watch-stage { display: grid; gap: 8px; justify-items: center; margin-top: 14px; padding: 22px 12px; border: 1px solid #46385f; border-radius: 12px; background: #251a38; }
.watch-cue { color: var(--purple); font-size: 22px; }
.watch-stage time { font-size: 22px; font-variant-numeric: tabular-nums; }
.watch-stage p, .watch-status, .admin-card p, #admin-status { color: var(--muted); font-size: 13px; line-height: 1.65; }
.watch-stage p { margin: 0; overflow-wrap: anywhere; text-align: center; }
.admin-main { margin-top: 28px; margin-bottom: 35px; }
.admin-header { min-height: 62px; }
.admin-header a { color: var(--purple); text-decoration: none; font-weight: 750; font-size: 19px; }
.admin-summary strong { background: #272039; border: 1px solid var(--border); padding: 10px; border-radius: 8px; font-size: 13px; }
.admin-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 8px; border-top: 1px solid var(--border); padding-top: 8px; font-size: 13px; }
.admin-row strong { flex: 1 1 160px; overflow-wrap: anywhere; }
.admin-row span { color: var(--muted); }
.admin-row .button { min-height: 34px; padding: 5px 10px; }
.inspection-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 215px), 1fr)); gap: 10px; margin: 14px 0 18px; }
.inspection-details > div { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #221a32; }
.inspection-details dt { color: var(--muted); font-size: .875rem; }
.inspection-details dd { margin: 4px 0 0; overflow-wrap: anywhere; }

.traffic-heading, .traffic-chart-heading, .traffic-dates { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.traffic-heading label, .traffic-chart-heading span, .traffic-dates { color: var(--muted); font-size: 12px; }
.traffic-heading .chip-group { margin: 0; }
.traffic-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin: 16px 0; }
.traffic-metrics > div { padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: #221a32; }
.traffic-metrics dt { color: var(--muted); font-size: 12px; line-height: 1.45; }
.traffic-metrics dd { margin: 5px 0 0; font-size: clamp(19px, 3.2vw, 30px); font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.traffic-chart-heading h3 { margin: 0; font-size: 14px; }
.traffic-chart { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: stretch; gap: clamp(2px, .55vw, 8px); height: 105px; margin-top: 10px; border-bottom: 1px solid var(--border); background: repeating-linear-gradient(to top, transparent 0 calc(25% - 1px), #423452 25%); }
.traffic-column { display: flex; align-items: flex-end; }
.traffic-bar { display: block; width: 100%; border-radius: 5px 5px 0 0; background: linear-gradient(#c7a8ff, #6e4cc3); }
.traffic-bar.unmeasured { background: #514763; }
.traffic-dates { margin-top: 5px; }
.traffic-details { margin-top: 11px; color: var(--muted); font-size: 12px; }
.traffic-details summary { cursor: pointer; color: var(--purple); }
.traffic-details table { width: 100%; margin-top: 8px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.traffic-details :is(th, td) { border-bottom: 1px solid var(--border); padding: 6px; text-align: right; }
.traffic-details :is(th, td):first-child { text-align: left; }
@media (max-width: 610px) { .traffic-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.watch-interaction { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; margin: 14px 0; }
.watch-interaction > div, .watch-media { padding: 12px; background: #211a32; border: 1px solid var(--border); border-radius: 12px; }
.watch-interaction h3 { margin: 0 0 9px; font-size: .925rem; }
.room-chat { min-width: 0; margin: 14px 0; padding: 14px; background: #211a32; border: 1px solid var(--border); border-radius: 12px; }
.room-chat h3 { margin: 0 0 10px; font-size: 1rem; }
.chat-log { max-height: 17rem; overflow: auto; overscroll-behavior: contain; padding: 0; margin: 0; list-style: none; }
.chat-log li { padding: 8px 0; border-top: 1px solid var(--border); }
.chat-log li strong { font-size: .875rem; color: var(--muted); }
.chat-log li p { margin: 3px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-empty, .chat-visibility, .chat-error { margin: 8px 0; font-size: .875rem; color: var(--muted); }
.chat-error { color: #f5a7bd; }
#report-form textarea { width: 100%; resize: vertical; padding: 10px 12px; border-radius: 10px; background: #151020; border: 1px solid var(--border); color: var(--text); font: inherit; }
#report-form input[type="file"] { min-width: 0; }
.report-attachments { display: grid; gap: 8px; margin: 10px 0; }
.report-attachments details { padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; overflow-wrap: anywhere; }
.report-attachments summary { cursor: pointer; }
.report-attachments img, .report-attachments video { display: block; max-width: 100%; max-height: 360px; margin: 10px 0; }
.report-attachments .button { margin-top: 8px; }
#report-panel { margin-top: 12px; }
.report-pages { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.report-pages span { color: var(--muted); }
.admin-report { padding: 12px 0; border-top: 1px solid var(--border); }
.admin-report h3 { font-size: 1rem; margin: 0 0 8px; }
.admin-report p { color: var(--muted); margin: 5px 0; font-size: .875rem; }
.admin-report .report-detail { color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.report-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-top: 12px; }
.report-controls .field { margin: 0; }
.report-custom-duration { flex-basis: 100%; display: grid; grid-template-columns: minmax(0, 9rem) minmax(5rem, max-content); align-items: end; gap: 6px 8px; }
.report-custom-duration p { grid-column: 1 / -1; margin: 0; }
.chat-compose { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.chat-compose input { min-width: 0; font-size: 1rem; }
.friend-chat .chat-log { max-height: min(45vh, 24rem); scrollbar-gutter: stable; }
.friend-chat .chat-log li { margin: 6px 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: #1b1628; }
.friend-chat .chat-log li.mine { background: #2b1d42; }
.friend-chat .chat-log time { float: inline-end; margin-inline-start: 5px; font-size: .8rem; color: var(--muted); }
.friend-chat-status { color: var(--muted); font-size: .875rem; margin: 10px 0; }
.friend-chat-status:empty { display: none; }
.friend-chat .chat-compose { margin-top: 12px; }
.watch-interaction p { color: var(--muted); margin: 8px 0 0; line-height: 1.5; font-size: .9375rem; }
.watch-hint:empty { display: none; }
.watch-controls { display: flex; flex-wrap: wrap; gap: 6px; }
.watch-controls span { padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); font-size: .875rem; }
.watch-controls [aria-current] { border-color: var(--purple); color: var(--text); background: #3c2a58; }
.watch-media { margin-top: 12px; }
.watch-media-player:not(:empty) { margin-top: 10px; }
.watch-media-player > * { display: block; width: 100%; max-height: 55vh; object-fit: contain; border: 0; border-radius: 8px; }
.watch-media-player iframe { aspect-ratio: 16 / 9; }
.quick-phrases { margin-bottom: 10px; }
.quick-phrases summary { cursor: pointer; font-size: .875rem; color: var(--muted); }
.quick-phrase-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.quick-phrase-buttons .button { min-height: 32px; white-space: normal; overflow-wrap: anywhere; }
.quick-phrases textarea { display: block; width: 100%; margin-top: 6px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: #100e1b; color: var(--text); font: inherit; }
.quick-phrase-status:empty { display: none; }
.voice-sample audio { display: block; width: 100%; margin: 10px 0; }
.reply-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 6px 10px; }
.reply-options .toggle { margin: 0; padding-block: 5px; }

.mobile-room-tools, .room-panel-backdrop, .mobile-cues { display: none; }
.desktop-round-action { display: contents; }

@media (max-width: 600px), (max-height: 520px) and (orientation: landscape) {
  body:has(#room.compact-round:not([hidden])) > .header,
  body:has(#room.compact-round:not([hidden])) > .footer { display: none; }
  .compact-round {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    margin: 0;
    padding: max(8px, env(safe-area-inset-top)) 0 calc(6px + env(safe-area-inset-bottom));
  }
  .compact-round .room-head { margin-bottom: 7px; }
  .compact-round .room-head h1 { font-size: 1.125rem; margin-top: 2px; }
  .compact-round .room-head-actions [data-action="media"] { display: none; }
  .compact-round .room-grid { display: block; }
  .compact-round .playfield.media-open { display: block; }
  .compact-round .stage-stack { position: static; }
  .compact-round .room-stage { min-height: 0; padding: 12px 10px 9px; border-radius: 13px; }
  .compact-round .room-stage .orb { display: none; }
  .compact-round .room-stage h2 { font-size: clamp(1.25rem, 6vw, 1.65rem); margin: 0 0 3px; padding-inline: 40px; }
  .compact-round .room-stage .time-label { top: 9px; right: 10px; font-size: .8125rem; }
  .compact-round .room-stage p { line-height: 1.35; }
  .compact-round .stage-badges, .compact-round .stage-controls { margin-top: 6px; gap: 5px; }
  .compact-round .stage-badges span { padding: 3px 6px; }
  .compact-round .room-stage .peer-feedback { margin: 6px 0 0; padding: 4px 8px; }
  .compact-round .control-dock { margin-top: 6px; padding: 8px; max-height: none; overflow: visible; }
  .compact-round .stage-controls .button,
  .compact-round .dock-actions .button,
  .compact-round .mobile-cues .button { min-height: 44px; padding: 5px 8px; font-size: .875rem; }
  .compact-round .dock-actions { margin-top: 6px; gap: 5px; }
  .compact-round .desktop-round-action { display: none; }
  .compact-round .mobile-cues { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 5px; }

  .compact-round .mobile-room-tools {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 5px;
    position: sticky;
    bottom: 0;
    z-index: 32;
    margin-top: auto;
    padding: 7px 0 3px;
    background: var(--bg);
  }
  .compact-round .mobile-room-tools .button { min-height: 44px; min-width: 0; padding: 4px; font-size: .8125rem; }
  .compact-round .mobile-room-tools .button[aria-expanded="true"] { border-color: var(--purple); background: #36234e; }

  .compact-round:not([data-room-panel="voice"]) .room-voice,
  .compact-round:not([data-room-panel="chat"]) .room-chat,
  .compact-round:not([data-room-panel="info"]) .room-side,
  .compact-round:not([data-room-panel="more"]) .round-more { display: none; }
  .compact-round[data-room-panel="voice"] .room-voice,
  .compact-round[data-room-panel="chat"] .room-chat,
  .compact-round[data-room-panel="info"] .room-side,
  .compact-round[data-room-panel="more"] .round-more,
  .compact-round .media-panel:not([hidden]) {
    position: fixed;
    z-index: 31;
    inset: auto max(8px, env(safe-area-inset-right)) calc(62px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    max-height: min(65dvh, calc(100dvh - 80px));
    margin: 0;
    padding: 12px;
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid #423353;
    border-radius: 15px;
    background: #161222;
    box-shadow: 0 8px 40px #0008;
  }
  .compact-round[data-room-panel] .room-panel-backdrop,
  .compact-round:has(.media-panel:not([hidden])) .room-panel-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: #08060bb0;
    border: 0;
  }
}

.controller-custom-hints { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.controller-custom-hints > .button { flex-shrink: 0; }
.custom-hint-rail { display: flex; gap: 5px; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.custom-hint-rail .button { flex: 0 0 auto; max-inline-size: 13rem; white-space: normal; overflow-wrap: anywhere; }
#custom-hint-settings textarea { display: block; width: 100%; margin-top: 7px; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px; font: inherit; }

.standby-queue .room-stage { min-height: 235px; }
.standby-queue .room-stage .orb { width: 72px; height: 72px; font-size: 28px; }
.history-friend { margin-top: 7px; min-height: 38px; }
.history-friend + p:empty { display: none; }

.archive-mode .hero, .archive-mode .modes, .archive-mode .nav, .archive-mode .header-end,
.archive-mode [data-action="online-players"], .archive-mode [data-action="room-list"],
.archive-mode #active-rooms, .archive-mode #lobby-notices { display: none; }
.archive-mode .directory-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.archive-notice { margin-top: clamp(16px, 4vw, 36px); }
.archive-notice h1 { font-size: clamp(1.4rem, 5vw, 2rem); margin: 0 0 8px; }
.archive-notice p { color: var(--muted); margin: 6px 0; line-height: 1.6; }

.admin-user-search { display: flex; align-items: end; gap: 8px; }
.admin-user-search .field { flex: 1; min-width: 0; margin-bottom: 0; }
.admin-user-detail { border: 1px solid var(--border); border-radius: 12px; margin-top: 14px; padding: 12px; }
.admin-user-detail h3, .admin-user-detail h4 { margin: 4px 0 8px; }
.admin-user-detail code, .admin-user-detail li, .admin-user-list strong { overflow-wrap: anywhere; }
.admin-user-detail section { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 10px; }
.admin-user-detail ul { margin: 0; padding-left: 20px; color: var(--muted); }
.admin-user-detail li { margin-bottom: 5px; font-size: .875rem; }
[data-user-more], .admin-user-detail .button { margin-top: 8px; }

/* ---------- Form controls ---------- */
input:is([type="text"], [type="search"], [type="number"], [type="password"], [type="url"], :not([type])), textarea {
  font: inherit;
  color: #eee5ff;
  background: #100e1b;
  border: 1px solid #41334f;
  border-radius: 10px;
  transition: border-color .18s, box-shadow .2s, background-color .18s;
}
input:is([type="text"], [type="search"], [type="number"], [type="password"], [type="url"], :not([type])):focus-visible, textarea:focus-visible {
  outline: none;
  border-color: #9b76ed;
  background: #141020;
  box-shadow: 0 0 0 3px #9b76ed30;
}
.chat-compose input, .history-search input { min-height: 44px; padding: 8px 12px; }
input[type="file"] { max-width: 100%; color: var(--muted); font-size: .875rem; }
input[type="file"]::file-selector-button { margin-right: 10px; padding: 7px 12px; border: 1px solid #493961; border-radius: 9px; background: #231932; color: #e0d5f5; font: inherit; font-weight: 650; cursor: pointer; }
/* Phones zoom into inputs smaller than 16px on focus; keep them at 16px on touch screens. */
@media (pointer: coarse) {
  input:is([type="text"], [type="search"], [type="number"], [type="password"], [type="url"], :not([type])), textarea { font-size: max(16px, 1em); }
}

/* Switches replace bare checkboxes in settings rows. */
.toggle { align-items: center; cursor: pointer; line-height: 1.45; }
.toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 24px;
  margin: 0;
  border: 1px solid #4a3c5f;
  border-radius: 999px;
  background: #241d33;
  cursor: pointer;
  transition: background-color .22s, border-color .22s, box-shadow .22s;
}
.toggle input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #a99bbf;
  box-shadow: 0 1px 3px #0006;
  transition: transform .28s cubic-bezier(.3, 1.4, .5, 1), background-color .2s;
}
.toggle input[type="checkbox"]:checked { background: #7552e8; border-color: #a184ff; box-shadow: 0 0 14px #8156ec55; }
.toggle input[type="checkbox"]:checked::after { transform: translateX(16px); background: #fff; }
.toggle input[type="checkbox"]:focus-visible { outline: 2px solid #b99dff; outline-offset: 3px; }

/* ---------- Chips and segmented controls (replace dropdowns) ---------- */
.chip-field { min-width: 0; margin: 14px 0 6px; padding: 0; border: 0; }
.chip-field legend { padding: 0; font-weight: 650; font-size: 13px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; min-width: 0; }
.chip { position: relative; display: inline-flex; min-width: 0; }
.chip input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 36px;
  padding: 6px 13px;
  border: 1px solid #3f3252;
  border-radius: 999px;
  background: #1b1528;
  color: #cfc2e4;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  transition: background-color .2s, border-color .2s, color .2s, box-shadow .25s, transform .14s;
}
.chip span::before {
  content: "";
  width: 0;
  height: 6px;
  margin-right: -6px;
  border-radius: 50%;
  background: #d4c0ff;
  box-shadow: 0 0 8px #b694ff;
  opacity: 0;
  transition: width .22s cubic-bezier(.3, 1.4, .5, 1), margin .22s cubic-bezier(.3, 1.4, .5, 1), opacity .2s;
}
@media (hover: hover) {
  .chip:hover input:not(:disabled) + span { border-color: #6b5590; color: #f0e6ff; }
}
.chip input:checked + span {
  background: linear-gradient(135deg, #3d2864, #2b1d48);
  border-color: #9b76ed;
  color: #fff;
  box-shadow: 0 0 0 3px #9b76ed1f, 0 4px 14px #7a55e02e;
}
.chip input:checked + span::before { width: 6px; margin-right: 0; opacity: 1; }
.chip input:focus-visible + span { outline: 2px solid #b99dff; outline-offset: 2px; }
.chip input:active:not(:disabled) + span { transform: scale(.95); }
.chip input:disabled { cursor: default; }
.chip input:disabled + span { opacity: .45; }
.chip-group.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 3px;
  padding: 3px;
  border: 1px solid #2e2640;
  border-radius: 13px;
  background: #110e1b;
}
.social-options .segmented, .traffic-heading .segmented { max-width: 26rem; }
.segmented .chip span { border-color: transparent; border-radius: 10px; background: transparent; padding-inline: 6px; }
.segmented .chip input:checked + span { border-color: #8d69d6; box-shadow: 0 2px 12px #7a55e033; }
/* Horizontally scrolling rails keep filter rows to one line on phones. */
.chip-rail { flex-wrap: wrap; }
@media (max-width: 580px) {
  .chip-rail {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: -4px;
    padding: 2px 4px 4px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }
  .chip-rail::-webkit-scrollbar { display: none; }
  .chip-rail .chip { flex: 0 0 auto; scroll-snap-align: start; }
  .chip-rail .chip:last-child { margin-right: 22px; }
}
.chip-group.compact { gap: 5px; margin-top: 5px; }
.chip-group.compact .button { min-height: 34px; padding: 5px 11px; border-radius: 999px; font-size: 12px; }
.reply-options .chip span { justify-content: flex-start; border-radius: 11px; text-align: left; }
.reply-options .chip input[type="checkbox"]:checked + span::before { width: 6px; }

/* Role cards and difficulty choices: hide the radio dot, show the selection on the card. */
.role-option, .choice { position: relative; transition: background-color .2s, border-color .2s, box-shadow .25s, transform .14s; }
.role-option input, .choice input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.role-option { justify-content: center; align-items: center; padding: 9px 6px; text-align: center; }
.role-option small { font-size: 11px; }
.role-option:has(input:checked), .choice:has(input:checked) { box-shadow: 0 0 0 3px #9b76ed1f, 0 4px 16px #7a55e026; }
.role-option:has(input:checked)::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d4c0ff;
  box-shadow: 0 0 8px #b694ff;
  animation: pop-in .3s cubic-bezier(.3, 1.6, .5, 1);
}
.role-option:has(input:focus-visible), .choice:has(input:focus-visible) { outline: 2px solid #b99dff; outline-offset: 2px; }
.role-option:active, .choice:active { transform: scale(.97); }
.choice { font-weight: 650; }

.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.form-actions .button { min-height: 40px; }

/* ---------- Layout fixes ---------- */
.social-options { display: grid; justify-content: stretch; gap: 6px; }
.social-options > p { margin: 0 0 4px; }
.social-options .chip-field { margin-top: 4px; }
.online-limits-form .chip-field:first-child { margin-top: 0; }
.online-limits-form .address-fields .field { margin-top: 12px; }
.online-settings summary { display: flex; align-items: center; gap: 8px; padding: 6px 0; list-style: none; }
.online-settings summary::-webkit-details-marker { display: none; }
.online-settings summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .25s cubic-bezier(.3, 1.3, .5, 1);
}
.online-settings[open] summary::before { transform: rotate(45deg); }
.online-settings[open] .social-options { animation: rise .35s cubic-bezier(.2, .8, .2, 1); }
.mobile-guide { display: none; }
.dialog-actions .button { white-space: nowrap; }
.text-button { white-space: nowrap; }

@media (max-width: 580px) {
  .mobile-guide { display: inline-flex; }
  .header-end { gap: 4px; }
  .header-end .icon-button { width: 36px; height: 36px; }
  .profile { padding-right: 9px; }
  #profile-name { max-width: 5.5em; }
  .footer { flex-wrap: wrap; }
  .footer-note { flex: 1 1 200px; min-width: 0; }
  .social-panel, #lobby-notices { padding: 14px; border-radius: 14px; }
  #online-filters { padding: 8px 10px 10px; }
  .dialog-actions .button { flex: 1 1 auto; }
  .round-preferences-grid { gap: 6px; }
}
@media (max-width: 340px) {
  .wordmark span { display: none; }
  .brand-mark { width: 36px; height: 36px; font-size: 20px; }
  .wordmark { font-size: 18px; }
  .role-option small { display: none; }
  .role-option { min-height: 44px; }
}

/* ---------- Dialog: animated modal on desktop, bottom sheet on phones ---------- */
dialog {
  opacity: 0;
  transform: translateY(12px) scale(.97);
  overscroll-behavior: contain;
  transition-property: opacity, transform, overlay, display;
  transition-duration: .2s, .32s, .32s, .32s;
  transition-timing-function: ease, cubic-bezier(.2, .9, .3, 1), linear, linear;
  transition-behavior: allow-discrete;
}
dialog[open] { opacity: 1; transform: none; }
@starting-style {
  dialog[open] { opacity: 0; transform: translateY(16px) scale(.96); }
}
dialog::backdrop {
  opacity: 0;
  transition-property: opacity, overlay, display;
  transition-duration: .28s;
  transition-behavior: allow-discrete;
}
dialog[open]::backdrop { opacity: 1; }
@starting-style {
  dialog[open]::backdrop { opacity: 0; }
}
dialog.dragging { transition: none; }
.sheet-handle { display: none; }
.dialog-panel { animation: fade-in .25s ease; }

@media (max-width: 600px) {
  dialog {
    width: 100%;
    max-width: 100%;
    max-height: min(92dvh, calc(100dvh - 20px));
    margin: auto 0 0;
    border-width: 1px 0 0;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -12px 60px #000b;
    transform: translateY(100%);
  }
  dialog[open] { transform: none; }
  @starting-style {
    dialog[open] { opacity: 1; transform: translateY(100%); }
  }
  .dialog-panel { padding: 8px 18px calc(18px + env(safe-area-inset-bottom)); }
  .sheet-handle { display: block; width: 100%; height: 22px; margin-bottom: 2px; touch-action: none; cursor: grab; }
  .sheet-handle::before { content: ""; display: block; width: 40px; height: 4px; margin: 9px auto 0; border-radius: 4px; background: #ffffff33; }
  .dialog-top { touch-action: none; }
  .dialog-top h2 { font-size: 20px; }
}

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.3); } }
@keyframes sheet-up { from { opacity: .6; transform: translateY(40px); } }
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-2.5%, 1.5%, 0) scale(1.06); }
}
@keyframes halo { 0% { opacity: .7; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.18, 1.45); } }
@keyframes spin { to { transform: rotate(1turn); } }
@keyframes breathe { 50% { transform: scale(.93); box-shadow: 0 0 40px color-mix(in srgb, var(--phase) 45%, transparent), inset 0 0 30px #ad8bff27; } }
@keyframes stage-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes orb-in { from { opacity: 0; transform: scale(.6) rotate(-12deg); } }
@keyframes count-pop { 0% { opacity: 0; transform: scale(1.9); } 60% { opacity: 1; transform: scale(.95); } }
@keyframes trophy { 0% { opacity: 0; transform: scale(.4) rotate(-25deg); } 60% { transform: scale(1.12) rotate(6deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes badge-pop { 0% { transform: scale(.4); } 70% { transform: scale(1.2); } }

/* Lobby entrance */
#lobby > .hero { animation: rise .6s cubic-bezier(.2, .8, .2, 1) both; }
.directory-nav .button { animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; }
.directory-nav .button:nth-child(1) { animation-delay: .06s; }
.directory-nav .button:nth-child(2) { animation-delay: .1s; }
.directory-nav .button:nth-child(3) { animation-delay: .14s; }
.directory-nav .button:nth-child(4) { animation-delay: .18s; }
.modes { animation: rise .6s .2s cubic-bezier(.2, .8, .2, 1) both; }
.mode-card { transition: border-color .2s, background .2s, transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s; }
@media (hover: hover) {
  .mode-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px #0007, 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent); }
  .mode-card:hover .mode-icon { transform: scale(1.08) rotate(-4deg); }
}
.mode-icon { transition: transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.hero-art::before { animation: drift 16s ease-in-out infinite alternate; will-change: transform; }
.hero .button.primary { position: relative; }
.hero .button.primary::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 2px solid #b79bff;
  pointer-events: none;
  animation: halo 2.6s cubic-bezier(.2, .7, .3, 1) infinite;
}
.brand-mark svg path { stroke-dasharray: 44; stroke-dashoffset: 44; animation: draw 1.1s .15s cubic-bezier(.6, 0, .3, 1) forwards; }
#friend-count:not([hidden]) { animation: badge-pop .4s cubic-bezier(.3, 1.6, .5, 1); }
.directory-nav .button[aria-expanded="true"] { box-shadow: 0 6px 20px #6e48d033; }
#social:not([hidden]), #active-rooms:not([hidden]), #round-history:not([hidden]), #lobby-notices:not([hidden]),
#moderation-notice:not([hidden]), .watch-panel:not([hidden]) { animation: rise .38s cubic-bezier(.2, .8, .2, 1); }
.room:not([hidden]) { animation: fade-in .3s ease; }

/* Stage: phase changes, beats and states */
.beat-ring {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  box-shadow: inset 0 0 0 1.5px var(--phase), inset 0 0 46px color-mix(in srgb, var(--phase) 30%, transparent);
}
.stage-content.stage-enter > * { animation: stage-in .5s cubic-bezier(.2, .8, .2, 1) both; }
.stage-content.stage-enter > :nth-child(2) { animation-delay: .04s; }
.stage-content.stage-enter > :nth-child(3) { animation-delay: .08s; }
.stage-content.stage-enter > :nth-child(n + 4) { animation-delay: .12s; }
.stage-content.stage-enter > .orb { animation: orb-in .6s cubic-bezier(.3, 1.4, .5, 1) both; }
.room-stage[data-state="countdown"] .stage-enter > h2 { animation: count-pop .55s cubic-bezier(.2, .8, .3, 1) both; }
.room-stage[data-state="result"] .stage-enter > .orb { animation: trophy .8s cubic-bezier(.3, 1.4, .5, 1) both; }
.room-stage[data-state="result"] .orb { box-shadow: 0 0 40px #f4d29c40, inset 0 0 30px #ad8bff27; color: #f4d29c; }
.room-stage[data-cue="stop"] .stage-content:not(.stage-enter) .orb { animation: breathe 2.4s ease-in-out infinite; }
.orb { transition: color .5s, box-shadow .5s; }
.loading-orb::after { border-style: dashed; opacity: .32; animation: spin 9s linear infinite; }
.stage-badges span { transition: background-color .3s, border-color .3s; }
.room-stage .time-label { transition: color .4s; }
.room-stage[data-cue] .time-label { color: color-mix(in srgb, var(--phase) 60%, #fff); }

/* Toasts float above the in-room toolbar and spring in */
.toast {
  z-index: 60;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translate(-50%, 18px) scale(.96);
  background: #2a1d3bf2;
  box-shadow: 0 12px 34px #000a;
  backdrop-filter: blur(10px);
  transition: opacity .22s, transform .38s cubic-bezier(.2, 1.3, .4, 1);
}
.toast.show { transform: translate(-50%, 0) scale(1); }
body:has(#room.compact-round:not([hidden])) .toast { bottom: calc(72px + env(safe-area-inset-bottom)); }

/* In-room panels on phones slide up as sheets */
@media (max-width: 600px), (max-height: 520px) and (orientation: landscape) {
  .compact-round[data-room-panel="voice"] .room-voice,
  .compact-round[data-room-panel="chat"] .room-chat,
  .compact-round[data-room-panel="info"] .room-side,
  .compact-round[data-room-panel="more"] .round-more { animation: sheet-up .32s cubic-bezier(.2, .9, .3, 1); }
  .compact-round[data-room-panel] .room-panel-backdrop { animation: fade-in .25s ease; backdrop-filter: blur(3px); }
  .compact-round .mobile-room-tools {
    background: linear-gradient(to top, var(--bg) 70%, transparent);
    padding-top: 12px;
  }
  .compact-round .mobile-room-tools .button { transition: background-color .2s, border-color .2s, color .2s, transform .14s; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-art::before, .hero .button.primary::after, .loading-orb::after { animation: none !important; }
  .brand-mark svg path { stroke-dashoffset: 0; }
  dialog, dialog::backdrop { transition: none; }
}

/* Phones held sideways use the compact round layout above, with stage and controls side by side. */
@media (max-height: 520px) and (orientation: landscape) and (min-width: 601px) {
  .compact-round .stage-stack {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    align-items: start;
    gap: 8px;
  }
  .compact-round .room-stage { min-height: calc(100dvh - 120px); justify-content: center; }
  .compact-round .control-dock { margin-top: 0; max-height: calc(100dvh - 120px); overflow: auto; overscroll-behavior: contain; }
}

/* ---------- Phone round controls: tempo pad (leader) and prompt board (both roles) ---------- */
@property --tone { syntax: '<color>'; inherits: true; initial-value: #c6a8ff; }
.tempo-pad, .prompt-board { display: none; }
.tempo-pad[data-tone="fast"] { --tone: #8aebdb; }
.tempo-pad[data-tone="slow"] { --tone: #f4d29c; }
.tempo-pad[data-tone="stop"] { --tone: #ff9fbd; }
@keyframes sent-flash { 0% { opacity: 0; } 12%, 70% { opacity: 1; } 100% { opacity: 0; } }
@keyframes bar-pop { 0% { transform: scaleY(.6); } 60% { transform: scaleY(1.12); } }

@media (max-width: 600px), (max-height: 520px) and (orientation: landscape) {
  .compact-round .controller-desktop-controls, .compact-round .desktop-only { display: none; }
  .compact-round .round-more .tempo-row, .compact-round .round-more [data-kind="intensity"],
  .compact-round .round-more .prompt-group, .compact-round .round-more .round-details > summary { display: none; }
  /* Single shrinkable column: wide content (the tab rail) must never widen the page on small phones. */
  .compact-round .control-dock { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 8px; padding: 0; border: 0; background: none; }
  .compact-round .control-dock > * { min-width: 0; }
  .compact-round .control-dock.leader .dock-heading { display: none; }
  .compact-round .control-dock:not(.leader) .dock-heading { padding: 2px 4px 0; }
  .compact-round .dock-body .round-status {
    margin: 0;
    padding: 7px 11px;
    border: 1px solid #ffffff0f;
    border-radius: 11px;
    background: #1b1628;
    color: #d9cdee;
    font-size: .8125rem;
  }
  .compact-round .dock-body .round-extension { margin-top: 0; }
  .compact-round .control-dock:not(.leader) .dock-body > .dock-actions { margin-top: 6px; }
  .compact-round .dock-body [data-kind="reply"][data-value="uncomfortable"] {
    flex: 1 1 100%;
    min-height: 48px;
    border-color: #a05c77;
    background: #3d1f30;
    color: #ffc3d5;
    font-size: .9375rem;
  }

  .compact-round .tempo-pad {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 12px 12px 14px;
    border: 1px solid color-mix(in srgb, var(--tone) 30%, #2b263b);
    border-radius: 20px;
    background:
      radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--tone) 15%, transparent), transparent 72%),
      #151221;
    transition: --tone .45s ease, border-color .45s;
  }
  .pad-head { display: flex; align-items: center; justify-content: space-between; }
  .pad-title, .pad-label { color: var(--muted); font-size: .8125rem; font-weight: 650; letter-spacing: .04em; }
  .pad-mode {
    padding: 3px 10px;
    border: 1px solid color-mix(in srgb, var(--tone) 45%, transparent);
    border-radius: 999px;
    color: color-mix(in srgb, var(--tone) 75%, #fff);
    font-size: .75rem;
    font-weight: 700;
    transition: color .3s, border-color .3s, background-color .3s;
  }
  .pad-mode[data-mode="manual"] { background: color-mix(in srgb, var(--tone) 16%, transparent); }

  .pad-stepper { display: grid; grid-template-columns: 58px minmax(0, 1fr) 58px; align-items: center; gap: 6px; }
  .pad-step {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border: 1px solid color-mix(in srgb, var(--tone) 35%, #3a2f52);
    border-radius: 50%;
    background: #1d1830;
    color: #f4ecff;
    touch-action: manipulation;
    transition: transform .14s cubic-bezier(.3, .7, .4, 1), background-color .2s, border-color .3s;
  }
  .pad-step svg { width: 24px; height: 24px; }
  .pad-step:active:not(:disabled) { transform: scale(.9); background: color-mix(in srgb, var(--tone) 22%, #1d1830); }
  .pad-step:disabled { opacity: .3; }
  .pad-readout { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; column-gap: 5px; min-width: 0; text-align: center; }
  .pad-bpm { display: inline-block; color: #fff; font-size: 2.75rem; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
  .pad-unit { color: color-mix(in srgb, var(--tone) 70%, #fff); font-size: .8125rem; font-weight: 700; }
  .pad-name { flex-basis: 100%; margin-top: 2px; color: var(--muted); font-size: .8125rem; }
  .is-pending .pad-bpm { opacity: .85; }

  .pad-ladder { --pos: .5; position: relative; height: 40px; margin: 0 -2px; cursor: pointer; touch-action: none; outline-offset: 2px; }
  .ladder-track, .ladder-ticks { position: absolute; left: 14px; right: 14px; top: 50%; }
  .ladder-track { height: 6px; margin-top: -3px; border-radius: 6px; background: #2a2238; overflow: hidden; }
  .ladder-fill {
    width: calc(var(--pos) * 100%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f4d29c, var(--tone));
    transition: width .3s cubic-bezier(.2, .9, .3, 1.1);
  }
  .ladder-ticks { display: flex; justify-content: space-between; margin-top: -2px; pointer-events: none; }
  .ladder-ticks span { width: 4px; height: 4px; border-radius: 50%; background: #ffffff33; transition: background-color .2s; }
  .ladder-ticks span.on { background: #ffffffaa; }
  .ladder-thumb {
    position: absolute;
    top: 50%;
    left: calc(14px + (100% - 28px) * var(--pos));
    width: 26px;
    height: 26px;
    margin: -13px 0 0 -13px;
    border: 3px solid var(--tone);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 10px #0008;
    pointer-events: none;
    transition: left .3s cubic-bezier(.2, .9, .3, 1.15), border-color .3s;
  }
  .pad-ladder.dragging .ladder-thumb, .pad-ladder.dragging .ladder-fill { transition-duration: .08s; }
  .pad-ladder.dragging .ladder-thumb { width: 32px; height: 32px; margin: -16px 0 0 -16px; }
  .pad-ladder.is-idle .ladder-thumb { background: #2a2238; }
  .pad-ladder.is-idle .ladder-fill { opacity: .35; }
  .ladder-legend { display: flex; justify-content: space-between; margin-top: -6px; padding: 0 4px; color: #8f85a3; font-size: .6875rem; }

  .pad-strength { display: grid; grid-template-columns: auto minmax(0, 1fr) 3.2em; align-items: center; gap: 10px; }
  .strength-meter { display: flex; align-items: flex-end; gap: 5px; height: 38px; cursor: pointer; touch-action: none; outline-offset: 3px; }
  .strength-meter[aria-disabled="true"] { opacity: .4; cursor: default; }
  .strength-off {
    display: grid;
    place-items: center;
    flex: 0 0 30px;
    height: 26px;
    border: 1px solid #3a2f52;
    border-radius: 8px;
    color: #a99bbf;
    font-size: .75rem;
    font-weight: 700;
    transition: background-color .2s, color .2s, border-color .2s;
  }
  .strength-off.on { border-color: #6b5590; background: #2a2238; color: #fff; }
  .strength-bar {
    flex: 1 1 0;
    height: calc(10px + var(--h, 1) * 28px);
    border-radius: 6px;
    background: #2a2238;
    transform-origin: bottom;
    transition: background-color .25s;
  }
  .strength-bar.on { background: linear-gradient(to top, #8156ec, var(--tone)); animation: bar-pop .3s cubic-bezier(.3, 1.4, .5, 1); }
  .strength-value { color: #fff; font-size: .9375rem; font-weight: 750; text-align: right; font-variant-numeric: tabular-nums; }

  .pad-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pad-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 8px;
    border: 1px solid #3a2f52;
    border-radius: 15px;
    background: #1d1830;
    color: #eee4ff;
    font-size: .9375rem;
    font-weight: 750;
    touch-action: manipulation;
    transition: transform .14s cubic-bezier(.3, .7, .4, 1), background-color .25s, border-color .25s, color .25s, box-shadow .25s;
  }
  .pad-action svg, .pad-icon svg { width: 20px; height: 20px; }
  .pad-action-label { white-space: nowrap; }
  .compact-round .round-more .round-details { margin-top: 0; padding-top: 0; border-top: 0; }
  .pad-icon { display: inline-flex; }
  .pad-action:active { transform: scale(.95); }
  .pad-stop[aria-pressed="true"] { border-color: #ce79ab; background: #4a2238; color: #ffd0de; box-shadow: 0 0 0 3px #ff9fbd22; }
  .pad-auto[aria-pressed="true"] { border-color: #8d69d6; background: #2f2149; color: #fff; box-shadow: 0 0 0 3px #9b76ed22; }

  .compact-round .prompt-board { display: block; padding: 10px 10px 12px; border: 1px solid #2b263b; border-radius: 20px; background: #151221; }
  .board-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 8px;
    border-bottom: 1px solid #ffffff0d;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
  }
  .board-tabs::-webkit-scrollbar { display: none; }
  .board-tabs [role="tab"] {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: .8125rem;
    font-weight: 650;
    transition: background-color .2s, color .2s, border-color .2s;
  }
  .board-tabs [role="tab"]:last-child { margin-right: 20px; }
  .board-tabs [role="tab"][aria-selected="true"] { border-color: #6d52a3; background: #2d2145; color: #fff; }
  .board-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 6px;
    max-height: calc(3 * 50px + 2 * 6px);
    margin-top: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }
  .board-choice {
    position: relative;
    min-height: 50px;
    padding: 8px 10px;
    overflow: hidden;
    border: 1px solid #3a2f52;
    border-radius: 13px;
    background: #1b1628;
    color: #e9dff7;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    overflow-wrap: anywhere;
    touch-action: manipulation;
    transition: transform .14s cubic-bezier(.3, .7, .4, 1), background-color .2s, border-color .2s;
  }
  .board-choice:active { transform: scale(.96); background: #261d38; }
  .board-choice.sending { border-color: #6d52a3; }
  .board-choice.sent::after {
    content: "✓ 已发送";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: #1d3a34;
    color: #a7f1df;
    font-weight: 750;
    animation: sent-flash 1.2s ease forwards;
  }
  .board-empty { grid-column: 1 / -1; margin: 6px 2px; color: var(--muted); font-size: .8125rem; }
  .board-edit {
    grid-column: 1 / -1;
    min-height: 42px;
    border: 1px dashed #4a3c5f;
    border-radius: 13px;
    background: transparent;
    color: #cbb8ef;
    font-size: .8125rem;
    font-weight: 650;
  }
}
@media (max-height: 520px) and (orientation: landscape) and (min-width: 601px) {
  .compact-round .stage-stack { grid-template-columns: minmax(0, .62fr) minmax(0, 1.38fr); }
  /* The pad splits in two so tempo and strength/actions are both visible without scrolling. */
  .compact-round .tempo-pad {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "head head" "stepper strength" "ladder actions" "legend actions";
    column-gap: 16px;
    row-gap: 6px;
    padding: 10px 12px 12px;
  }
  .pad-head { grid-area: head; }
  .pad-stepper { grid-area: stepper; grid-template-columns: 46px minmax(0, 1fr) 46px; }
  .pad-ladder { grid-area: ladder; }
  .ladder-legend { grid-area: legend; }
  .pad-strength { grid-area: strength; align-self: center; }
  .pad-actions { grid-area: actions; align-self: end; }
  .pad-step { width: 46px; height: 46px; }
  .pad-bpm { font-size: 2rem; }
  .pad-action { min-height: 46px; gap: 6px; font-size: .875rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ladder-thumb, .ladder-fill { transition: none; }
}

/* ---------- Room chat (公屏) ---------- */
@keyframes bubble-in { from { opacity: 0; transform: translateY(8px) scale(.96); } }
@keyframes chip-fire { 0% { transform: scale(1); } 40% { transform: scale(.88); } 100% { transform: scale(1); } }
@keyframes spin-dot { to { transform: rotate(1turn); } }
@keyframes peek-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.chat-panel { display: flex; flex-direction: column; gap: 8px; }
.chat-panel .chat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-panel .chat-head h3 { margin: 0; font-size: 1rem; }
.chat-scope { padding: 3px 9px; border: 1px solid #3a2f52; border-radius: 999px; color: var(--muted); font-size: .75rem; }
.chat-scope.public { border-color: #3d8d80; color: #a7f1df; }
.chat-scroll { position: relative; min-height: 120px; max-height: 20rem; overflow-y: auto; overscroll-behavior: contain; padding: 2px 2px 4px; scroll-padding-bottom: 8px; }
.chat-panel .chat-log { max-height: none; overflow: visible; display: flex; flex-direction: column; gap: 2px; }
.chat-panel .chat-empty { margin: 18px 0; color: var(--muted); font-size: .875rem; text-align: center; }
.chat-item { display: flex; flex-direction: column; align-items: flex-start; max-width: 100%; margin-top: 8px; padding: 0; border: 0; }
.chat-panel .chat-log .chat-item { padding: 0; border: 0; }
.chat-item.continued { margin-top: 3px; }
.chat-item.mine { align-items: flex-end; }
.chat-meta { display: flex; align-items: baseline; gap: 6px; margin: 0 6px 3px; color: var(--muted); font-size: .75rem; }
.chat-author { color: #cbb8ef; font-weight: 650; }
.chat-item.mine .chat-author { color: #e4d6ff; }
.chat-tag { padding: 0 5px; border: 1px solid #4a3c5f; border-radius: 5px; font-size: .6875rem; }
.chat-bubble {
  max-width: min(82%, 28rem);
  padding: 8px 12px;
  border: 1px solid #3a2f52;
  border-radius: 18px 18px 18px 6px;
  background: #231b33;
  color: #f1e9ff;
  font-size: .9375rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chat-item.continued .chat-bubble { border-top-left-radius: 8px; }
.chat-item.mine .chat-bubble {
  border-color: #a184ff66;
  border-radius: 18px 18px 6px 18px;
  background: linear-gradient(135deg, #8a64f5, #6e4ade);
  color: #fff;
  box-shadow: 0 4px 16px #6e48d033;
}
.chat-item.mine.continued .chat-bubble { border-top-right-radius: 8px; }
.chat-item.emoji-only .chat-bubble { padding: 2px 4px; border: 0; background: none; box-shadow: none; font-size: 2rem; line-height: 1.2; }
.chat-item:not(.settled) .chat-bubble { animation: bubble-in .26s cubic-bezier(.2, .9, .3, 1.2); }
.chat-item.mine:not(.settled) .chat-bubble { transform-origin: bottom right; }
.chat-item.theirs:not(.settled) .chat-bubble { transform-origin: bottom left; }
.chat-item.pending .chat-bubble { opacity: .72; }
.chat-item.failed .chat-bubble { border-color: #ce79ab; background: #3d1f30; }
.chat-state { display: flex; align-items: center; gap: 6px; margin: 2px 6px 0; color: var(--muted); font-size: .75rem; }
.chat-state:empty { display: none; }
.chat-item.failed .chat-state { color: #ffb3c8; }
.chat-spinner { width: 10px; height: 10px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin-dot .8s linear infinite; }
.chat-retry { padding: 2px 9px; border: 1px solid #ce79ab; border-radius: 999px; background: none; color: #ffd0de; font-size: .75rem; font-weight: 650; }
.chat-jump {
  align-self: center;
  margin-top: -40px;
  position: relative;
  z-index: 2;
  padding: 6px 12px;
  border: 1px solid #6d52a3;
  border-radius: 999px;
  background: #2d2145f2;
  color: #fff;
  font-size: .8125rem;
  font-weight: 650;
  box-shadow: 0 6px 18px #0008;
  animation: peek-in .25s ease;
}
.chat-form { display: grid; gap: 8px; }
.chat-quick { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 20px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 20px), transparent); }
.chat-quick::-webkit-scrollbar { display: none; }
.chat-chip {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid #3f3252;
  border-radius: 999px;
  background: #1b1528;
  color: #e3d8f5;
  font-size: .8125rem;
  font-weight: 600;
  white-space: nowrap;
  touch-action: manipulation;
  transition: background-color .2s, border-color .2s;
}
.chat-chip.emoji { min-width: 38px; padding: 4px 8px; font-size: 1.125rem; }
.chat-chip.edit { border-style: dashed; color: var(--muted); }
.chat-chip:last-child { margin-right: 18px; }
.chat-chip.fired { animation: chip-fire .32s cubic-bezier(.3, 1.4, .5, 1); border-color: #8d69d6; }
@media (hover: hover) { .chat-chip:hover { border-color: #6b5590; background: #251c36; } }
.chat-phrase-editor { padding: 10px; border: 1px solid #3a2f52; border-radius: 14px; background: #171223; }
.chat-phrase-editor .field { margin: 0; font-size: .8125rem; color: var(--muted); }
.chat-phrase-editor textarea { display: block; width: 100%; margin-top: 6px; padding: 8px 10px; resize: vertical; }
.chat-editor-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.chat-editor-actions .button { min-height: 38px; padding: 6px 14px; }
.chat-editor-status:empty { display: none; }
.chat-editor-status { margin: 6px 0 0; color: #ffb3c8; font-size: .8125rem; }
.chat-panel .chat-compose {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 14px;
  border: 1px solid #41334f;
  border-radius: 24px;
  background: #100e1b;
  transition: border-color .2s, box-shadow .2s;
}
.chat-panel .chat-compose:focus-within { border-color: #9b76ed; box-shadow: 0 0 0 3px #9b76ed30; }
.chat-panel .chat-compose input { flex: 1; min-width: 0; min-height: 40px; padding: 0; border: 0; background: none; box-shadow: none; font-size: 1rem; }
.chat-panel .chat-compose input:focus-visible { box-shadow: none; outline: none; background: none; }
.chat-count { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.chat-send {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #9b75fa, #7552e8);
  color: #fff;
  box-shadow: 0 4px 14px #7552e855;
  touch-action: manipulation;
  transition: transform .14s cubic-bezier(.3, .7, .4, 1);
}
.chat-send svg { width: 20px; height: 20px; }
.chat-send:active { transform: scale(.88); }
.chat-panel .chat-error { margin: 0; color: #ffb3c8; font-size: .8125rem; }

.mobile-room-tools [data-badge] { position: relative; }
.mobile-room-tools [data-badge]::after {
  content: attr(data-badge);
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: #ff7fa8;
  color: #2a0b19;
  font-size: .6875rem;
  font-weight: 800;
  line-height: 16px;
  animation: badge-pop .35s cubic-bezier(.3, 1.6, .5, 1);
}
.chat-peek { display: none; }
@media (max-width: 600px), (max-height: 520px) and (orientation: landscape) {
  .compact-round .chat-peek:not([hidden]) {
    position: fixed;
    z-index: 33;
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(70px + env(safe-area-inset-bottom));
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid #6d52a3;
    border-radius: 16px;
    background: #2a1f3ff2;
    color: #f4ecff;
    box-shadow: 0 10px 30px #000a;
    backdrop-filter: blur(10px);
    text-align: left;
    font-size: .9375rem;
    animation: peek-in .3s cubic-bezier(.2, .9, .3, 1.15);
  }
  .chat-peek strong { flex: 0 0 auto; color: #cbb8ef; font-size: .8125rem; }
  .chat-peek span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* The chat sheet is a column: messages scroll, the composer stays at the bottom. */
  .compact-round[data-room-panel="chat"] .room-chat {
    display: flex;
    height: min(72dvh, calc(100dvh - 90px));
    max-height: none;
    overflow: hidden;
    padding: 12px;
  }
  .compact-round[data-room-panel="chat"] .chat-scroll { flex: 1; max-height: none; }
  body.keyboard-open .compact-round[data-room-panel="chat"] .room-chat {
    bottom: calc(var(--kb, 0px) + 6px);
    height: min(72dvh, calc(100dvh - var(--kb, 0px) - 16px));
  }
}

/* ---------- End-of-round report ---------- */
@keyframes strip-reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes badge-in { 0% { opacity: 0; transform: translateY(10px) scale(.8); } 70% { transform: translateY(0) scale(1.04); } 100% { opacity: 1; transform: none; } }
@keyframes trophy-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3px) rotate(-4deg); } }
.report-dialog {
  --report-fast: #8aebdb;
  --report-slow: #f4d29c;
  --report-stop: #ff9fbd;
  --report-unknown: #3a3346;
  width: min(520px, calc(100% - 28px));
  overflow-x: hidden;
}
.report-panel { position: relative; display: grid; gap: 14px; padding: 18px 20px 20px; }
.report-panel .sheet-handle { display: none; }
.report-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.report-head h2 { margin: 0; font-size: 1.375rem; }
.report-head p { margin: 2px 0 0; color: var(--muted); font-size: .8125rem; }
.report-trophy { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: radial-gradient(circle at 30% 25%, #4a3270, #241938); font-size: 1.6rem; box-shadow: 0 6px 20px #6e48d044; }
.report-dialog.revealed .report-trophy { animation: trophy-bob 2.4s ease-in-out .6s infinite; }
.report-close { margin: -6px -6px 0 0; }
.report-ribbons { display: flex; flex-wrap: wrap; gap: 6px; }
.report-ribbon { padding: 4px 10px; border-radius: 999px; background: linear-gradient(135deg, #f4d29c, #ffb07f); color: #3a2208; font-size: .75rem; font-weight: 800; animation: badge-in .5s cubic-bezier(.3, 1.4, .5, 1) both; }
.report-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 18px; padding: 14px; border: 1px solid #3a2f52; border-radius: 18px; background: radial-gradient(120% 120% at 0% 0%, #2c1f45, #171222 70%); }
.report-ring { position: relative; width: 112px; height: 112px; }
.report-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.report-ring circle { fill: none; stroke-width: 9; }
.ring-track { stroke: #2a2238; }
.ring-value { stroke: #b694ff; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--percent, 0)); transition: stroke-dashoffset 1.1s cubic-bezier(.2, .8, .2, 1) .15s; filter: drop-shadow(0 0 6px #9b76ed88); }
.report-ring > span { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.report-ring strong { font-size: 1.9rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.report-ring small { margin-top: 3px; color: var(--muted); font-size: .6875rem; }
.report-duration { display: grid; gap: 4px; min-width: 0; }
.report-duration strong { font-size: 2.4rem; font-weight: 800; line-height: 1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.report-duration small { color: var(--muted); font-size: .8125rem; }
.report-duration .early { color: #f4d29c; }
.report-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.report-stat { padding: 9px 10px; border: 1px solid #2e2640; border-radius: 13px; background: #1a1528; }
.report-stat dt { color: var(--muted); font-size: .75rem; }
.report-stat dd { margin: 3px 0 0; font-size: 1.125rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.report-stat small { color: var(--muted); font-size: .75rem; font-weight: 600; }
.report-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.report-section-head h3 { margin: 0; font-size: .9375rem; }
.report-section-head span { color: var(--muted); font-size: .75rem; }
.report-strip { display: flex; height: 18px; overflow: visible; border-radius: 6px; background: #1a1528; }
.report-dialog.revealed .report-strip { animation: strip-reveal 1s cubic-bezier(.4, 0, .2, 1) both; }
.report-seg { position: relative; flex: 0 0 var(--w, 0%); background: var(--report-unknown); }
.report-seg:first-child { border-radius: 6px 0 0 6px; }
.report-seg:last-child { border-radius: 0 6px 6px 0; }
.report-seg.fast { background: var(--report-fast); }
.report-seg.slow { background: var(--report-slow); }
.report-seg.stop { background: var(--report-stop); }
.report-seg.hit::after { content: ""; position: absolute; left: 50%; top: -7px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px #fff; }
.report-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; color: var(--muted); font-size: .75rem; }
.report-legend .dot { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: var(--report-unknown); }
.report-legend .dot.fast { background: var(--report-fast); }
.report-legend .dot.slow { background: var(--report-slow); }
.report-legend .dot.stop { background: var(--report-stop); }
.report-legend .dot.hit { background: #fff; box-shadow: 0 0 6px #fff; }
.report-badges ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.report-badge { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid #6d52a3; border-radius: 15px; background: linear-gradient(135deg, #2d2145, #1d1730); box-shadow: 0 0 0 3px #9b76ed14; animation: badge-in .55s cubic-bezier(.3, 1.4, .5, 1) both; }
.report-badge:nth-child(1) { animation-delay: .6s; }
.report-badge:nth-child(2) { animation-delay: .75s; }
.report-badge:nth-child(3) { animation-delay: .9s; }
.report-badge:nth-child(n + 4) { animation-delay: 1.05s; }
.badge-icon { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 13px; background: radial-gradient(circle at 30% 25%, #57408a, #2a1f40); font-size: 1.4rem; }
.report-badge strong, .report-badge small { display: block; }
.report-badge small { margin-top: 2px; color: var(--muted); font-size: .75rem; }
.report-goal { display: grid; gap: 6px; margin: 0; color: #dcd0f0; font-size: .8125rem; }
.goal-bar { display: block; height: 6px; border-radius: 6px; background: #2a2238; overflow: hidden; }
.goal-bar i { display: block; width: calc(var(--share, 0) * 100%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8156ec, #c9b2ff); transition: width 1.1s cubic-bezier(.2, .8, .2, 1) .3s; }
.report-totals { margin: 0; color: var(--muted); font-size: .8125rem; text-align: center; }
.report-actions { display: flex; gap: 8px; }
.report-actions .button { flex: 1; }
.report-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
@media (max-width: 600px) {
  .report-dialog { width: 100%; }
  .report-panel { padding: 6px 16px calc(18px + env(safe-area-inset-bottom)); }
  .report-panel .sheet-handle { display: block; height: 18px; }
  .report-panel .sheet-handle::before { content: ""; display: block; width: 40px; height: 4px; margin: 7px auto 0; border-radius: 4px; background: #ffffff33; }
  .report-hero { gap: 14px; padding: 12px; }
  .report-ring { width: 96px; height: 96px; }
  .report-duration strong { font-size: 2rem; }
  .report-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .ring-value, .goal-bar i { transition: none; }
}

/* ---------- Lobby views and navigation ---------- */
.view-tabs { display: flex; align-self: stretch; gap: 6px; }
.view-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: .02em;
  transition: color .2s;
}
.view-tab .tab-icon { font-size: 16px; }
.view-tab[aria-current="page"] { color: #f4ecff; }
.view-tab[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: #a17bf6;
  animation: fade-in .25s ease;
}
@media (hover: hover) { .view-tab:hover { color: #eee4ff; } }
.tab-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff7fa8;
  color: #2a0b19;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  animation: badge-pop .35s cubic-bezier(.3, 1.6, .5, 1);
}
body:has(#lobby[hidden]) .view-tabs { visibility: hidden; }
.view:not([hidden]) { animation: rise .38s cubic-bezier(.2, .8, .2, 1); }
.view-home > .modes { margin-top: 22px; }
.section-hint { color: var(--muted); font-size: .8125rem; }
.active-rooms { margin-top: 22px; }

.me-teaser {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #3a2f52;
  border-radius: 16px;
  background: linear-gradient(135deg, #24193a, #181324);
  color: inherit;
  text-align: left;
  transition: border-color .2s, transform .14s;
}
.me-teaser:active { transform: scale(.98); }
@media (hover: hover) { .me-teaser:hover { border-color: #6d52a3; } }
.teaser-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #2d2145; font-size: 1.3rem; }
.me-teaser strong, .me-teaser small { display: block; }
.me-teaser small { margin-top: 2px; color: var(--muted); font-size: .8125rem; }
.me-teaser [data-icon] { color: var(--muted); }

/* 我的 */
.me { display: grid; gap: 16px; margin-top: 22px; }
.me-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid #3a2f52;
  border-radius: 20px;
  background: radial-gradient(120% 140% at 0% 0%, #34224f, #171222 65%);
}
.me-avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #9b75fa, #6e4ade);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  box-shadow: 0 6px 22px #6e48d055;
}
.me-name h2 { margin: 0; font-size: 1.25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-name p { margin: 3px 0 0; color: var(--muted); font-size: .8125rem; }
.me-card .button { min-height: 38px; padding: 6px 12px; }
.me-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
.me-stat { padding: 11px 12px; border: 1px solid #2e2640; border-radius: 14px; background: #171322; }
.me-stat dt { color: var(--muted); font-size: .75rem; }
.me-stat dd { margin: 4px 0 0; font-size: 1.2rem; font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.me-stat small { margin-left: 2px; color: var(--muted); font-size: .75rem; font-weight: 600; }
.me-achievements .section-label { align-items: baseline; margin-bottom: 10px; }
.me-achievements .section-label span { color: var(--muted); font-size: .8125rem; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.ach {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid #2a2339;
  border-radius: 15px;
  background: #141020;
  color: #8f85a3;
}
.ach .ach-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 4px; border-radius: 12px; background: #1f1a2b; font-size: 1.35rem; filter: grayscale(1) opacity(.45); }
.ach strong { color: #b6abc8; font-size: .875rem; }
.ach small { font-size: .75rem; line-height: 1.4; }
.ach.unlocked { border-color: #5c4590; background: linear-gradient(160deg, #2a1e42, #171222); color: #cbb8ef; }
.ach.unlocked .ach-icon { background: radial-gradient(circle at 30% 25%, #57408a, #2a1f40); filter: none; box-shadow: 0 0 16px #9b76ed33; }
.ach.unlocked strong { color: #fff; }
.ach-bar { display: block; height: 4px; margin-top: 6px; border-radius: 4px; background: #2a2238; overflow: hidden; }
.ach-bar i { display: block; width: calc(var(--share, 0) * 100%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6e4ade, #b694ff); }
.me-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.me-links .button { min-height: 46px; }
.me-note { margin: -4px 0 0; color: var(--muted); font-size: .75rem; text-align: center; }
.view-me #round-history { margin-top: 0; }
.history-actions.segmented { max-width: 28rem; margin: 12px 0; }
.history-tab {
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #cfc2e4;
  font-size: 13px;
  font-weight: 650;
  transition: background-color .2s, border-color .2s, color .2s;
}
.history-tab[aria-pressed="true"] { border-color: #8d69d6; background: linear-gradient(135deg, #3d2864, #2b1d48); color: #fff; }
.archive-mode .view-tab[data-view="home"], .archive-mode .view-tab[data-view="online"] { display: none; }

@media (max-width: 580px) {
  .header .profile { display: none; }
  /* Phones: the four views live in a bottom tab bar. */
  .view-tabs {
    position: fixed;
    z-index: 40;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 0;
    padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
    border-top: 1px solid #ffffff12;
    background: #110e1bf0;
    backdrop-filter: blur(14px);
  }
  body:has(#lobby[hidden]) .view-tabs { display: none; }
  .view-tab { flex-direction: column; justify-content: center; gap: 3px; min-height: 52px; padding: 4px 0; border-radius: 14px; font-size: 11px; }
  .view-tab .tab-icon { font-size: 21px; transition: transform .25s cubic-bezier(.3, 1.5, .5, 1); }
  .view-tab[aria-current="page"] { background: #241a37; }
  .view-tab[aria-current="page"] .tab-icon { transform: translateY(-1px) scale(1.08); color: #c9b2ff; }
  .view-tab[aria-current="page"]::after { display: none; }
  .view-tab .tab-badge { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 17px; height: 17px; line-height: 17px; font-size: 10px; }
  body:has(#lobby:not([hidden])) { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  body:has(#lobby:not([hidden])) .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .me-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ach-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .me-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .me-card { padding: 14px; gap: 12px; }
  .me-avatar { width: 50px; height: 50px; font-size: 1.3rem; }
  .active-rooms .social-heading { align-items: baseline; }
}

/* Typing indicator */
@keyframes typing-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
.chat-typing { display: flex; margin-top: 8px; animation: bubble-in .25s ease; }
.chat-typing[hidden] { display: none; }
.chat-typing .chat-bubble { display: inline-flex; padding: 10px 14px; }
.typing-dots { display: inline-flex; gap: 4px; }
.typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: #cbb8ef; animation: typing-dot 1.2s ease-in-out infinite; }
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
@media (prefers-reduced-motion: reduce) { .typing-dots i { animation: none; opacity: .8; } }

/* Friend messages share the room chat's bubble look (styles only; behaviour is unchanged). */
.friend-chat .chat-log { display: flex; flex-direction: column; gap: 6px; padding: 4px 2px; }
.friend-chat .chat-log li {
  align-self: flex-start;
  max-width: 82%;
  margin: 0;
  padding: 7px 12px 8px;
  border: 1px solid #3a2f52;
  border-radius: 18px 18px 18px 6px;
  background: #231b33;
}
.friend-chat .chat-log li.mine {
  align-self: flex-end;
  border-color: #a184ff66;
  border-radius: 18px 18px 6px 18px;
  background: linear-gradient(135deg, #8a64f5, #6e4ade);
  box-shadow: 0 4px 16px #6e48d033;
}
.friend-chat .chat-log li strong { color: #cbb8ef; font-size: .75rem; }
.friend-chat .chat-log li.mine strong { color: #efe6ff; }
.friend-chat .chat-log time { float: none; margin-inline-start: 6px; color: var(--muted); font-size: .6875rem; }
.friend-chat .chat-log li.mine time { color: #e4d6ffcc; }
.friend-chat .chat-log li p { margin: 2px 0 0; color: #f1e9ff; font-size: .9375rem; line-height: 1.45; }
.friend-chat .chat-log li.mine p { color: #fff; }
.friend-chat .chat-compose { align-items: center; padding: 4px 4px 4px 14px; border: 1px solid #41334f; border-radius: 24px; background: #100e1b; }
.friend-chat .chat-compose:focus-within { border-color: #9b76ed; box-shadow: 0 0 0 3px #9b76ed30; }
.friend-chat .chat-compose input { min-height: 40px; padding: 0; border: 0; background: none; box-shadow: none; }
.friend-chat .chat-compose input:focus-visible { box-shadow: none; background: none; }
.friend-chat .chat-compose .button { min-height: 38px; padding: 6px 16px; border-radius: 999px; }

/* Live headcount on the homepage */
.live-presence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 18px 0 12px;
  padding: 9px 14px;
  border: 1px solid #2e2843;
  border-radius: 999px;
  background: #15111fcc;
  font-size: .875rem;
  color: var(--muted);
  width: fit-content;
  max-width: 100%;
}
.live-dot { position: relative; width: 9px; height: 9px; border-radius: 50%; background: #5fe3a1; box-shadow: 0 0 0 0 #5fe3a180; animation: live-ping 2.2s ease-out infinite; }
@keyframes live-ping { 0% { box-shadow: 0 0 0 0 #5fe3a170; } 70%, 100% { box-shadow: 0 0 0 9px #5fe3a100; } }
.live-headline { color: var(--text); }
.live-total { display: inline-block; min-width: 1.4ch; font-variant-numeric: tabular-nums; color: #8ff0bf; font-size: 1.05rem; }
.live-presence.live-bump .live-total { animation: live-bump .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes live-bump { 40% { transform: scale(1.18); } }
.live-parts { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; }
.live-part strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.live-part::before { content: "·"; margin-right: 10px; color: #4b4263; }
.live-part:first-child::before { display: none; }
.live-headline + .live-parts:not(:empty)::before { content: ""; width: 1px; height: 12px; margin-right: 2px; background: #3b3352; align-self: center; }

/* Queue screen */
.queue-board { display: grid; gap: 14px; width: min(460px, 100%); margin: 6px auto 0; text-align: center; }
.queue-clock { display: grid; justify-items: center; gap: 2px; }
.queue-elapsed { font-size: 2.4rem; font-weight: 700; letter-spacing: .02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.queue-clock small { color: var(--muted); font-size: .78rem; }
.queue-estimate { margin: 0; color: #d9cff0; font-size: .9rem; }
.queue-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.queue-stats div { display: grid; gap: 2px; padding: 10px 6px; border: 1px solid #2f2944; border-radius: 14px; background: #17132299; }
.queue-stats strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.queue-stats span { color: var(--muted); font-size: .75rem; }
.queue-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.queue-roles { display: flex; gap: 3px; height: 8px; overflow: hidden; border-radius: 99px; background: #241f33; }
.queue-role { flex: var(--share, 1) 1 0; min-width: 6px; border-radius: 99px; transition: flex-grow .5s ease; }
.queue-role.controller, .queue-legend .controller::before { background: var(--purple); }
.queue-role.receiver, .queue-legend .receiver::before { background: var(--pink); }
.queue-role.either, .queue-legend .either::before { background: var(--mint); }
.queue-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; color: var(--muted); font-size: .78rem; }
.queue-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; vertical-align: 1px; }
.queue-hints { display: grid; gap: 8px; text-align: left; }
.queue-hint { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 12px; border: 1px solid #3a2f52; border-radius: 14px; background: #1e1730; font-size: .84rem; }
.queue-hint p { margin: 0; flex: 1 1 200px; color: #e6dcfb; }
.queue-hint .button { padding: 7px 12px; font-size: .8rem; }

/* Background matching pill */
.match-pill {
  position: fixed;
  z-index: 55;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex;
  align-items: stretch;
  max-width: calc(100% - 32px);
  border: 1px solid #5b4689;
  border-radius: 999px;
  background: #1f1733f2;
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 40px #00000070, 0 0 0 4px #8e6cff14;
  transform: translateX(-50%);
  animation: pill-in .35s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes pill-in { from { opacity: 0; transform: translate(-50%, 14px) scale(.96); } }
.match-pill-main { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 6px 8px 16px; border: 0; background: none; text-align: left; }
.match-pill-copy { display: grid; min-width: 0; }
.match-pill-copy strong { font-size: .9rem; white-space: nowrap; }
.match-elapsed { font-variant-numeric: tabular-nums; color: #cdb8ff; }
.match-pill-copy small { overflow: hidden; color: var(--muted); font-size: .74rem; white-space: nowrap; text-overflow: ellipsis; }
.match-pulse { position: relative; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle, #b79bff 0 28%, transparent 30%); }
.match-pulse::before, .match-pulse::after { content: ""; position: absolute; inset: 0; border: 2px solid #b79bff; border-radius: 50%; opacity: 0; animation: radar 2s ease-out infinite; }
.match-pulse::after { animation-delay: 1s; }
@keyframes radar { 0% { transform: scale(.35); opacity: .9; } 100% { transform: scale(1.15); opacity: 0; } }
.match-pill-cancel { display: grid; place-items: center; width: 44px; border: 0; border-left: 1px solid #ffffff14; border-radius: 0 999px 999px 0; background: none; color: var(--muted); }
@media (hover: hover) { .match-pill-cancel:hover { color: var(--text); background: #ffffff0a; } }
.toast { transition: opacity .2s, transform .2s, bottom .2s; }
body.matching-in-background .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }

/* Invitation / friend request popup */
.social-popup {
  position: fixed;
  z-index: 58;
  top: calc(76px + env(safe-area-inset-top));
  right: max(20px, calc((100% - 1120px) / 2));
  width: min(380px, calc(100% - 32px));
}
.social-popup.popup-enter { animation: popup-in .42s cubic-bezier(.2, .9, .25, 1.25); }
@keyframes popup-in { from { opacity: 0; transform: translateY(-14px) scale(.97); } }
.popup-card { display: grid; gap: 12px; padding: 16px; border: 1px solid #5b4689; border-radius: 20px; background: linear-gradient(160deg, #271c3f, #181324 70%); box-shadow: 0 22px 60px #000000a0; }
.popup-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.popup-avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: #3a2a5c; color: #e1d3ff; font-size: 1.25rem; }
.popup-copy { min-width: 0; }
.popup-copy h2 { margin: 2px 0 4px; font-size: 1rem; line-height: 1.35; overflow-wrap: anywhere; }
.popup-copy p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.popup-kicker { color: #c9b2ff !important; font-size: .72rem !important; letter-spacing: .06em; }
.popup-close { display: grid; place-items: center; width: 32px; height: 32px; margin: -4px -4px 0 0; border: 0; border-radius: 10px; background: none; color: var(--muted); }
@media (hover: hover) { .popup-close:hover { background: #ffffff0d; color: var(--text); } }
.popup-timer { height: 3px; overflow: hidden; border-radius: 99px; background: #ffffff12; }
.popup-timer span { display: block; height: 100%; background: linear-gradient(90deg, #ff9cb9, #bba4ff); transform-origin: left; animation: popup-countdown var(--left, 45s) linear forwards; }
@keyframes popup-countdown { to { transform: scaleX(0); } }
.popup-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.popup-actions .button { justify-content: center; }
.popup-more { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.popup-more .text-button { padding: 2px 0; color: var(--muted); font-size: .76rem; }
.popup-queue { margin: 0; color: #c9b2ff; font-size: .76rem; text-align: center; }
@media (max-width: 580px) {
  .social-popup { top: calc(10px + env(safe-area-inset-top)); right: 16px; left: 16px; width: auto; }
  .match-pill { bottom: calc(80px + env(safe-area-inset-bottom)); }
  body:has(#lobby[hidden]) .match-pill { bottom: calc(16px + env(safe-area-inset-bottom)); }
  body.matching-in-background:has(#lobby:not([hidden])) .toast { bottom: calc(146px + env(safe-area-inset-bottom)); }
  .queue-elapsed { font-size: 2rem; }
  .live-presence { margin-top: 12px; border-radius: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot, .match-pulse::before, .match-pulse::after { animation: none; }
  .match-pill, .social-popup.popup-enter { animation: none; }
}

/* Site announcements */
.site-notices { display: grid; gap: 10px; margin-top: 16px; }
.site-notices.in-room { margin-top: 12px; }
.site-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  border: 1px solid #3d3456;
  border-left: 4px solid var(--purple);
  border-radius: 14px;
  background: linear-gradient(120deg, #1d1630, #15111f);
  animation: rise .35s cubic-bezier(.2, .8, .2, 1);
}
.site-notice[data-level="important"] { border-color: #5a4126; border-left-color: #ffb86b; background: linear-gradient(120deg, #2a1d12, #18121a); }
.site-notice-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #2b2142; color: #cbb6ff; }
.site-notice[data-level="important"] .site-notice-icon { background: #43301b; color: #ffc98f; }
.site-notice-copy { min-width: 0; }
.site-notice-copy strong { display: block; font-size: .95rem; overflow-wrap: anywhere; }
.site-notice-copy p { margin: 3px 0 0; color: var(--muted); font-size: .85rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.site-notice-close { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 9px; background: none; color: var(--muted); }
@media (hover: hover) { .site-notice-close:hover { background: #ffffff0d; color: var(--text); } }

/* Administrator reminder inside a room */
.admin-reminder {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 10px 10px 14px;
  border: 1px solid #6b4a20;
  border-radius: 14px;
  background: #2a1d12;
  color: #ffd9a8;
  font-size: .9rem;
  animation: rise .3s ease;
}
.admin-reminder[hidden] { display: none; }
.admin-reminder-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.admin-reminder-close { display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; border: 0; border-radius: 9px; background: none; color: #ffd9a8; }
@media (max-width: 580px) {
  .site-notice { padding: 10px 8px 10px 12px; gap: 10px; }
  .site-notice-icon { width: 28px; height: 28px; }
}

/* Administrator listening request shown to players */
.room [data-admin-listeners] {
  margin: 0 0 12px;
  padding: 14px 16px;
  border: 1px solid #2f6a62;
  border-radius: 16px;
  background: linear-gradient(135deg, #10302c, #15111f 70%);
  animation: rise .3s ease;
}
.room [data-admin-listeners] h2 { margin: 0 0 6px; font-size: 1.02rem; line-height: 1.4; }
.room [data-admin-listeners] p { margin: 0 0 12px; font-size: .82rem; }
.room [data-admin-listeners] .voice-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.room [data-admin-listeners] .button { min-height: 40px; font-size: .85rem; }

/* 最后冲刺 */
.room-stage[data-sprint] { --phase: #ffb36b; --stage-core: #5a2416; --stage-edge: #1d1220; }
.room-stage[data-sprint="final"] { --phase: #ff6b8b; --stage-core: #6a1630; --stage-edge: #200f1c; }
.room-stage[data-sprint]::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: conic-gradient(from 0deg, transparent 0 20%, #ff8a4c26 30%, transparent 40% 70%, #ff4f8b1f 80%, transparent 90%);
  animation: sprint-sweep 2.4s linear infinite;
  pointer-events: none;
}
@keyframes sprint-sweep { to { transform: rotate(1turn); } }
.room-stage[data-sprint] .stage-content { position: relative; }
.room-stage[data-sprint] h2 { margin: 8px 0 2px; font-size: clamp(64px, 20vw, 112px); line-height: 1; font-variant-numeric: tabular-nums; color: #ffe2c4; text-shadow: 0 0 30px #ff7a4d80; animation: sprint-tick .42s cubic-bezier(.2, 1.6, .4, 1); }
.room-stage[data-sprint="final"] h2 { color: #ffd0dc; text-shadow: 0 0 36px #ff3d6e99; }
@keyframes sprint-tick { from { transform: scale(1.35); opacity: .4; } }
.room-stage[data-sprint] .orb { color: var(--phase); box-shadow: 0 0 40px #ff8a4c66, inset 0 0 30px #ff8a4c40; animation: sprint-throb .29s ease-in-out infinite alternate; }
@keyframes sprint-throb { to { transform: scale(1.06); box-shadow: 0 0 56px #ff8a4c99, inset 0 0 34px #ff8a4c55; } }
/* The ring around the orb drains as the countdown runs out. */
.room-stage[data-sprint] .orb::after {
  inset: -14px;
  border: 0;
  opacity: 1;
  background: conic-gradient(var(--phase) calc(var(--sprint-left, 1) * 360deg), #ffffff14 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
}
.room-stage[data-sprint="final"] .stage-content { animation: sprint-shake .5s ease-in-out infinite; }
@keyframes sprint-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.room-stage[data-sprint] .stage-badges span:first-child { background: linear-gradient(90deg, #ff7a4d, #ff4f8b); color: #fff; border-color: transparent; }
.room-stage[data-sprint] .beat-ring { border-color: var(--phase); }
.room-stage .sprint-burst {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  max-width: none;
  font-size: clamp(36px, 10vw, 60px);
  font-weight: 800;
  line-height: 1.1;
  color: #ffe2c4;
  text-shadow: 0 0 30px #ff7a4d;
  background: radial-gradient(circle at 50% 45%, #3a1712f2 0 35%, #1d1220d9 75%);
  pointer-events: none;
}
.room-stage .sprint-burst[hidden] { display: none; }
.sprint-burst.show { animation: sprint-burst 1.8s cubic-bezier(.2, .9, .3, 1) forwards; }
@keyframes sprint-burst { 0% { opacity: 0; transform: scale(.6); } 18% { opacity: 1; transform: scale(1.08); } 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.04); } }

.sprint-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 10px 10px 10px 14px;
  border: 1px solid #6b3a2a;
  border-radius: 16px;
  background: linear-gradient(110deg, #2c1714, #1b1322 70%);
}
.sprint-strip-copy { display: grid; min-width: 0; }
.sprint-strip-copy strong { font-size: .92rem; color: #ffd9b8; }
.sprint-strip-copy small { color: var(--muted); font-size: .74rem; }
.sprint-strip .button { flex-shrink: 0; }
.sprint-strip .button.primary { background: linear-gradient(135deg, #ff8a4c, #ff4f8b); border-color: transparent; color: #fff; }
.sprint-strip[data-active="true"] { border-color: #ff7a4d; box-shadow: 0 0 0 3px #ff7a4d22; animation: sprint-glow 1s ease-in-out infinite alternate; }
@keyframes sprint-glow { to { box-shadow: 0 0 0 5px #ff7a4d33; } }
#sprint-form .form-hint { color: var(--muted); font-size: .8rem; }
.watch-stage.sprinting .watch-cue { color: #ffb36b; text-shadow: 0 0 20px #ff7a4d88; }
@media (prefers-reduced-motion: reduce) {
  .room-stage[data-sprint]::before, .room-stage[data-sprint] .orb, .room-stage[data-sprint="final"] .stage-content, .sprint-strip[data-active="true"] { animation: none; }
  .room-stage[data-sprint] h2 { animation: none; }
}

/* Voice card: recorder, playback buttons and the 我的 card */
.voice-sample .voice-intro { color: var(--muted); font-size: .88rem; line-height: 1.6; }
.voice-current { display: grid; gap: 8px; padding: 12px; border: 1px solid #2f6a62; border-radius: 14px; background: #10302c80; }
.voice-current audio, .voice-draft { width: 100%; }
.voice-badge { justify-self: start; padding: 2px 10px; border-radius: 99px; background: #1f5b52; color: #a8f3e5; font-size: .75rem; }
.voice-recorder { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 14px 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: #15111f; }
.voice-dot { width: 12px; height: 12px; border-radius: 50%; background: #4b4263; }
.voice-recorder[data-state="recording"] { border-color: #ff6b8b; }
.voice-recorder[data-state="recording"] .voice-dot { background: #ff4f6e; animation: rec-blink 1s ease-in-out infinite; }
@keyframes rec-blink { 50% { opacity: .25; } }
.voice-meter { height: 10px; overflow: hidden; border-radius: 99px; background: #241f33; }
.voice-meter span { display: block; height: 100%; width: calc(var(--level, 0) * 100%); min-width: 4px; border-radius: inherit; background: linear-gradient(90deg, #77e4db, #bba4ff, #ff9cb9); transition: width .08s linear; }
.voice-clock { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .85rem; }
.voice-play.playing { border-color: var(--mint); color: var(--mint); }
.voice-play.playing [data-icon] { animation: rec-blink .8s ease-in-out infinite; }
.participant .voice-play { margin-top: 6px; min-height: 32px; padding: 4px 10px; font-size: .78rem; }
.popup-voice { display: flex; }
.popup-voice .voice-play { width: 100%; justify-content: center; }
.me-voice { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; align-items: center; margin-top: 14px; padding: 14px; border: 1px solid #2f6a62; border-radius: 16px; background: linear-gradient(135deg, #10302c, #15111f 70%); }
.me-voice[data-published="false"] { border-color: #3a2f52; background: linear-gradient(135deg, #24193a, #15111f 70%); }
.me-voice-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #1f5b52; color: #a8f3e5; font-size: 1.2rem; }
.me-voice[data-published="false"] .me-voice-icon { background: #2d2145; color: #cbb6ff; }
.me-voice strong, .me-voice small { display: block; }
.me-voice small { margin-top: 2px; color: var(--muted); font-size: .8rem; }
.me-voice-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.voice-nudge { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 0 0 12px; padding: 12px 14px; border: 1px dashed #4a3d68; border-radius: 14px; background: #1a1528; }
.voice-nudge p { flex: 1 1 200px; margin: 0; color: #d9cff0; font-size: .86rem; }
.voice-nudge [data-icon] { color: #cbb6ff; }
@media (prefers-reduced-motion: reduce) { .voice-recorder[data-state="recording"] .voice-dot, .voice-play.playing [data-icon] { animation: none; } }

/* Pairing links */
.queue-share { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 12px 14px; border: 1px dashed #4a3d68; border-radius: 14px; text-align: left; }
.queue-share p { flex: 1 1 200px; margin: 0; color: #d9cff0; font-size: .84rem; }
.share-sheet { display: grid; gap: 14px; }
.share-sheet > p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.6; }
.share-link { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: #120f1b; overflow-wrap: anywhere; }
.share-link code { font-size: .85rem; color: #e6dcfb; user-select: all; }
.share-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.share-actions .button { justify-content: center; text-decoration: none; }
.share-x { background: #f4f1ff; color: #0d0c16; border-color: #f4f1ff; }
.share-x:hover { background: #fff; }
.pair-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 14px; border: 1px solid #3a2f52; border-radius: 16px; background: linear-gradient(135deg, #24193a, #15111f 70%); }
.pair-avatar { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: #3a2a5c; color: #e1d3ff; font-size: 1.3rem; font-weight: 700; }
.pair-card strong, .pair-card small { display: block; }
.pair-card strong { font-size: 1.02rem; overflow-wrap: anywhere; }
.pair-card small { margin-top: 3px; color: var(--muted); font-size: .8rem; line-height: 1.5; }

/* Match form in three steps; the rest folds under 更多 */
.match-form { display: grid; gap: 4px; }
.match-step { padding: 12px 0 8px; border-bottom: 1px solid #ffffff0d; }
.match-step h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; font-size: .95rem; }
.match-step h3 span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #3a2a5c; color: #d9c8ff; font-size: .75rem; }
.match-step .field { margin: 0; }
.match-step legend { color: var(--muted); font-size: .8rem; }
.match-step .chip span { justify-content: center; width: 100%; min-height: 40px; font-size: .92rem; }
.chip-group.segmented.multi .chip input:checked + span { background: #352451; }
.match-step .toggle { margin-top: 6px; font-size: .82rem; color: #cfc2e8; }
.match-more { margin-top: 6px; border: 1px solid #2e2640; border-radius: 14px; background: #120f1c; }
.match-more summary { padding: 12px 14px; color: #d4c6ef; font-size: .88rem; cursor: pointer; list-style: none; }
.match-more summary::-webkit-details-marker { display: none; }
.match-more summary::after { content: "＋"; float: right; color: var(--muted); transition: transform .2s; }
.match-more[open] summary::after { transform: rotate(45deg); }
.match-more > :not(summary) { margin-inline: 14px; }
.match-more > :last-child { margin-bottom: 14px; }
.chip-group.asks .chip span { font-size: .8rem; }
#match-summary { min-height: 1.4em; margin: 8px 0 0; color: #cdb8ff; }
.match-form .form-error { margin: 4px 0 0; }

/* Calm waiting screen */
.queue-note { margin: -4px 0 0; color: var(--mint); font-size: .82rem; animation: fade-up .4s ease; }
@keyframes fade-up { from { opacity: 0; transform: translateY(4px); } }
.queue-board .queue-hint { text-align: left; }

/* 等待房间 */
.waiting-room { display: grid; gap: 12px; }
.waiting-intro { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.55; }
.waiting-cards { display: grid; gap: 10px; max-height: min(60vh, 520px); overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
.wait-card { display: grid; gap: 8px; padding: 12px; border: 1px solid #33294a; border-radius: 16px; background: linear-gradient(160deg, #1e1730, #15111f); animation: fade-up .35s ease both; }
.wait-card-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wait-card-head > div { display: grid; flex: 1 1 auto; min-width: 0; }
.wait-card-head strong { overflow: hidden; font-size: .95rem; white-space: nowrap; text-overflow: ellipsis; }
.wait-card-head small { color: var(--muted); font-size: .76rem; }
.wait-avatar { display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #7552e8, #d667b3); font-weight: 700; }
.wait-live { flex: 0 0 auto; padding: 3px 8px; border-radius: 99px; background: #1f3a32; color: var(--mint); font-size: .72rem; white-space: nowrap; }
.wait-asks { display: flex; flex-wrap: wrap; gap: 5px; }
.wait-asks span { padding: 3px 9px; border: 1px solid #4a3a6c; border-radius: 99px; color: #ddd0f7; font-size: .76rem; }
.wait-meta { color: var(--muted); font-size: .74rem; }
.wait-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.wait-card-actions .button { min-height: 36px; padding: 6px 12px; font-size: .82rem; }
.pair-gender { margin: 4px 0 8px; }
@media (prefers-reduced-motion: reduce) { .wait-card, .queue-note { animation: none; } }

/* 匹配资料: step tabs */
.match-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 2px 0 6px; }
.match-step-tab { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 6px 4px; border: 1px solid #2e2640; border-radius: 12px; background: #120f1c; color: var(--muted); font-size: .84rem; white-space: nowrap; transition: border-color .2s, background-color .2s, color .2s; }
.match-step-tab span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #241d36; font-size: .72rem; transition: background-color .2s; }
.match-step-tab[aria-selected="true"] { border-color: #8d69d6; background: #241a3a; color: var(--text); box-shadow: 0 2px 12px #7a55e033; }
.match-step-tab.done span { background: #7552e8; color: #fff; }
.match-step { animation: fade-up .25s ease; }
.match-step .chip-field + .chip-field, .match-step .chip-field + .toggle { margin-top: 12px; }
.tag-picker legend, .board-fields .field-note { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.pick-count { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.field-note { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }
.tag-group { display: block; margin-top: 10px; color: #a998c8; font-size: .74rem; }
.tag-group + .chip-group { margin-top: 5px; }
.chip-group.tags .chip span { font-size: .8rem; }
.match-more .chip-field + .chip-field { margin-top: 14px; }
.waiting-card-field .toggle { margin-top: 4px; }
.board-fields { display: grid; gap: 4px; }
.card-preview { margin-top: 4px; }
.wait-card.preview { animation: none; border-style: dashed; }
.wait-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.wait-tags span { padding: 3px 9px; border-radius: 99px; background: #3a2a5c; color: #e9dcff; font-size: .76rem; }
.participant .wait-tags { margin-top: 5px; }
.hero-queue { margin: 10px 0 0; color: var(--muted); font-size: .8rem; }

/* Who is matching right now */
.queue-people { display: grid; gap: 8px; text-align: left; }
.queue-people h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; font-size: .92rem; }
.queue-people h3 .button { min-height: 32px; padding: 4px 10px; font-size: .76rem; }
.queue-people ul { display: grid; gap: 6px; max-height: min(46vh, 420px); margin: 0; padding: 0 2px 0 0; overflow-y: auto; overscroll-behavior: contain; list-style: none; }
.queue-person { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #2a2340; border-radius: 14px; background: #15111f; animation: fade-up .3s ease both; }
.queue-person > div { display: grid; flex: 1 1 auto; gap: 2px; min-width: 0; }
.queue-person strong { overflow: hidden; font-size: .86rem; white-space: nowrap; text-overflow: ellipsis; }
.queue-person strong em { margin-left: 6px; padding: 1px 6px; border-radius: 99px; background: #3a2a5c; color: #e9dcff; font-size: .68rem; font-style: normal; }
.queue-person small { color: var(--muted); font-size: .74rem; }
.queue-person .wait-avatar { width: 32px; height: 32px; font-size: .8rem; }
.queue-person .button { flex: 0 0 auto; min-height: 32px; padding: 4px 10px; font-size: .76rem; }
.queue-person.me { border-color: #5b4689; background: #1d1630; }
.queue-more, .queue-legend-note { margin: 0; color: var(--muted); font-size: .74rem; }
@media (prefers-reduced-motion: reduce) { .queue-person { animation: none; } }

/* 意见箱 and the author's X contact link */
.header-contact { text-decoration: none; }
.header-contact svg { width: 17px; height: 17px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: flex-end; }
.feedback-guide { margin: 4px 0 14px; padding: 14px 16px; border: 1px solid var(--border); border-left: 3px solid var(--mint); border-radius: 12px; background: #1a1727; }
.feedback-guide > p { margin: 0 0 10px; color: var(--text); }
.feedback-guide dl { display: grid; gap: 8px; margin: 0; }
.feedback-guide dl > div { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 10px; }
.feedback-guide dt { color: var(--mint); font-size: 13px; font-weight: 600; }
.feedback-guide dd { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.feedback-count { margin: -6px 0 6px !important; text-align: right; }
#feedback-form textarea { display: block; width: 100%; margin-top: 7px; resize: vertical; padding: 10px 12px; border-radius: 9px; background: #100e1b; border: 1px solid #41334f; color: var(--text); font: inherit; }
#feedback-form textarea::placeholder { color: #a195b3; }
.feedback-author { margin-top: 14px !important; text-align: center; }
.feedback-author a { color: var(--mint); }
@media (max-width: 420px) {
  .feedback-guide dl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* Bubble announcements: a popup card in the top-right corner, one at a time. */
.site-bubble { position: fixed; z-index: 57; top: calc(80px + env(safe-area-inset-top)); right: max(20px, calc((100% - 1120px) / 2)); width: min(360px, calc(100% - 32px)); transform-origin: calc(100% - 35px) 0; }
.social-popup:not([hidden]) ~ .site-bubble { display: none; }
.bubble-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px 12px; align-items: start; padding: 16px 14px 14px 16px; border: 1px solid #5b4689; border-radius: 18px; background: linear-gradient(160deg, #271c3f, #181324 72%); box-shadow: 0 22px 60px #000000a8; }
.bubble-card::before { content: ""; position: absolute; top: -6px; right: 28px; width: 14px; height: 14px; border-left: 1px solid #5b4689; border-top: 1px solid #5b4689; border-radius: 3px 0 0 0; background: #271c3f; transform: rotate(45deg); clip-path: polygon(0 0, 100% 0, 0 100%); }
.site-bubble[data-level="important"] .bubble-card { border-color: #7a5428; background: linear-gradient(160deg, #3a2716, #1b1418 72%); }
.site-bubble[data-level="important"] .bubble-card::before { border-color: #7a5428; background: #3a2716; }
.site-bubble[data-level="important"] .site-notice-icon { background: #43301b; color: #ffc98f; }
.bubble-copy { min-width: 0; }
.bubble-copy small { display: block; color: #cbb6ff; font-size: .72rem; letter-spacing: .04em; }
.site-bubble[data-level="important"] .bubble-copy small { color: #ffc98f; }
.bubble-copy strong { display: block; margin-top: 2px; font-size: .98rem; line-height: 1.4; overflow-wrap: anywhere; }
.bubble-copy p { margin: 5px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 40vh; overflow-y: auto; }
.bubble-ok { grid-column: 2 / -1; justify-self: end; min-height: 38px; padding: 6px 18px; }
.site-bubble.bubble-enter { animation: bubble-in .46s cubic-bezier(.2, .9, .25, 1.3) both; }
.site-bubble.bubble-leave { animation: bubble-out .18s ease-in both; pointer-events: none; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(-10px) scale(.86); } }
@keyframes bubble-out { to { opacity: 0; transform: translateY(-6px) scale(.92); } }
@media (prefers-reduced-motion: reduce) { .site-bubble.bubble-enter, .site-bubble.bubble-leave { animation: none; } }
@media (max-width: 640px) {
  .site-bubble { top: calc(70px + env(safe-area-inset-top)); left: 16px; right: 16px; width: auto; }
}

