body { display: grid; grid-template-rows: 12em auto; min-height: 100vh; } .rtc { display: grid; grid-template-rows: 1fr min-content; grid-gap: 1em; padding: 1em; background: #f8f8f8; } .rtc-controls { text-align: center; } .rtc-videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(20%, 1fr)); align-content: center; justify-items: center; grid-gap: 1em; flex-grow: 1; flex-shrink: 1; /* video may overflow */ overflow: hidden; } .rtc-videos video { background-color: black; width: 100%; } video.mirrored { transform: scale(-1, 1); } .chat { display: grid; grid-template-rows: 1fr min-content; grid-gap: 1em; padding: 1em; min-width: 18em; border: 0 solid #ccc; border-top-width: 1px; } .chat-history { width: 100%; overflow: auto; margin: 0; padding: 0; margin-bottom: 1em; min-height: 8em; } .chat-history li { display: block; margin: 1em 0; } .chat-form { display: grid; grid-template-columns: 1fr min-content; grid-gap: 1em; } @media (min-width: 40em) { body { grid-template-columns: 3fr minmax(min-content, 1fr); grid-template-rows: 1fr; } .chat { border-top-width: 0; border-left-width: 1px; } }