.rooms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.room { display: flex; flex-direction: column; padding: 30px; border-radius: 22px; background: var(--soft); }
.room.everyone { background: var(--mint-soft); }
/* On a small phone the example tag drops under the heading rather than squeezing it onto two lines */
.room-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; }
.room h3 { font-size: 22px; font-weight: 800; }
.room > p { margin-top: 6px; font-size: 16px; color: var(--ink-soft); }
.people { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; margin: 24px 0; }
.people span { aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: #DDD6E5; }
.people span::before { content: ""; width: 44%; height: 44%; background: #fff; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4.5 21c1-4 4-6 7.5-6s6.5 2 7.5 6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4.5 21c1-4 4-6 7.5-6s6.5 2 7.5 6'/%3E%3C/svg%3E") center / contain no-repeat; }
.people span.talking { background: var(--magenta); }
.room.everyone .people span { background: var(--mint); }
.ranking { display: grid; align-content: start; gap: 8px; margin-top: auto; }
.ranking li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 14px; border-radius: 12px; background: #fff; font-size: 15px; line-height: 1.3; }
.ranking li b { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--aubergine); color: #fff; font: 800 13px/1 var(--font-heading); }
.ranking li i { font-style: normal; font-family: var(--font-heading); font-size: 13px; font-weight: 700; white-space: nowrap; color: var(--muted); }
.room.everyone .ranking li i { color: var(--mint-deep); }
.ranking li.dim { opacity: .55; }

/* Side by side, the two rooms line up row for row */
@media (min-width: 1101px) {
  .rooms { grid-template-rows: repeat(4, auto); row-gap: 0; }
  .room { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; }
}
@media (max-width: 1100px) {
  .rooms { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .room { padding: 22px 18px; }
  .room h3 { font-size: 19px; }
  .people { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 20px 0; }
  .ranking li { gap: 10px; padding: 10px 12px; font-size: 14px; }
}

/* The whole team's top concern, ringed; while silent-majority.js plays the story, the ring waits for the ranking to settle */
.room.everyone .ranking { position: relative; }
.room.everyone .ranking li:first-child { position: relative; }
.room.everyone .ranking li:first-child::after { content: ""; position: absolute; inset: 0; border: 2px solid var(--mint); border-radius: inherit; transition: opacity .4s; }
.rooms.is-armed .room.everyone .ranking li:first-child::after { opacity: 0; }

.rooms.is-armed .room.everyone:not(.is-listening) { background: var(--soft); }
.rooms.is-armed .room.everyone.is-listening { transition: background-color .6s; }
.rooms.is-armed .room.everyone .people span:not(.is-heard) { background: #DDD6E5; }
.rooms.is-armed .room.everyone .people span.is-heard { animation: heard .35s cubic-bezier(.3, 1.6, .5, 1); transition: background-color .3s; }
@keyframes heard { 50% { transform: scale(1.12); } }
.people span.talking { position: relative; }
.rooms.is-talking .people span.talking::after { content: ""; position: absolute; inset: -3px; border: 2px solid var(--magenta); border-radius: 50%; opacity: 0; animation: talking 1.1s ease-out infinite; animation-delay: calc(var(--order, 0) * 180ms); }
@keyframes talking { 0% { opacity: .8; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.5); } }

.ranking .leaving { left: 0; right: 0; transition: opacity .4s, transform .5s cubic-bezier(.5, 0, .2, 1); }
.ranking .leaving.is-gone { position: absolute; opacity: 0; transform: translateX(-18px); }
.ranking .entering { opacity: 0; transform: translateX(18px); }
.ranking.is-moving li { transition: transform .8s cubic-bezier(.5, 0, .2, 1), opacity .4s .2s; }
/* The row that climbs passes over the others */
.ranking.is-moving li:first-child { z-index: 1; }
