/* Community chat: the right-hand panel, its rooms, and the console moderation page. */

.chat-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 22;
  display: flex;
  flex-direction: column;
  width: var(--chat-panel-width);
  border-left: 1px solid var(--line);
  background: var(--surface-0);
}

.chat-panel[hidden] {
  display: none;
}

.chat-panel__frame {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

/* Each pane's top row heads the panel, so the close button sits over the row's right end. */
.chat-panel__close {
  position: absolute;
  top: 6px;
  right: var(--space-2);
  z-index: 2;
}

.chat-panel .community__head,
.chat-panel .panel-games__head {
  padding-right: calc(var(--control-md) + var(--space-3));
}

.community__popout {
  margin-left: auto;
}

/* The chat in its own window fills it, and has nowhere further to pop out to. */
.popout {
  height: 100vh;
  margin: 0;
  overflow: hidden;
  background: var(--surface-0);
}

.chat-popout {
  height: 100%;
}

.popout .community__popout {
  display: none;
}

/* A VIP rank before a name. */
.chat-line__rank {
  display: inline-flex;
  margin-right: 2px;
  color: var(--rank-tone);
  vertical-align: -2px;
}

.chat-panel__pane {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.chat-panel__pane[hidden] {
  display: none;
}


.topbar__chat[aria-expanded="true"] {
  background: var(--surface-3);
}

/* Desktop: the open panel takes its width from the page, as on the reference site. */
@media (min-width: 1100px) {
  .app:has(.chat-panel:not([hidden])) .app-main {
    margin-right: var(--chat-panel-width);
  }

  /* The header gets as narrow as on a tablet, so it drops the same extras. */
  .app:has(.chat-panel:not([hidden])) .wallet__vault {
    display: none;
  }
}

/* Keep live support clear of the open panel. */
@media (min-width: 768px) {
  .app:has(.chat-panel:not([hidden])) :is(.support-launcher, .support-panel) {
    right: calc(var(--chat-panel-width) + var(--space-6));
  }
}

/* Tablet: the panel lays over the page instead. */
@media (min-width: 768px) and (max-width: 1099px) {
  .chat-panel {
    box-shadow: -16px 0 48px rgb(0 0 0 / calc(0.4 * var(--shade)));
  }
}

/* Phone: a card above the tab bar, opened from the bar's chat or recommended games button (layout.css). */
@media (max-width: 767px) {
  body:has(.chat-panel:not([hidden])) {
    overflow: hidden;
  }
}

/* Room */
.community {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.community__head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 52px;
  padding: 0 var(--space-3) 0 var(--space-4);
  border-bottom: 1px solid var(--line);
}

.community__room {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink-muted);
}

.community__room-select {
  height: 36px;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.community__room-select:hover {
  background: var(--surface-1);
}

/* The line a moderator pinned, held over the log. */
.community__pin {
  flex: none;
}

.community__pinned {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: var(--space-2) var(--space-3) 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  font-size: 14px;
  line-height: 1.5;
}

.community__pinned[hidden] {
  display: none;
}

.community__pinned .icon {
  flex: none;
  margin-top: 2px;
  color: var(--focus);
}

.community__pinned p {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.community__log {
  flex: 1;
  min-height: 0;
  padding: var(--space-3);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.community__messages {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.community__empty {
  margin: 0;
  padding: var(--space-8) var(--space-4);
  color: var(--ink-muted);
  font-size: 14px;
  text-align: center;
}

.community__messages:has(.chat-line) + .community__empty {
  display: none;
}

/* The bar while the chat is paused, held to the bottom of the log. */
.community__paused {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface-3);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.community__paused[hidden] {
  display: none;
}

.community__unread {
  margin-left: auto;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--on-accent);
  white-space: nowrap;
}

.community__guest {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 14px;
}

.community__guest p {
  margin: 0;
}

/* A muted player's notice, in place of the message box. */
.community__guest--muted {
  justify-content: flex-start;
  color: var(--ink);
}

.community__guest--muted .icon {
  flex: none;
  color: var(--danger);
}

/* Lines */
/* Each message on a lifted bubble. */
.chat-line {
  position: relative;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  font-size: 14px;
  line-height: 1.5;
}

.chat-line.is-mention {
  box-shadow: inset 3px 0 var(--accent);
}

.chat-line__body {
  margin: 0;
  padding-right: var(--space-6);
  overflow-wrap: anywhere;
}

/* A bet shared into the chat, as a link. */
.chat-line__bet {
  color: var(--ink);
  text-decoration: underline;
}

.chat-line__handle {
  font-weight: 700;
}

/* A moderator's mark by their name: an "M". */
.chat-line__mod {
  margin-right: 3px;
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 800;
}

.chat-line.is-own .chat-line__handle {
  color: var(--focus);
}

.chat-line__quote {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin: 0 var(--space-6) var(--space-1) 0;
  padding-left: var(--space-2);
  border-left: 2px solid var(--line);
  color: var(--ink-muted);
  font-size: 12px;
}

.chat-line__quote span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The weekday and time over a stretch of the log. */
.chat-time {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
  padding: 0 var(--space-1);
  color: var(--ink-muted);
  font-size: 13px;
}

.chat-time:first-child {
  margin-top: 0;
}

/* The "•••" on a line, shown on hover, with reply and report beside it once opened. */
.chat-line__menu {
  position: absolute;
  top: var(--space-1);
  right: var(--space-1);
}

.chat-line__more,
.chat-line__actions button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--ink);
  cursor: pointer;
}

.chat-line__more {
  opacity: 0;
}

.chat-line:hover .chat-line__more,
.chat-line__more:focus-visible,
.chat-line__more[aria-expanded="true"] {
  opacity: 1;
}

.chat-line__more .icon {
  stroke-width: 3;
}

.chat-line__actions {
  position: absolute;
  top: 50%;
  right: calc(100% + var(--space-1));
  z-index: 2;
  display: flex;
  gap: var(--space-1);
  padding: var(--space-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  box-shadow: 0 8px 24px rgb(0 0 0 / calc(0.4 * var(--shade)));
  transform: translateY(-50%);
}

.chat-line__actions[hidden] {
  display: none;
}

.chat-line__actions button {
  background: transparent;
}

.chat-line__actions button:hover,
.chat-line__actions button:focus-visible {
  background: var(--surface-3);
}

@media (hover: none) {
  .chat-line__more {
    background: transparent;
    color: var(--ink-muted);
    opacity: 1;
  }
}

/* A shared bet, shown under the text: the game, then its multiplier and payout. */
.chat-bet {
  display: grid;
  gap: 6px;
  margin: var(--space-2) var(--space-6) 0 0;
  padding: 10px var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface-0);
  color: var(--ink-muted);
  font-size: 14px;
  text-decoration: none;
}

.chat-bet:hover {
  background: var(--row-alt);
}

.chat-bet__game {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  color: var(--ink);
}

.chat-bet__game strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-bet__game .history-game__art {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.chat-bet__row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
}

.chat-bet__row strong {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink);
}

.chat-bet__payout.is-win {
  color: var(--win);
}

.chat-bet .chip-mark {
  width: 14px;
  height: 14px;
}

/* A rain: a card headed "Rain", then who rained what on whom. */
.chat-rain {
  overflow: hidden;
  padding: 0;
}

.chat-rain__head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.chat-rain__head .icon {
  color: var(--focus);
}

/* Rain falling behind the rain card's heading. */
.chat-rain__head::after {
  position: absolute;
  inset: 0 0 0 auto;
  width: 120px;
  background: repeating-linear-gradient(115deg, transparent 0 14px, color-mix(in srgb, var(--accent) 30%, transparent) 14px 16px);
  mask-image: linear-gradient(to left, #000, transparent);
  content: "";
  pointer-events: none;
}

.chat-rain__text,
.chat-rain__players {
  margin: 0;
  padding: 0 var(--space-3);
  overflow-wrap: anywhere;
}

.chat-rain__text {
  padding-top: 10px;
}

.chat-rain__players {
  padding-bottom: var(--space-3);
}

/* A card's last line, when no list of players follows it. */
.chat-rain__text--last {
  padding-bottom: var(--space-3);
}

/* A trivia's lines sit closer than a sentence's. */
.chat-trivia .chat-rain__text + .chat-rain__text {
  padding-top: 2px;
}

.chat-rain__bot {
  color: var(--focus);
}

.chat-rain__amount {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  vertical-align: -2px;
}

.chat-rain__amount .chip-mark {
  width: 12px;
  height: 12px;
}

.chat-rain__player {
  color: var(--ink);
  text-decoration: underline;
}

.chat-rain__player.is-own {
  color: var(--focus);
  font-weight: 700;
}

/* The email step before chips leave: what was sent, before the code goes in. */
.email-code__lead {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* Composer */
.community-composer {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  border-top: 1px solid var(--line);
}

.community-composer__reply {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink-muted);
  font-size: 12px;
}

.community-composer__reply[hidden] {
  display: none;
}

.community-composer__reply span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-composer__reply .icon-button {
  width: 28px;
  height: 28px;
}

.community-composer__input {
  height: var(--control-md);
  padding: 0 var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  outline: none;
  background: var(--surface-1);
  color: var(--ink);
  font-size: 15px;
}

.community-composer__input:focus {
  border-color: var(--focus);
}

.community-composer__input::placeholder {
  color: var(--ink-muted);
}

.community-composer__bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.community-composer__online {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  color: var(--ink-muted);
  font-size: 12px;
  white-space: nowrap;
}

.community-composer__count {
  color: var(--ink-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.community-composer__rules {
  width: var(--control-sm);
  height: 36px;
}

.community-composer__send {
  height: 36px;
  padding: 0 var(--space-4);
  font-size: 14px;
}

.community-composer:has(.community-composer__input:placeholder-shown) .community-composer__send,
.community-composer[aria-busy="true"] .community-composer__send {
  opacity: 0.5;
  pointer-events: none;
}

/* Rules */
.rules-dialog {
  width: min(420px, 100% - 32px);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  color: var(--ink);
}

.rules-dialog::backdrop {
  background: var(--veil);
}

.rules-dialog h2 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: 18px;
}

.rules-dialog ol {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0 0 var(--space-5);
  padding-left: var(--space-5);
  color: var(--ink-muted);
  font-size: 14px;
}

.rules-dialog form {
  display: flex;
  justify-content: flex-end;
}

/* Console moderation */
.moderation {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 760px;
  height: 100%;
  margin: 0 auto;
  padding: var(--space-5);
}

.moderation__head {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.moderation__head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
}

.moderation__head p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.moderation .segmented {
  align-self: flex-start;
  background: var(--surface-1);
}

.moderation .segmented a {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-full);
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.moderation .segmented a[aria-current="page"] {
  background: var(--selected);
  color: var(--ink);
}

.moderation__log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.moderation .chat-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.moderation .chat-line__quote {
  flex-basis: 100%;
}

.moderation .chat-line__body {
  flex: 1;
  padding-right: 0;
}

.moderation .chat-line__menu {
  display: none;
}

/* How long and why the next mute is, picked once for every line's mute button. */
.moderation__mute {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.moderation__mute label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink-muted);
  font-size: 13px;
}

.moderation__mute select {
  height: 36px;
  padding: 0 var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  color: var(--ink);
  font: inherit;
}

/* The trivia running in the room, or the form for the next question. */
.moderation__trivia {
  margin: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.moderation__report-count.moderation__report-count--live {
  background: rgb(61 220 151 / 16%);
  color: var(--win);
}

.moderation__trivia-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
}

.moderation__trivia-form label {
  display: flex;
  flex: 1 1 160px;
  flex-direction: column;
  gap: var(--space-1);
  color: var(--ink-muted);
  font-size: 13px;
}

.moderation__trivia-form input {
  height: 36px;
  padding: 0 var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-0);
  color: var(--ink);
  font: inherit;
}

/* The console's form for a new announcement: the words across, then how, where and when. */
.announcement-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  align-items: end;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
}

