/* Direct links (S-05, S-06): guest rooms, invite codes, send/receive. Uses the tokens in app.css. */

/* Stage: one tile per person */
.p2p-stage-wrap { place-items: stretch; overflow-y: auto; padding: 20px; }
.room-stage { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-content: center; width: 100%; min-height: 100%; }
.room-tile { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-3); overflow: hidden; background: var(--ink-2); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.room-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.room-tile.self video { transform: scaleX(-1); }
.room-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--text-3); font-size: 12.5px; }
.room-label { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: 999px; background: rgba(11,11,13,.72); backdrop-filter: blur(10px); border: 1px solid var(--line-2); font-size: 12px; font-weight: 550; max-width: calc(100% - 20px); }
.room-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Status dots: mint = connected / on-device, amber = waiting, signal = recording, coral = failed */
.p2p-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; display: inline-block; }
.p2p-dot.ok { background: var(--mint); box-shadow: 0 0 0 3px rgba(90,209,176,.16); }
.p2p-dot.wait { background: var(--amber); }
.p2p-dot.rec { background: var(--signal); box-shadow: 0 0 0 3px rgba(255,74,43,.2); animation: blink 1.4s infinite; }
.p2p-dot.bad { background: var(--coral); }
.p2p-ok { color: var(--mint); display: inline-flex; }

/* Side panel */
.p2p-side h4 .tag, .p2p-slot-head .tag { margin-left: 2px; }
.p2p-panel { display: flex; flex-direction: column; gap: 14px; }
.p2p-controls { display: grid; gap: 10px; }
.p2p-controls > section { display: grid; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.p2p-controls .seg { width: 100%; }
.p2p-controls .seg button { flex: 1; }
.p2p-slots { display: grid; gap: 8px; }
.p2p-slots:empty { display: none; }
.p2p-slot { display: grid; gap: 10px; padding: 12px; border-radius: var(--r-3); background: var(--ink-2); border: 1px solid var(--line-2); }
.p2p-slot-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.p2p-slot-head b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p2p-slot-head .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p2p-slot-head .icon-btn { width: 26px; height: 26px; }
.grow-x { flex: 1; }
.p2p-slot .row.muted, p.row.muted { flex-wrap: nowrap; }

/* Steps with codes */
.p2p-steps { list-style: none; counter-reset: step; display: grid; gap: 14px; }
.p2p-steps > li { counter-increment: step; display: grid; grid-template-columns: 22px 1fr; gap: 6px 10px; align-items: start; font-size: 12.5px; color: var(--text-2); }
.p2p-steps > li::before { content: counter(step); grid-row: span 2; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 600 11px var(--font); color: var(--text); background: var(--ink-4); border: 1px solid var(--line-2); }
.p2p-steps > li > * { grid-column: 2; min-width: 0; }
.p2p-codeblock, .p2p-paste { display: grid; gap: 8px; }
textarea.p2p-code { font: 11px/1.45 var(--mono); word-break: break-all; resize: none; background: var(--ink-1); color: var(--text-2); }
textarea.p2p-code:not([readonly]) { color: var(--text); background: var(--ink-2); }
textarea.p2p-ice-input { font: 11.5px/1.45 var(--mono); resize: vertical; }

/* Connection settings */
.p2p-ice { display: grid; gap: 8px; font-size: 12.5px; }
.p2p-ice summary { display: flex; align-items: center; gap: 7px; cursor: pointer; list-style: none; color: var(--text-2); font-weight: 550; }
.p2p-ice summary::-webkit-details-marker { display: none; }
.p2p-ice summary:hover { color: var(--text); }
.p2p-ice[open] summary { margin-bottom: 4px; }
.p2p-ice > * + * { margin-top: 8px; }

/* On-device reassurance (mint = on-device) */
.p2p-note { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-3); border: 1px solid rgba(90,209,176,.3); background: rgba(90,209,176,.07); font-size: 12.5px; color: var(--text); }
.p2p-note .ic { color: var(--mint); margin-top: 2px; }
.p2p-prog { margin-top: 2px; }
.p2p-prog .bar i { background: var(--mint); }

/* Receive page and send dialog */
.p2p-page { height: 100%; display: grid; grid-template-rows: 52px 1fr; }
.p2p-center { display: grid; place-items: center; padding: 32px 16px; overflow-y: auto; background: radial-gradient(900px 420px at 50% -200px, rgba(139,147,255,.08), transparent 70%), var(--ink-0); }
.p2p-card { width: min(480px, 100%); display: grid; gap: 14px; padding: 24px; border-radius: var(--r-4); background: var(--ink-2); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.p2p-card h3 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.p2p-file { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-2); background: var(--ink-3); border: 1px solid var(--line); min-width: 0; }
.p2p-file > div { display: grid; min-width: 0; }
.p2p-file b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.p2p-send .p2p-steps > li { font-size: 13px; }

@media (max-width: 760px) {
  .p2p-room { height: auto; min-height: 100vh; }
  .room-stage { grid-template-columns: 1fr; }
}
