:root { color-scheme: light dark; font-family: system-ui, sans-serif; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; overflow-wrap: anywhere; }
main { width: 100%; max-width: 40rem; box-sizing: border-box; margin: 0 auto; padding: 1rem; }
input, button { font: inherit; font-size: 1rem; min-height: 44px; min-width: 44px; box-sizing: border-box; padding: 0.5rem 1rem; }
form { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
label { flex-basis: 100%; }
input { flex: 1 1 10rem; min-width: 0; }
hr { margin: 1.5rem 0; }
textarea { flex-basis: 100%; box-sizing: border-box; font: inherit; font-size: 1rem; padding: 0.5rem; resize: vertical; }
ul { list-style: none; padding: 0; overflow-anchor: none; }
li { border-top: 1px solid GrayText; padding-bottom: 0.75rem; }
.vote, .reaction { border: 1px solid GrayText; border-radius: 0.25rem; }
.vote[aria-pressed="true"], .reaction[aria-pressed="true"] { border: 3px solid currentColor; font-weight: bold; }
.vote[aria-pressed="true"]::before, .reaction[aria-pressed="true"]::before { content: "✓ "; }
/* The browser fades a disabled button, but the counts must stay readable. */
.vote:disabled, .reaction:disabled { color: CanvasText; border-style: dashed; }
.reactions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.reaction { padding: 0.5rem 0.75rem; }
.question-text { white-space: pre-wrap; }
/* Muted, but with a contrast above 4.5:1 in both colour schemes. */
.question.answered .question-text { color: #595959; }
.answered-label { font-weight: bold; }
.presenter-actions { margin-top: 0.75rem; padding-top: 0.5rem; border-top: 1px dashed GrayText; }
.presenter-actions button { margin-right: 0.5rem; }
.room-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
/* A badge over the empty space above the room's heading. It takes no room, so
   showing it moves nothing, and the header keeps the height that the QR panel
   below it counts on. */
.connection-status { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 1; margin: 0; padding: 0 0.5rem; font-size: 0.875rem; line-height: 1.2rem; white-space: nowrap; background: Canvas; border-bottom: 1px solid GrayText; }
/* The image has 512 pixels. Shown at half or full size, every module of the
   code keeps the same width. */
#qr-panel img { display: block; width: 256px; height: 256px; padding: 0.5rem; background: #fff; image-rendering: pixelated; }
.close-room { margin-top: 2rem; padding-top: 1rem; border-top: 2px solid GrayText; }
.close-room button { margin-right: 0.5rem; }
.service { margin-top: 3rem; font-size: 0.875rem; }
.room-header { position: sticky; top: 0; background: Canvas; }
.room-code { font-family: ui-monospace, monospace; letter-spacing: 0.1em; user-select: all; }
.error-bar { position: sticky; bottom: 0; margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; background: Canvas; }
[role="alert"] { margin: 0; padding: 0.75rem 1rem; color: #b00020; }
.error-bar button { margin: 0.25rem 1rem; }
@media (prefers-color-scheme: dark) {
  [role="alert"] { color: #ff8a80; }
  .question.answered .question-text { color: #b8b8b8; }
}
@media (min-width: 60rem) {
  .room-code { font-size: 3rem; }
  .question-text { font-size: 1.25rem; }
  /* The presenter's code and QR code stay beside the list while it scrolls. */
  main:has(#qr-panel:not([hidden])) { max-width: 72rem; }
  .room-columns { display: flex; align-items: flex-start; gap: 2rem; }
  .room-main { flex: 1; min-width: 0; }
  #qr-panel { order: 1; position: sticky; top: 7rem; width: 17rem; flex: none; }
}
/* The large code also needs the height, or its lower part would be off the
   screen. */
@media (min-width: 80rem) and (min-height: 45rem) {
  #qr-panel { width: 33rem; }
  #qr-panel img { width: 512px; height: 512px; }
}
