: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; }
body { margin: 0; min-height: 100vh; 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:hover, .nav-link.active { 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; }
.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 { color: #c2aaff; }
.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 .18s, border-color .18s, transform .18s; }
.button:not(:disabled):active { transform: translateY(1px); }
.button.primary { background: linear-gradient(112deg, #9b75fa, #7552e8); border-color: #af91ff7a; color: white; box-shadow: 0 5px 20px #8156ec42; }
.button.primary:hover:enabled { background: linear-gradient(112deg, #a78aff, #8769ef); }
.button.outline { border-color: #493961; color: #e0d5f5; background: #231932a1; }
.button.outline:hover:enabled { background: #37284e; border-color: #725795; }
.button.danger { background: #492439; color: #ffc2d3; border-color: #71364d; }
.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; }
.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; }
.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; }
.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; }
.room-stage { 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%, #2c1949 0%, #181324 66%); }
.room-stage[data-cue="fast"] { --phase: #8aebdb; background: radial-gradient(ellipse at 50% 40%, #103937 0%, #141f29 65%); }
.room-stage[data-cue="slow"] { --phase: #f4d29c; background: radial-gradient(ellipse at 50% 40%, #443327 0%, #231c2a 65%); }
.room-stage[data-cue="stop"] { --phase: #ff9fbd; background: radial-gradient(ellipse at 50% 40%, #4d2038 0%, #251a29 65%); }
.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; }
.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; }
.social-options .field { display: flex; align-items: center; gap: 8px; margin: 0; }
.social-options .field select { width: auto; min-height: 32px; padding: 4px 8px; }
.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-selects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.online-filter-selects .field { margin: 0; min-width: 0; }
.online-filter-selects select { padding-inline-start: 8px; min-height: 39px; }
.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) {
  .online-filter-selects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .online-filter-selects .field:last-child { grid-column: 1 / -1; }
}
.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(3, minmax(0, 1fr)); gap: 8px; margin: 7px 0; }
.round-preferences-grid .field { display: block; margin: 0; font-size: 12px; }
.round-preferences-grid .field select { width: 100%; margin-top: 7px; }
.room-limits { margin: 12px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
@media (max-width: 520px) {
  .round-preferences-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .round-preferences-grid .field:last-child { grid-column: 1 / -1; }
  .online-limits-form > .field { align-items: start; flex-direction: column; }
}
.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;
}
.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 85px; min-width: 0; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); }
.round-select select { width: 100%; min-height: 32px; padding: 4px 6px; font-size: 12px; }
.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 select { margin-inline-start: 5px; min-height: 34px; }
.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-prompt-pages, .mobile-cues { display: none; }
.desktop-round-action { display: contents; }

@media (max-width: 600px) {
  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-prompt-pages {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 91%;
    gap: 8px;
    margin-top: 7px;
    padding: 0 0 5px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
  }
  .mobile-prompt-page { min-width: 0; scroll-snap-align: start; padding: 5px; border: 1px solid var(--border); border-radius: 9px; }
  .mobile-prompt-page h3 { margin: 0 0 4px; color: var(--muted); font-size: .8125rem; font-weight: 650; }
  .mobile-prompt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .mobile-prompt-grid .button { min-height: 44px; padding: 4px; font-size: .8125rem; white-space: normal; overflow-wrap: anywhere; }

  .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; }

.mobile-controller { display: none; }
@media (max-width: 600px) {
  .compact-round .controller-desktop-controls { display: none; }
  .compact-round .mobile-controller { display: block; margin-top: 5px; }
  .mobile-controller-head, .controller-layout-options { display: flex; gap: 4px; align-items: center; }
  .mobile-controller-head { justify-content: space-between; }
  .mobile-controller-head .button { min-height: 37px; padding: 4px 9px; font-size: .8125rem; }
  .controller-layout-options .button[aria-pressed="true"] { background: #36234e; border-color: var(--purple); }
  .controller-dial {
    width: min(100%, 224px);
    margin: 4px auto 0;
    display: grid;
    grid-template: repeat(3, 42px) / repeat(3, minmax(0, 1fr));
    align-items: center;
    justify-items: center;
    background: radial-gradient(ellipse, #302142 0%, #302142 51%, transparent 52%);
  }
  .dial-faster { grid-area: 1 / 2; }
  .dial-lighter { grid-area: 2 / 1; }
  .dial-stop { grid-area: 2 / 2; }
  .dial-heavier { grid-area: 2 / 3; }
  .dial-slower { grid-area: 3 / 2; }
  .controller-dial .button { min-height: 40px; padding: 4px 8px; white-space: nowrap; font-size: .8125rem; }
  .controller-dial .dial-stop .button { min-height: 48px; width: 55px; border-radius: 50%; background: #56367a; border-color: #9872c4; }
  .controller-dial .dial-stop .button[aria-pressed="true"] { background: #502c43; border-color: #ce79ab; }
  .dial-reading { margin: 3px 0 0; text-align: center; color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
  .controller-sliders { display: grid; gap: 4px; margin-top: 4px; }
  .controller-sliders label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: .8125rem;
  }
  .controller-sliders output { grid-column: 3; grid-row: 1; min-width: 5.1em; text-align: right; font-variant-numeric: tabular-nums; }
  .controller-sliders input { grid-column: 2; grid-row: 1; width: 100%; min-width: 0; height: 30px; accent-color: var(--purple); }
  .controller-sliders > .button { min-height: 42px; padding: 5px; }
}

.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; }
