/* The 3D chamber page. Tokens come from /styles.css. */
.chamber { --dem: #3D6FD8; --rep: #D23F33; padding: 36px 0 56px; }
.chamber .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.chamber-head { display: flex; justify-content: space-between; align-items: end; gap: 24px 40px; flex-wrap: wrap; padding-bottom: 20px; border-bottom: 1px solid var(--ink); }
.chamber-head h1 { font: 800 clamp(40px, 6vw, 72px)/0.95 var(--sans); letter-spacing: -0.035em; margin: 0 0 12px; }
.chamber-head p { margin: 0; max-width: 46ch; color: var(--quiet); }
.chamber-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: stretch; }

.chamber-toggle { display: flex; border: 1px solid var(--ink); }
.chamber-toggle button { all: unset; cursor: pointer; padding: 11px 18px; font: 600 14px var(--sans); }
.chamber-toggle button + button { border-left: 1px solid var(--ink); }
.chamber-toggle button span { color: var(--quiet); font-weight: 400; margin-left: 4px; font-variant-numeric: tabular-nums; }
.chamber-toggle button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.chamber-toggle button[aria-selected="true"] span { color: #B9B9B4; }
.chamber-toggle button:focus-visible { outline: 3px solid var(--cite); outline-offset: -3px; }

.chamber-search input { font: 400 15px var(--sans); color: var(--ink); background: transparent; border: 1px solid var(--ink); border-radius: 0; padding: 11px 14px; width: min(320px, 100%); box-sizing: border-box; }
.chamber-search input::placeholder { color: var(--quiet); }
.chamber-search input:focus-visible { outline: 3px solid var(--cite); outline-offset: -1px; }

.chamber-stage { position: relative; height: min(76vh, 760px); min-height: 460px; overflow: hidden; border-bottom: 1px solid var(--ink); }
.chamber-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }

.chamber-tag { position: absolute; left: 0; top: 0; pointer-events: none; background: var(--ink); color: var(--paper); font: 600 13px var(--sans); padding: 6px 10px; white-space: nowrap; opacity: 0; transition: opacity .15s; }
.chamber-tag.on { opacity: 1; }
.chamber-tag::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: var(--ink); }

.chamber-hint { position: absolute; left: 0; bottom: 14px; margin: 0; font-size: 13px; color: var(--quiet); transition: opacity .6s; pointer-events: none; }
.chamber.touched .chamber-hint { opacity: 0; }
.chamber-key { position: absolute; right: 0; bottom: 14px; margin: 0; padding: 0; list-style: none; display: flex; gap: 16px; font-size: 13px; color: var(--quiet); pointer-events: none; }
.chamber-key li::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.chamber-key .d::before { background: var(--dem); }
.chamber-key .r::before { background: var(--rep); }
.chamber-key .c::before { border: 2px solid var(--cite); border-radius: 50%; width: 7px; height: 7px; }
.chamber-count { position: absolute; left: 0; top: 14px; margin: 0; font: 600 13px var(--sans); }

.chamber-card { position: absolute; top: 20px; right: 0; max-height: calc(100% - 40px); width: 300px; box-sizing: border-box; background: var(--paper); border: 1px solid var(--ink); padding: 22px 22px 20px; display: flex; flex-direction: column; gap: 12px; overflow: auto;
  transform: translateX(24px); opacity: 0; transition: transform .38s cubic-bezier(.2, .8, .2, 1), opacity .25s, visibility 0s .38s; }
/* A closed card is invisible but still laid out, so it must not catch taps meant for the seats under it. */
.chamber-card:not(.open) { visibility: hidden; pointer-events: none; }
.chamber-card.open { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
.chamber-close { all: unset; position: absolute; top: 8px; right: 12px; font: 400 26px/1 var(--sans); cursor: pointer; padding: 4px; }
.chamber-close:focus-visible { outline: 3px solid var(--cite); }
.chamber-portrait { width: 220px; height: 253px; margin: 4px auto 0; }
.chamber-portrait canvas, .chamber-portrait img { width: 220px; height: 253px; display: block; }
.chamber-who { border-top: 2px solid var(--ink); padding-top: 12px; }
.chamber-who h2 { font: 800 24px/1.1 var(--sans); letter-spacing: -0.02em; margin: 2px 0 4px; }
.chamber-role { margin: 0; font-size: 14px; color: var(--quiet); }
.chamber-party { margin: 0 0 4px; font-size: 15px; font-weight: 800; color: var(--quiet); }
.chamber-party:has(i.d) { color: var(--dem); } .chamber-party:has(i.r) { color: var(--rep); }
.chamber-party i { display: inline-block; width: 11px; height: 11px; margin-right: 7px; background: var(--quiet); }
.chamber-party i.d { background: var(--dem); }
.chamber-party i.r { background: var(--rep); }
.chamber-entries { margin: 0; font-size: 14px; }
.chamber-entries.has { color: var(--cite); font-weight: 600; }
.chamber-link { margin-top: 8px; display: block; background: var(--ink); color: var(--paper); text-decoration: none; font: 800 15px var(--sans); padding: 14px; text-align: center; }
.chamber-link:focus-visible { outline: 3px solid var(--cite); outline-offset: 2px; }

/* The member list is always there for keyboards and screen readers; the WebGL notice only shows when it's needed. */
.chamber-fallback { padding: 16px 0 0; }
.chamber-fallback p { display: none; }
.chamber[data-state="fallback"] .chamber-fallback p { display: block; }
.chamber-fallback summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.chamber-fallback h3 { font-size: 15px; margin: 16px 0 6px; }
.chamber[data-state="fallback"] .chamber-stage, .chamber[data-state="fallback"] .chamber-controls { display: none; }
.chamber-fallback ul { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.chamber-fallback ul ul { columns: 3 260px; column-gap: 32px; }
.chamber-fallback ul ul li { break-inside: avoid; padding: 2px 0; }
.chamber-fallback li span { color: var(--quiet); }
.chamber-note { margin: 12px 0 0; font-size: 13px; color: var(--quiet); }

@media (max-width: 720px) {
  .chamber { padding-top: 24px; }
  .chamber-controls, .chamber-search, .chamber-search input { width: 100%; }
  .chamber-toggle { width: 100%; }
  .chamber-toggle button { flex: 1; text-align: center; }
  .chamber-stage { height: 58vh; min-height: 400px; }
  .chamber-key { left: 0; right: auto; bottom: 36px; }
  .chamber-hint { bottom: 12px; }
  /* The card becomes a bottom sheet. */
  .chamber-card { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 82%; display: grid; grid-template-columns: 110px 1fr; gap: 10px 16px; align-items: start; padding: 18px 16px 16px; transform: translateY(24px); }
  .chamber-portrait, .chamber-portrait canvas, .chamber-portrait img { width: 110px; height: 126px; margin: 0; grid-row: span 2; }
  .chamber-who { border-top: 0; padding-top: 0; }
  .chamber-who h2 { font-size: 20px; padding-right: 24px; }
  .chamber-entries { grid-column: 2; }
  .chamber-link { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { .chamber-card, .chamber-tag, .chamber-hint { transition: none; } }