.announcement-form label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.announcement-form input,
.announcement-form select {
  width: 100%;
  height: 36px;
  padding: 0 var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-0);
  color: var(--ink);
  font: inherit;
}

.announcement-form__wide {
  grid-column: 1 / -1;
}

.announcement-form button {
  justify-self: start;
}

@media (max-width: 767px) {
  .announcement-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

.announcement-swatch {
  --announcement: var(--accent);
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--announcement);
}

.moderation__empty {
  margin: 0;
  color: var(--ink-muted);
  font-size: 13px;
}

/* Messages players reported, for a moderator to look at first. */
.moderation__reports {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
}

.moderation__reports h2 {
  margin: 0;
  font-size: 15px;
}

.moderation__reports ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.moderation__reports li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: 14px;
}

.moderation__reports li p {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.moderation__report-count {
  flex: none;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  background: rgb(242 85 90 / 16%);
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

/* A rain keeps its rows, with the delete button under them. */
.moderation .chat-rain {
  padding-bottom: var(--space-2);
}

.moderation .chat-rain > p {
  flex-basis: 100%;
}

.moderation .chat-rain .chat-line__delete {
  margin-left: var(--space-3);
}

.chat-line__delete {
  flex: none;
  height: 28px;
  padding: 0 var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.chat-line__delete:hover {
  border-color: var(--danger);
  color: var(--danger);
}


/* Stamps in messages */
.chat-stamp {
  display: inline-block;
  width: 20px;
  height: 20px;
  vertical-align: -4px;
}

.chat-line__stamps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--space-1);
}

.chat-line__stamps .chat-stamp {
  width: 40px;
  height: 40px;
}

.chat-line__quote .chat-stamp {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

/* The composer's stamp and emoji picker */
.community-composer {
  position: relative;
}

.community-composer__field {
  position: relative;
  display: flex;
}

.community-composer__field .community-composer__input {
  flex: 1;
  min-width: 0;
  padding-right: 48px;
}

.community-composer__emoji {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink-muted);
  cursor: pointer;
}

.community-composer__emoji:hover,
.community-composer__emoji[aria-expanded="true"] {
  background: var(--surface-3);
  color: var(--focus);
}

.community-composer__limit {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
}

.community-composer__limit[hidden] {
  display: none;
}

.community-composer.is-over-limit .community-composer__send {
  opacity: 0.5;
  pointer-events: none;
}

.chat-picker {
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(340px, 60vh);
  padding: 10px 12px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: 1px solid var(--line);
  background: var(--surface-1);
  box-shadow: 0 -12px 32px rgb(0 0 0 / calc(0.35 * var(--shade)));
}

.chat-picker[hidden],
.chat-picker__pane[hidden],
.chat-picker__label[hidden],
.chat-picker__grid[hidden] {
  display: none;
}

.chat-picker__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.chat-picker__tabs {
  display: flex;
  flex: 1;
  gap: var(--space-1);
  padding: 3px;
  border-radius: var(--radius-md);
  background: var(--surface-0);
}

.chat-picker__tab {
  flex: 1;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.chat-picker__tab[aria-selected="true"] {
  background: var(--selected);
  color: var(--ink);
}

.chat-picker__pane {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.chat-picker__label {
  margin: 0;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 600;
}

.chat-picker__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2px;
}

.chat-picker__grid--emoji {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.chat-picker__item {
  display: grid;
  place-items: center;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  cursor: pointer;
}

.chat-picker__item:hover,
.chat-picker__item:focus-visible {
  background: var(--surface-3);
}

.chat-picker__item .chat-stamp {
  width: 34px;
  height: 34px;
}

.chat-picker__emoji {
  font-size: 22px;
  line-height: 1;
}

.chat-picker__categories {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chat-picker__category {
  flex: none;
  height: 30px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-full);
  background: var(--surface-0);
  color: var(--ink-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.chat-picker__category[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
}

/* Phone: the picker becomes a sheet over the room, with bigger targets. */
@media (max-width: 767px) {
  .chat-picker {
    max-height: 55vh;
    padding: var(--space-2) var(--space-4) 14px;
    border-radius: 18px 18px 0 0;
  }

  .chat-picker::before {
    flex: none;
    align-self: center;
    width: 40px;
    height: 4px;
    border-radius: var(--radius-full);
    background: var(--line);
    content: "";
  }

  .chat-picker__tab {
    height: 38px;
    font-size: 14px;
  }

  .chat-picker__item {
    height: 48px;
  }
}

/* Stamp suggestions while a :code is typed */
.chat-suggest {
  position: absolute;
  right: var(--space-3);
  bottom: calc(100% + var(--space-2));
  left: var(--space-3);
  z-index: 2;
  display: flex;
  flex-direction: column;
  max-height: 260px;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  box-shadow: 0 -12px 32px rgb(0 0 0 / calc(0.35 * var(--shade)));
}

.chat-suggest[hidden],
.chat-suggest__option[hidden] {
  display: none;
}

.chat-suggest__option {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-3);
  height: 44px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

.chat-suggest__option:hover,
.chat-suggest__option[aria-selected="true"] {
  background: var(--selected);
}

.chat-suggest__option .chat-stamp {
  width: 28px;
  height: 28px;
}

/* A chat command, listed as "/tip @user  Tip user". */
.chat-suggest__option--command .icon {
  flex: none;
  width: 28px;
  color: var(--ink-muted);
}

.chat-suggest__option .chat-suggest__syntax {
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
}

.chat-suggest__option span {
  color: var(--ink-muted);
  font-size: 13px;
}

.chat-suggest__hint {
  margin: var(--space-1) 0 0;
  padding: 6px 10px 2px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 12px;
}

/* Touch screens have no arrow keys to hint at. */
@media (hover: none) {
  .chat-suggest__hint {
    display: none;
  }
}

@media (max-width: 767px) {
  .chat-suggest__option {
    height: 48px;
  }
}
