/* Chatrooms: lobby and room page. Builds on /style.css and /chicks.css. */
.rm { min-height: 100dvh; }
.rm-app { max-width: 980px; margin: 0 auto; padding: 22px 20px 60px; position: relative; }
.rm-top { display: flex; justify-content: center; margin-bottom: 22px; }
.switch { display: inline-flex; background: var(--ink); border-radius: 999px; padding: 4px; gap: 2px; }
.switch-item { color: #fff; text-decoration: none; padding: 9px 20px; border-radius: 999px; font: 600 14px var(--body); }
.switch-item.on { background: var(--grad); font-weight: 700; }
.switch-count { font: 500 11px var(--mono); opacity: .85; margin-left: 4px; }
.rm-title { font: 600 clamp(36px, 7vw, 56px)/1.02 var(--display); letter-spacing: -.035em; margin: 0 0 8px; }
.rm-title em { font: italic 400 1.14em var(--serif); color: #E5336B; letter-spacing: -.01em; }
.rm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 24px; }
.rm-card {
  all: unset; box-sizing: border-box; cursor: pointer; position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
  min-height: 150px; padding: 18px; border-radius: 26px; color: var(--ink); background: #fff; box-shadow: var(--card-shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.rm-card:hover { transform: translateY(-3px); }
.rm-card:focus-visible { outline: 3px solid #E5336B; outline-offset: 3px; }
.rm-card strong { font: 700 24px var(--display); letter-spacing: -.02em; }
.rm-card .rm-blurb { font-size: 14px; opacity: .85; }
.rm-card .rm-count { font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.rm-card .rm-tag { position: absolute; top: 14px; left: 18px; font: 500 10px var(--mono); letter-spacing: .14em; background: var(--ink); color: #fff; padding: 3px 8px; border-radius: 6px; }
.rm-sec { margin: 30px 0 0; font: italic 400 26px var(--serif); letter-spacing: -.01em; }
.rm-gamegrid { margin-top: 12px; grid-template-columns: repeat(3, 1fr) !important; }
.rm-scribble { background: var(--grad); color: #fff; box-shadow: var(--lift); min-height: 190px; }
.rm-scribble .rm-tag { background: #fff; color: var(--ink); }
.rm-trivia { background: var(--ink); color: #fff; min-height: 190px; }
.rm-trivia .rm-tag { background: #FF9A5B; color: var(--ink); }
.rm-emoji { background: #E6CFEA; min-height: 190px; }
@media (max-width: 640px) { .rm-gamegrid { grid-template-columns: 1fr !important; } .rm-gamegrid .rm-card { min-height: 130px; } }
.rm-adults { background: var(--ink); color: #fff; }
.rm-adults .rm-tag { background: #E5336B; }
.rm-dating { background: var(--blush); }
.rm-music { background: var(--peach); }
.rm-gaming { background: #E6CFEA; }
.rm-latenight { grid-column: span 2; background: #fff; }
.rm-suggest { background: transparent; border: 2px dashed #B79BC1; box-shadow: none; align-items: center; justify-content: center; text-align: center; color: var(--soft); }
.rm-suggest strong { font: italic 400 26px var(--serif); letter-spacing: -.01em; }
.rm-note { text-align: center; }
.rm-suggest { grid-column: 1 / -1; min-height: 100px; }
@media (min-width: 900px) { .rm-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 899px) { .rm-grid { grid-template-columns: 1fr 1fr; } .rm-card { min-height: 140px; padding: 14px; } }
.sg-head { margin: 12px 0 0; }
.sg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sg-row { display: flex; align-items: center; gap: 12px; background: var(--bg); border-radius: 20px; padding: 8px 8px 8px 16px; }
.sg-row strong { font: 700 15px var(--display); display: block; }
.sg-row small { font: 500 10px var(--mono); letter-spacing: .12em; color: var(--mute); text-transform: uppercase; }
.sg-row .grow { flex: 1; min-width: 0; }
.sg-vote { all: unset; cursor: pointer; padding: 0 18px; height: 40px; line-height: 40px; border-radius: 999px; background: var(--ink); color: #fff; font: 700 13px var(--body); }
.sg-vote[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px #E5336B; }
.sg-vote:focus-visible { outline: 3px solid #E5336B; outline-offset: 2px; }

/* Room page */
.room-ad { margin: 10px 12px 0; }
.room-ad[hidden] { display: none; }
.tx-who .btn { flex: none; }
.rm-back-link { display: inline-flex; align-items: center; justify-content: center; margin-top: 12px; text-decoration: none; width: 100%; }
.msg-row { display: flex; flex-direction: column; gap: 2px; max-width: 82%; align-self: flex-start; }
.msg-row.me { align-self: flex-end; align-items: flex-end; }
.msg-meta { display: flex; align-items: center; gap: 6px; font: 500 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #E5336B; padding: 0 6px; }
.tx-chat[data-bg="night"] .msg-meta, .tx-chat[data-bg="fireworks"] .msg-meta, .tx-chat[data-bg="neon"] .msg-meta, .tx-chat[data-bg="sunset"] .msg-meta { color: #FFD9B8; }
.msg-flag { all: unset; cursor: pointer; opacity: .55; font-size: 12px; padding: 2px 4px; border-radius: 6px; }
.msg-flag:hover { opacity: 1; background: rgba(29, 22, 38, .08); }
.msg-flag:focus-visible { outline: 2px solid #E5336B; }
.msg-row .bubble { max-width: 100%; }
@media (min-width: 900px) { .tx-app { max-width: 820px; } }

@media (max-width: 560px) {
  #room .tx-bar { flex-wrap: nowrap; }
  #room .tx-who { flex: 1 1 auto; }
  #room .tx-tools { width: auto; }
  #room .tx-tools .btn { flex: 0 0 auto; }
  #room .tx-tools .btn-icon { flex: 0 0 44px !important; }
}

/* ---- Party room: vote, Scribble, Trivia Blitz, Emoji Guess ---- */
.room-chat { display: contents; }
.pt-stage, .pt-players { font-family: var(--body); }
.pt-cap { font: 500 11px var(--mono); letter-spacing: .16em; color: #E5336B; text-transform: uppercase; }
.pt-cap.soft { color: var(--mute); }
.pt-bar { background: var(--ink); color: #fff; display: flex; align-items: center; gap: 14px; padding: 12px 20px; min-height: 62px; border-radius: 24px; flex-wrap: wrap; }
.pt-label { font: 500 11px var(--mono); letter-spacing: .14em; color: var(--gold); text-transform: uppercase; }
.pt-title { font: italic 400 24px/1 var(--serif); flex: 1; min-width: 140px; }
.pt-prog { width: 96px; height: 8px; background: rgba(255, 255, 255, .18); border-radius: 999px; overflow: hidden; }
.pt-prog > div { height: 8px; width: 0; background: var(--grad); border-radius: 999px; transition: width .25s linear; }
.pt-time { font: 500 20px var(--mono); min-width: 44px; text-align: right; }
.pt-how { margin: 0; font-size: 15px; line-height: 1.45; color: var(--soft, #5b4a66); max-width: 46ch; }
.pt-votebody { display: flex; flex-direction: column; gap: 10px; padding: 16px 4px 4px; }
.pt-h { font: italic 400 30px/1 var(--serif); margin: 0 0 4px; letter-spacing: -.01em; }
.pt-gcard { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 22px; padding: 14px 16px; box-shadow: 0 10px 24px -18px rgba(29, 22, 38, .5); }
.pt-gcard:focus-visible { outline: 3px solid #E5336B; outline-offset: 2px; }
.pt-gtx { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pt-gtx small { font: 500 9px var(--mono); letter-spacing: .14em; color: #7A6F89; }
.pt-gtx strong { font: 700 18px var(--display); }
.pt-pill { background: var(--ink); color: #fff; border-radius: 999px; padding: 8px 14px; font: 700 12px var(--body); white-space: nowrap; }
.pt-gcard.on { background: var(--grad); color: #fff; box-shadow: var(--lift); }
.pt-gcard.on small { color: rgba(255, 255, 255, .9); }
.pt-gcard.on .pt-pill { background: #fff; color: var(--ink); }
.pt-count { background: var(--ink); color: #fff; border-radius: 999px; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; font: 600 13px var(--body); margin-top: 6px; }
.pt-count b { font: 500 18px var(--mono); color: var(--gold); }
.pt-fine { font: 500 9px var(--mono); letter-spacing: .12em; color: #7A6F89; text-align: center; }
.pt-note-line { margin: 0; text-align: center; font: 600 13px var(--body); color: var(--soft); }
.pt-round, .pt-vote, .pt-over { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.pt-hintcard { background: #fff; border-radius: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; min-height: 60px; flex-wrap: wrap; box-shadow: 0 14px 30px -22px rgba(29, 22, 38, .5); }
.pt-slots { display: flex; gap: 6px; align-items: flex-end; flex-wrap: wrap; justify-content: center; }
.pt-slot { display: inline-block; min-width: 24px; height: 30px; border-bottom: 3px solid var(--ink); text-align: center; font: 500 22px/30px var(--mono); }
.pt-gap { width: 14px; }
.pt-canvaswrap { position: relative; padding: 0 10px 10px 0; }
.pt-canvasback { position: absolute; inset: 10px 0 0 10px; background: linear-gradient(135deg, #FFD0DC, #FFD9B8); border-radius: 26px; transform: rotate(1deg); }
.pt-canvas { position: relative; display: block; width: 100%; aspect-ratio: 1000 / 640; background: #fff; border-radius: 26px; box-shadow: 0 24px 46px -26px rgba(29, 22, 38, .6); touch-action: none; }
.pt-canvas.can { cursor: crosshair; }
.pt-tools { background: #fff; border-radius: 20px; display: flex; align-items: center; gap: 8px; padding: 8px 14px; flex-wrap: wrap; box-shadow: 0 14px 30px -22px rgba(29, 22, 38, .5); }
.pt-dot { all: unset; box-sizing: border-box; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; }
.pt-dot.on { outline: 2px solid #E5336B; outline-offset: 3px; }
.pt-sep { width: 1.5px; height: 28px; background: var(--border); margin: 0 4px; }
.pt-w { all: unset; box-sizing: border-box; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; border-radius: 50%; }
.pt-w i { display: block; background: var(--ink); border-radius: 50%; }
.pt-w.on { outline: 2px solid #E5336B; outline-offset: 1px; }
.pt-fill { flex: 1; }
.pt-qcard, .pt-emojicard { background: #fff; border-radius: 26px; padding: 22px; display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; box-shadow: 0 24px 46px -30px rgba(29, 22, 38, .6); }
.pt-q { font: 600 clamp(20px, 3vw, 28px)/1.2 var(--display); margin: 0; letter-spacing: -.02em; }
.pt-emojis { font-size: clamp(48px, 9vw, 84px); line-height: 1.1; letter-spacing: .08em; }
.pt-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pt-opt { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 22px; padding: 14px 16px; font: 600 16px var(--body); box-shadow: 0 10px 24px -18px rgba(29, 22, 38, .5); min-height: 60px; }
.pt-opt:not(:disabled):hover { transform: translateY(-2px); }
.pt-opt:focus-visible { outline: 3px solid #E5336B; outline-offset: 2px; }
.pt-opt:disabled { cursor: default; }
.pt-key { width: 30px; height: 30px; border-radius: 50%; background: #F0E1F2; display: grid; place-items: center; font: 500 13px var(--mono); flex: none; }
.pt-opt.picked { background: var(--blush); }
.pt-opt.right { background: var(--ink); color: #fff; }
.pt-opt.right .pt-key { background: var(--grad); color: #fff; }
.pt-opt.wrong { background: #fff; text-decoration: line-through; opacity: .6; }
.pt-orow { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 20px; padding: 8px 14px; }
.pt-orow.first { background: var(--grad); color: #fff; box-shadow: var(--lift); }
.pt-orow strong { flex: 1; font-size: 15px; }
.pt-rank { font: 500 13px var(--mono); width: 18px; }
.pt-av { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 20px; flex: none; }
.pt-score { font: 500 13px var(--mono); }
.pt-players { background: #fff; border-radius: 24px; padding: 16px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 14px 30px -20px rgba(29, 22, 38, .5); overflow-y: auto; }
.pt-plist { display: flex; flex-direction: column; gap: 4px; }
.pt-prow { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 16px; }
.pt-prow.hot { background: #FFE9E0; }
.pt-ptx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pt-ptx strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-ptx small { font: 500 10px var(--mono); letter-spacing: .1em; color: #E5336B; }
.sys-ink, .sys-peach { align-self: stretch; text-align: center; border-radius: 999px; padding: 9px 14px; font: 600 13px var(--body); }
.sys-ink { background: var(--ink); color: #fff; }
.sys-peach { background: var(--peach); color: var(--ink); }

/* desktop: players | stage | chat */
@media (min-width: 900px) {
  .tx-app:has(#room.is-party:not([hidden])) { max-width: 1240px; }
  #room.is-party { display: grid; grid-template-columns: 236px minmax(0, 1fr) 332px; grid-template-areas: "players stage chat"; gap: 20px; background: transparent; border-radius: 0; box-shadow: none; border: 0; }
  #room.is-party.pt-live:not(:has(.pt-players:not([hidden]))) { grid-template-columns: minmax(0, 1fr) 332px; grid-template-areas: "stage chat"; }
  #room.is-party:not(.pt-live) { grid-template-columns: minmax(0, 1fr) 332px; grid-template-areas: "stage chat"; }
  #room.is-party .pt-players { grid-area: players; }
  #room.is-party .pt-stage { grid-area: stage; min-height: 0; overflow-y: auto; padding-top: 6px; }
  #room.is-party .room-chat { grid-area: chat; display: flex; flex-direction: column; min-height: 0; background: #FFEDE6; border-radius: 26px; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(29, 22, 38, .5); }
  #room.is-party .room-chat .tx-bar { border-radius: 0; }
}
/* phones: stage on top, chat below, players as chips */
@media (max-width: 899px) {
  #room.is-party { display: flex; flex-direction: column; }
  #room.is-party .pt-stage { order: 0; flex: none; max-height: 60dvh; overflow-y: auto; padding: 8px 12px 0; background: var(--bg); }
  #room.is-party .pt-players { order: 1; flex: none; flex-direction: row; align-items: center; padding: 6px 12px; border-radius: 0; box-shadow: none; background: var(--bg); overflow-x: auto; }
  #room.is-party .pt-players .pt-cap { display: none; }
  #room.is-party .pt-plist { flex-direction: row; gap: 8px; }
  #room.is-party .pt-prow { background: #fff; border-radius: 999px; padding: 4px 12px 4px 4px; flex: none; }
  #room.is-party .pt-prow.hot { background: #FFE9E0; }
  #room.is-party .pt-av { width: 28px; height: 28px; font-size: 16px; }
  #room.is-party .pt-ptx small { display: none; }
  #room.is-party .room-chat { order: 2; flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
  #room.is-party .pt-bar { padding: 10px 16px; min-height: 0; border-radius: 0 0 26px 26px; }
  #room.is-party .pt-prog { display: none; }
  #room.is-party .pt-opts { grid-template-columns: 1fr; }
  #room.is-party .pt-h { font-size: 26px; }
  #room.is-party .pt-slot { min-width: 20px; font-size: 19px; }
}

@media (min-width: 900px) {
  .pt-bar { flex-wrap: nowrap; }
  .pt-title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 22px; }
  .pt-label { white-space: nowrap; }
}

/* the suggest sheet must cover the screen you are looking at, wherever the page is scrolled */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet { display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet .sheet-card { width: 100%; max-width: 520px; max-height: 88vh; max-height: 88dvh; overflow-y: auto; box-sizing: border-box; }
@media (min-width: 700px) { .sheet { align-items: center; } .sheet .sheet-card { border-radius: 28px; } }
.sheet .sheet-card { padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.sheet .sheet-card h2 { margin: 0; }
.sheet .sheet-card > * { flex-shrink: 0; }
.sheet .sheet-card input[type="text"], .sheet .sheet-card input:not([type]) { min-height: 48px; box-sizing: border-box; }
