/* The room screens (found, pair, password, recover, devices, invite, settings) and the reload notice. Owner: pairing
   area (js/app/room.mjs). Sober: the board's tokens and type; pen drawings only on the two choice buttons. */
.room { box-sizing: border-box; width: 100%; max-width: 712px; margin: 0 auto; padding: 72px 16px 96px; color: var(--fg); }
#room-screen { grid-column: 1 / -1; width: 100%; min-height: 100dvh; background: var(--bg); }
#room-screen .room { padding-top: max(48px, 10vh); }
.room-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.room-head h2 { font: 700 28px/1.15 var(--display); margin: 0; }
.room-bell .brand-mark { width: 34px; height: 34px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.room h3 { font: 650 var(--t-lg)/1.3 var(--display); margin: 0 0 12px; }
.room-section { margin: 32px 0 0; }
.room-lead { font-size: 16px; line-height: 1.5; margin: 0 0 16px; }
.room-meta { font-size: 13px; line-height: 1.5; color: var(--muted); margin-top: 22px; }
.room-meta a, .room-lead a { color: var(--accent); }
.room-wait { color: var(--muted); }
.room-wait::before { content: ""; display: inline-block; width: .6em; height: .6em; margin-right: .55em; border-radius: 50%; background: var(--accent); animation: room-pulse 1.2s ease-in-out infinite; vertical-align: .05em; }
@keyframes room-pulse { 50% { opacity: .2 } }
@media (prefers-reduced-motion: reduce) { .room-wait::before { animation: none; } }
.room-error { color: var(--deny); font-weight: 500; }
.room-ok { color: var(--accent); font-weight: 600; }

/* tabs: Geräte | Einstellungen */
.room-tabs { display: flex; gap: 4px; margin: -4px 0 8px; border-bottom: 1px solid var(--line); }
.room-tabs a { padding: 8px 12px; color: var(--muted); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.room-tabs a:hover { color: var(--fg); }
.room-tabs a[aria-current] { color: var(--fg); border-bottom-color: var(--accent); }

/* forms and buttons */
.room-form { display: grid; gap: 14px; margin: 18px 0; }
.room-form label, .room-agent-form label, .room-handover label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; }
.room input:not([type="checkbox"], [type="radio"]), .room select { font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--fg); min-width: 0; }
.room input:focus-visible, .room select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.room-check { display: flex !important; align-items: center; gap: 10px !important; font-weight: 400 !important; }
.room-check input { width: 20px; height: 20px; accent-color: var(--accent); }
.room button, .room .room-done { font: 600 15px/1 var(--font); padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); cursor: pointer; text-decoration: none; display: inline-block; }
.room button:hover { border-color: var(--fg); }
.room button.room-primary, .room .room-done { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.room button.room-primary:hover { background: var(--accent-hover); }
.room button.room-danger { background: var(--deny); border-color: var(--deny); color: var(--surface); margin-top: 8px; }
.room button:disabled { opacity: .5; cursor: not-allowed; }
.room-more summary, .room-gone summary { cursor: pointer; font-size: 14px; color: var(--muted); padding: 6px 0; }
.room-more[open] { display: grid; gap: 12px; }
.room-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.room-inline { display: inline-block; margin: 8px 12px 0 0; }
.room-back { display: inline-block; margin-top: 14px; color: var(--muted); font-size: 14px; }
.room-mono, .room-fp { font-family: var(--mono); }
.room-hint { font-weight: 400; font-size: 13px; color: var(--muted); line-height: 1.4; }
.room-link { display: flex; gap: 8px; margin: 0 0 14px; }
.room-link input { flex: 1; font-family: var(--mono) !important; font-size: 13px !important; }

/* the two ways to add a device */
.room-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.room-way { margin: 0; display: contents; }
.room .room-way-go { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto 1fr; column-gap: 12px; row-gap: 4px; align-items: start; text-align: left; padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); color: var(--fg); text-decoration: none; font: inherit; line-height: 1.4; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color var(--d-fast), transform var(--d-fast) var(--ease-out); }
.room .room-way-go:hover { border-color: var(--accent); transform: translateY(-1px); }
.room .room-way-go:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.room-way-go svg { grid-row: span 2; width: 36px; height: 36px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.room-way-go b { font: 650 17px/1.25 var(--display); }
.room-way-go span { font-size: 14px; color: var(--muted); }
.room-ways-first { margin: 22px 0 8px; }

/* pairing: the QR code, the steps, the four codes */
.room-pair { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; margin: 4px 0 18px; }
.room-qr { width: 232px; padding: 8px; background: #fff; border-radius: var(--r-md); border: 1px solid var(--line); }
.room-qr .qr { display: block; width: 100%; height: auto; }
.room-steps { margin: 0; padding-left: 1.3em; display: grid; gap: 10px; font-size: 16px; line-height: 1.45; }
.room-choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 460px; margin: 6px 0 4px; }
.room-choices form { margin: 0; }
.room .room-choice { width: 100%; padding: 20px 8px; font: 600 30px/1 var(--mono); letter-spacing: .06em; border-radius: var(--r-md); border-width: 1.5px; }
.room .room-choice:hover { border-color: var(--accent); background: var(--accent-soft); }
.room-code { font: 600 52px/1.15 var(--mono); letter-spacing: .04em; word-spacing: -.3em; margin: 12px 0 18px; }
.room-code-form { display: flex; gap: 10px; }
.room .room-code-input { width: 10ch; font-family: var(--mono); font-size: 24px; letter-spacing: .2em; text-align: center; }
.room-recovery { font: 500 20px/1.6 var(--mono); letter-spacing: .04em; padding: 16px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); background: var(--surface); word-break: break-word; user-select: all; margin: 0; }
.room-scan { border-radius: var(--r-md); overflow: hidden; background: #000; aspect-ratio: 1; max-width: 360px; margin: 6px 0 4px; }
.room-scan video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* the members */
.room-devices { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.room-device { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 4px 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.room-device.is-removed { opacity: .6; }
.room-device-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--line-strong); }
.room-device-dot[data-online="yes"] { background: var(--st-done); }
.room-device-name { display: grid; gap: 2px; min-width: 0; }
.room-device-name em { font-style: normal; font-size: 12px; color: var(--accent); }
.room-device-name small { color: var(--muted); font-size: 12px; }
.room-remove summary { cursor: pointer; font-size: 13px; color: var(--deny); list-style: none; text-align: right; }
.room-handover { margin-top: 10px; }
.room-agent-form { display: grid; gap: 10px; }
.room-remove details[open] { max-width: 260px; font-size: 13px; line-height: 1.45; }
.room-remove details[open] p { margin: 6px 0 0; }
.room-agent-form { margin-top: 14px; }
.room-agent-form button, .room-handover button { justify-self: start; }
.room-history { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }
.room-history legend { font-weight: 500; padding: 0; margin-bottom: 4px; width: 100%; }
.room-history label { display: flex !important; align-items: center; gap: 6px; font-weight: 400 !important; }
.room-history input { accent-color: var(--accent); width: 18px; height: 18px; }
.room-gone { margin-top: 24px; }

/* settings */
.room-strength { margin: -4px 0 0; font-size: 13px; color: var(--muted); padding-left: 14px; position: relative; }
.room-strength::before { content: ""; position: absolute; left: 0; top: .45em; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.room-strength[data-level="1"]::before { background: var(--urg-high); }
.room-strength[data-level="2"]::before, .room-strength[data-level="3"]::before { background: var(--st-done); }
.room-usage { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 0; }
.room-usage div { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.room-usage dt { font-size: 13px; color: var(--muted); }
.room-usage dd { margin: 4px 0 0; font: 600 20px/1.2 var(--font); }
.room-usage dd.has-bar::after { content: ""; display: block; height: 6px; margin-top: 8px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--used), var(--sunken) var(--used)); }

/* "Neue Version bereit": boot.mjs adds it when the hub says this client is too old */
.room-notice { position: fixed; z-index: 1000; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); translate: -50% 0; display: flex; align-items: center; gap: 14px; width: max-content; max-width: calc(100vw - 32px); box-sizing: border-box; padding: 10px 10px 10px 16px; border-radius: var(--r-pill); background: var(--fg); color: var(--bg); font: 500 15px/1.3 var(--font); box-shadow: var(--shadow-lg); animation: room-rise var(--d-med) var(--ease-out); }
.room-notice-go { font: 600 14px/1 var(--font); padding: 9px 14px; border-radius: var(--r-pill); border: 0; background: var(--accent); color: var(--accent-fg); cursor: pointer; white-space: nowrap; }
.room-notice-go:hover { background: var(--accent-hover); }
:root[data-theme="dark"] .room-notice-go { background: var(--accent-fg); color: var(--accent); }
@keyframes room-rise { from { opacity: 0; translate: -50% 12px; } }

@media (max-width: 600px) {
  .room { padding-top: 64px; }
  .room-head h2 { font-size: 24px; }
  .room-pair { grid-template-columns: 1fr; justify-items: center; gap: 16px; }
  .room-qr { width: min(260px, 70vw); }
  .room-code { font-size: 44px; }
  .room-remove details[open] { max-width: none; }
}
