/* Discuss ’Em record room. The original cast, word cards and game controls
   remain the focal points; this layer gives them room to breathe. */
body {
  overflow-x: clip;
}

.player-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid rgba(240, 215, 143, .75);
  background: linear-gradient(145deg, #263c60, #0a1428);
  box-shadow: 0 0 0 2px rgba(5, 10, 20, .55);
  vertical-align: middle;
}
.player-avatar--large { width: 72px; height: 72px; border-width: 2px; }
.player-avatar__fallback {
  font-family: "Cinzel", Georgia, serif;
  font-size: 11px;
  font-weight: 800;
  color: #f0d78f;
  letter-spacing: .02em;
}
.player-avatar--large .player-avatar__fallback { font-size: 23px; }
.player-avatar__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #10203c;
}
.player-avatar__img[hidden] { display: none; }
.player-identity {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  max-width: 100%;
}
.player-identity__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.player-link {
  width: auto;
  min-width: 0;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: none;
  text-align: left;
  cursor: pointer;
}
button.player-link:hover .player-identity__name { color: #f8df9d; text-decoration: underline; }
button.player-link:focus-visible, [data-player-handle]:focus-visible {
  outline: 2px solid #f0d78f;
  outline-offset: 3px;
}
.prow .player-identity { flex: 1; }
.srow .nm, .colhead .nm { min-width: 0; }
.sboard { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 8px; }
.srow { min-height: 44px; }
.srow .nm { flex: 1; }
.srow .nm .player-avatar, .colhead .nm .player-avatar { width: 27px; height: 27px; }
.srow .nm .player-identity__name { max-width: none; }
.srow .bot { display: none; }
.colhead .nm .player-identity__name { max-width: 102px; }
.colhead { flex-wrap: wrap; }
.colhead .nm { flex: 1 0 100%; }
.colhead .nm .player-identity__name { max-width: none; }
.colhead button.player-link { color: #101d33; }
.colhead button.player-link:hover .player-identity__name { color: #7a5c12; }
.brow > span:nth-child(2) > .player-avatar { margin-right: 9px; }

.record-rail {
  position: relative;
  min-width: 0;
  padding: 25px;
  border: 1px solid rgba(240, 215, 143, .56);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(18, 34, 61, .97), rgba(5, 12, 26, .97));
  box-shadow: 0 20px 70px rgba(0, 0, 0, .32), inset 0 0 0 4px rgba(201, 162, 39, .08);
}
.record-rail::before, .record-rail::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  pointer-events: none;
  border-color: #c9a227;
  opacity: .72;
}
.record-rail::before { top: 9px; left: 9px; border-top: 1px solid; border-left: 1px solid; }
.record-rail::after { right: 9px; bottom: 9px; border-right: 1px solid; border-bottom: 1px solid; }
.record-rail__eyebrow {
  color: #d7b959;
  font: 700 10px/1.5 "Cinzel", Georgia, serif;
  letter-spacing: .23em;
  text-transform: uppercase;
}
.record-rail h2, #difficulty-dialog h2 {
  margin: 5px 0 8px;
  color: #fff4cf;
  font: 700 clamp(23px, 2.3vw, 30px)/1.16 "Cinzel", Georgia, serif;
}
.record-rail__intro {
  margin: 0 0 20px;
  color: #b6c3d8;
  font-size: 14px;
  line-height: 1.55;
}
.match-record-caption {
  margin: 2px 0 8px;
  color: #b6c3d8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}
.difficulty-cards { display: grid; gap: 10px; }
.difficulty-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 12px;
  align-items: center;
  min-width: 0;
  padding: 15px 17px;
  border: 1px solid rgba(201, 162, 39, .3);
  border-radius: 12px;
  background: rgba(5, 10, 20, .38);
}
.difficulty-card.is-active {
  border-color: #f0d78f;
  background: linear-gradient(120deg, rgba(201, 162, 39, .2), rgba(8, 20, 41, .66));
  box-shadow: 0 0 0 1px rgba(240, 215, 143, .28), 0 0 30px rgba(201, 162, 39, .11);
}
.difficulty-card__label {
  font: 700 15px/1.3 "Cinzel", Georgia, serif;
  color: #f7e9bf;
}
.difficulty-card__score {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: #fff4cf;
  font: 800 29px/1 "Cinzel", Georgia, serif;
}
.difficulty-card__detail {
  min-width: 0;
  overflow: hidden;
  color: #b6c3d8;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.record-rail [data-difficulty-status] { min-height: 0; margin: 10px 0 0; }
.record-rail [data-difficulty-status]:empty { display: none; }
.record-rail [data-difficulty-refresh] { margin-top: 10px; }
.record-rail [data-difficulty-refresh][hidden], #difficulty-retry[hidden], #difficulty-match-history[hidden] { display: none !important; }
#difficulty-dialog {
  width: min(640px, calc(100vw - 26px));
  max-height: min(820px, calc(100dvh - 28px));
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(240, 215, 143, .74);
  border-radius: 18px;
  color: #f2ead8;
  background: linear-gradient(155deg, #142544, #080f1e 70%);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .7);
}
#difficulty-dialog::backdrop { background: rgba(2, 5, 12, .76); backdrop-filter: blur(7px); }
.difficulty-dialog__inside { position: relative; padding: clamp(20px, 4vw, 36px); }
button.difficulty-dialog__close {
  position: sticky;
  top: 15px;
  z-index: 2;
  display: block;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0 0 -44px auto;
  padding: 0;
  border: 1px solid rgba(240, 215, 143, .45);
  border-radius: 50%;
  background: #091527;
  color: #f0d78f;
  font: 27px/1 system-ui, sans-serif;
}
#difficulty-dialog-title { padding-right: 56px; }
.difficulty-dialog__identity {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0 22px;
  color: #fff4cf;
  font: 700 20px "Cinzel", Georgia, serif;
}
.difficulty-dialog__tabs, .difficulty-dialog__views { display: flex; gap: 7px; }
.difficulty-dialog__tabs { border-bottom: 1px solid rgba(201, 162, 39, .4); }
.difficulty-dialog__tabs button, .difficulty-dialog__views button {
  width: auto;
  min-height: 44px;
  padding: 8px 16px;
  border: 0;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: #b6c3d8;
  font: 700 13px "Cinzel", Georgia, serif;
}
.difficulty-dialog__tabs button[aria-selected="true"] {
  color: #fff4cf;
  background: rgba(201, 162, 39, .16);
  box-shadow: inset 0 -2px #f0d78f;
}
.difficulty-dialog__views { margin-top: 18px; }
.difficulty-dialog__views button { border-radius: 999px; }
.difficulty-dialog__views button[aria-pressed="true"] {
  background: #f0d78f;
  color: #101d33;
}
#difficulty-dialog-status { min-height: 24px; color: #d2ddeb; font-size: 14px; }
#difficulty-history { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.difficulty-history-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(201, 162, 39, .22);
  border-radius: 9px;
  background: rgba(5, 10, 20, .35);
}
.difficulty-history-row__rank { color: #d7b959; font: 700 12px "Cinzel", Georgia, serif; }
.difficulty-history-row__topic { min-width: 0; overflow-wrap: anywhere; font-weight: 700; }
.difficulty-history-row__topic small { display: block; color: #b6c3d8; font-size: 12px; font-weight: 500; }
.difficulty-history-row strong { color: #fff4cf; font: 800 19px "Cinzel", Georgia, serif; }
.difficulty-history-empty { padding: 24px 10px; color: #b6c3d8; text-align: center; }
#difficulty-retry { margin-top: 8px; }
.difficulty-dialog__match { margin-top: 18px; }

/* The lobby is a cast stage: real player portraits lead, invitations follow
   the main action. These rules never resize identities on other screens. */
#s-lobby {
  min-height: 100vh;
  background: url("/assets/discuss-room-wide.png") center top / cover no-repeat;
}
#s-lobby .wrap { max-width: 1320px; }
#s-lobby .topbar { min-height: 44px; margin-bottom: 4px; }
#s-lobby .hero {
  width: min(100%, 1000px);
  max-width: 1000px;
  margin: 0 auto;
  border-radius: 0;
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}
#s-lobby .hero .cast {
  aspect-ratio: 1400 / 686;
  object-fit: cover;
  object-position: center bottom;
  mask-image: linear-gradient(180deg, #000 87%, transparent);
  -webkit-mask-image: linear-gradient(180deg, #000 87%, transparent);
}
#s-lobby .hero::after { content: none; }
#s-lobby .lobby-setup {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  width: 100%;
  margin: -42px auto 0;
  position: relative;
  z-index: 2;
}
#s-lobby .lobby-setup > .frame {
  min-width: 0;
  margin: 0;
  padding: 26px clamp(16px, 2.5vw, 36px) 22px;
  border: 2px solid #d7ab51;
  border-radius: 32px;
  background: linear-gradient(155deg, rgba(13, 28, 43, .98), rgba(3, 9, 18, .98));
  box-shadow: 0 0 0 3px #20180c, 0 0 0 4px #a1772e, 0 18px 65px #000a, inset 0 1px 7px #ffdf9860;
}
#s-lobby .lobby-setup > .frame:not(.overlap) { text-align: center; }
#s-lobby .lobby-setup .frame-title {
  position: static;
  transform: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #f3d996;
  font: 700 16px/1.35 "Cinzel", Georgia, serif;
  letter-spacing: .22em;
}
#s-lobby .lobby-setup .frame-title::before,
#s-lobby .lobby-setup .frame-title::after { content: none; }
#s-lobby .lobby-roster > .frame-title { display: flex; align-items: center; justify-content: center; gap: 12px; }
#s-lobby .lobby-roster > .frame-title::before,
#s-lobby .lobby-roster > .frame-title::after {
  content: "";
  display: block;
  width: min(18vw, 170px);
  height: 1px;
  background: #a77e35;
}
#s-lobby .lobby-setup .frame > .frame-title + * { margin-top: 28px; }
#s-lobby .lobby-setup .code {
  padding: 4px 0 0;
  font-size: 29px;
  line-height: 1.2;
  letter-spacing: .15em;
}
#s-lobby .lobby-setup .row { gap: 10px; }
#s-lobby .lobby-setup .row button,
#s-lobby #claim-btn {
  min-height: 48px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .015em;
}
#s-lobby .lobby-setup button:not(.ghost):not(.player-link) {
  border: 2px solid #fff0b7;
  background: linear-gradient(180deg, #fff1be, #edc762 50%, #b78024);
  color: #241503;
  box-shadow: 0 0 0 3px #956421, 0 0 24px #e5ae3d66, inset 0 2px 4px #fff5d4;
}
#s-lobby .lobby-setup button.ghost {
  border-color: #bf9347;
  background: rgba(4, 12, 23, .94);
  color: #f2d793;
  box-shadow: inset 0 1px #f6dd9233, 0 4px 12px #0005;
}
#s-lobby .lobby-setup button.ghost:hover { border-color: #ffe4a0; background: #142438; }
#s-lobby .lobby-setup .hint { margin: 12px auto 0; color: #d5deea; text-align: center; font-size: 14px; }
#s-lobby .lobby-setup .plist {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}
#s-lobby .lobby-setup .prow {
  position: relative;
  flex: 0 1 calc((100% - 56px) / 5);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 6px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  text-align: center;
}
#s-lobby .lobby-setup .prow--host { background: rgba(247, 196, 79, .055); }
#s-lobby .lobby-setup .prow .player-identity {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  gap: 17px;
  text-align: center;
  border-radius: 18px;
}
#s-lobby .lobby-setup .prow .player-avatar {
  width: clamp(120px, 12vw, 176px);
  height: clamp(120px, 12vw, 176px);
  border: 3px solid #ffe7a6;
  box-shadow: 0 0 0 4px #9c6925, 0 0 0 6px #f1c66a, 0 0 24px #f6b63570, inset 0 0 14px #000;
  background: #091729;
}
#s-lobby .lobby-setup .prow .player-avatar__fallback { font-size: clamp(36px, 4vw, 62px); }
#s-lobby .lobby-setup .prow .st {
  position: absolute;
  top: calc(clamp(120px, 12vw, 176px) - 10px);
  left: calc(50% + clamp(120px, 12vw, 176px) * .31);
  width: 18px;
  height: 18px;
  border: 3px solid #06101a;
  z-index: 2;
  box-shadow: 0 0 0 1px #95e7c888;
}
#s-lobby .lobby-setup .prow .player-identity__name {
  min-width: 0;
  width: 100%;
  color: #fff8e7;
  font: 800 clamp(18px, 1.7vw, 26px)/1.15 "Hanken Grotesk", system-ui, sans-serif;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
}
#s-lobby .lobby-setup .prow .tag,
#s-lobby .lobby-setup .prow .bot {
  position: static;
  display: inline-block;
  min-width: 92px;
  margin: 0 auto;
  padding: 5px 14px;
  border: 1px solid #a08449;
  border-radius: 999px;
  color: #f2d793;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: .1em;
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  font-weight: 700;
}
#s-lobby .lobby-setup .prow .bot { margin-top: auto; color: #c2cbda; border-color: #68707e; }
#s-lobby .lobby-setup .prow .tag--player { color: #c2cbda; border-color: #68707e; }
#s-lobby .lobby-setup .prow--host .tag { background: #31220c; border-color: #e4bc60; box-shadow: 0 0 12px #d4962c33; }
#s-lobby .lobby-setup .prow .player-identity--bot { gap: 17px; }
#s-lobby .lobby-actions { min-width: 0; text-align: center; }
#s-lobby #host-controls { width: min(100%, 720px); margin: 0 auto 20px !important; gap: 16px; }
#s-lobby #start-btn { width: min(100%, 510px); min-height: 66px; margin: 0 auto !important; font-size: 28px; }
#s-lobby #claim-btn { width: min(100%, 510px); margin: 0 auto !important; }
#s-lobby .lobby-setup > .lobby-invite {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  width: min(100%, 800px);
  margin: 0 auto;
  padding: 17px 24px;
  border: 1px solid #b58a3e;
  border-radius: 18px;
  box-shadow: 0 12px 35px #0007, inset 0 1px #ffe5a71a;
}
#s-lobby .lobby-room-code { flex: none; text-align: center; padding-right: 26px; border-right: 1px solid #80642f; }
#s-lobby .lobby-room-code .frame-title { font: 700 10px/1.3 "Hanken Grotesk", system-ui, sans-serif; letter-spacing: .22em; }
#s-lobby .lobby-invite .row { flex: 1; min-width: 0; width: auto; margin: 0; }
#s-lobby .foot { padding-top: 20px; letter-spacing: .025em; color: #bfcede; }

/* Audio stays available without introducing a third setup card. */
.topbar .audio-controls.soundbar {
  width: auto;
  max-width: 100%;
  gap: 7px;
  padding: 4px 7px;
  border: 1px solid rgba(201, 162, 39, .32);
  border-radius: 999px;
  background: rgba(5, 12, 25, .83);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}
.topbar .audio-controls .iconbtn {
  width: 44px;
  min-height: 44px;
  height: 44px;
  border-color: rgba(201, 162, 39, .32);
  background: rgba(13, 26, 47, .76);
  font-size: 15px;
}
.topbar .audio-controls .iconbtn.on {
  color: #101d33;
  background: #e6c66f;
}
.topbar .audio-controls input[type="range"] {
  flex: 0 1 80px;
  width: 80px;
  min-width: 48px;
  height: 44px;
}
.topbar .audio-controls .pct { width: 32px; font-size: 10px; }
.topbar .audio-controls [data-boost] { opacity: .75; }
.topbar .audio-controls [data-boost].on { opacity: 1; }
.topbar .audio-controls :focus-visible,
.abandon-dialog button:focus-visible { outline: 2px solid #fff4cf; outline-offset: 3px; }

.abandon-dialog {
  width: min(440px, calc(100vw - 28px));
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(225, 192, 112, .58);
  border-radius: 18px;
  color: #f2ead8;
  background: linear-gradient(155deg, #182947, #091323 76%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .62);
  text-align: center;
}
.abandon-dialog::backdrop { background: rgba(2, 5, 12, .74); backdrop-filter: blur(6px); }
.abandon-dialog__eyebrow {
  color: #d7b959;
  font: 700 11px/1.4 "Hanken Grotesk", system-ui, sans-serif;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.abandon-dialog h2 {
  margin: 8px 0 10px;
  color: #fff4cf;
  font: 700 clamp(23px, 4vw, 29px)/1.18 "Cinzel", Georgia, serif;
}
.abandon-dialog p { margin: 0; color: #bdc9da; font-size: 15px; line-height: 1.55; }
.abandon-dialog__actions { display: flex; gap: 10px; margin-top: 25px; }
.abandon-dialog__actions button { min-height: 46px; font-size: 14px; }
.abandon-dialog #abandon-confirm {
  border-color: rgba(227, 130, 111, .65);
  background: linear-gradient(180deg, #efc6bb, #bd786d);
  color: #2a0f0d;
  box-shadow: 0 3px 0 #713e38, 0 9px 22px rgba(0, 0, 0, .3);
}

#s-final .hero { margin: 8px 0 0; }

.round-players {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin: 0 0 14px;
}
.round-player {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #ddd7c9;
  font-size: 13px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.round-player .player-avatar { width: 30px; height: 30px; }
.round-results-banner {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid #91702c;
  background: #060b11;
  isolation: isolate;
}
.round-results-scene { position: relative; aspect-ratio: 3 / 1; }
.round-results-stage { position: absolute; width: 100%; height: 100%; inset: 0; object-fit: cover; }
.round-results-logo {
  position: absolute; top: 0; left: 17%;
  width: 66%; height: 40%; object-fit: contain;
}
.round-results-laurels {
  position: absolute; top: 30%; left: 24%;
  width: 52%; height: 25%; object-fit: fill; pointer-events: none;
}
#round-results-title {
  position: absolute; top: 31%; left: 24%; width: 52%;
  margin: 0; text-align: center;
  font: 700 clamp(24px, 3.1vw, 52px)/1.08 Georgia, "Times New Roman", serif;
  letter-spacing: -.035em;
  color: #fff2cb; text-shadow: 0 2px 5px #000;
}
.round-winner {
  position: absolute; top: 43%; left: 25%; width: 50%;
  text-align: center; color: #fff7de;
  text-shadow: 0 2px 6px #000;
}
.round-winner[hidden] { display: none; }
.round-winner__label {
  display: block;
  margin: 0 0 3px;
  font: 700 10px/1.2 "Hanken Grotesk", system-ui, sans-serif;
  letter-spacing: .17em; text-transform: uppercase; color: #f2ce79;
}
.round-winner__players { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 24px; }
.round-winner .player-identity {
  justify-content: center; gap: 9px; max-width: 100%;
  font: 700 clamp(17px, 1.7vw, 28px)/1.1 Georgia, "Times New Roman", serif;
}
.round-winner .player-identity__name { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.round-winner .player-avatar { width: 36px; height: 36px; }
.round-winner .bot { font: 600 9px/1 system-ui, sans-serif; }
.round-winner__empty { font-size: clamp(14px, 1.5vw, 21px); }
.round-results-banner.has-tie .round-winner {
  position: relative; inset: auto; width: 100%;
  padding: 12px 20px 16px; border-top: 1px solid #80672e;
}
.round-results-banner.has-tie .round-winner__label { margin-bottom: 10px; }

#s-round .wrap {
  width: min(100%, 1000px);
  max-width: 1000px;
  margin-inline: auto;
}
#s-round .hero { width: 100%; max-width: none; }
#s-round .clockrow { justify-content: space-between; align-items: center; gap: 16px; }
.round-word-count { display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.round-word-count__label { color: #bdc9da; font: 600 12px/1.3 "Hanken Grotesk", system-ui, sans-serif; }

@media (min-width: 1000px) {
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
      linear-gradient(90deg, rgba(4, 9, 19, .16), rgba(4, 9, 19, .62) 30%, rgba(4, 9, 19, .62) 70%, rgba(4, 9, 19, .16)),
      linear-gradient(180deg, rgba(3, 7, 15, .26), rgba(3, 7, 15, .78)),
      url("/assets/discuss-room-wide.png") center top / cover no-repeat;
    opacity: .7;
  }
  .screen { position: relative; z-index: 1; padding: 22px clamp(24px, 3vw, 54px) 42px; }
  #s-home .wrap { max-width: 900px; }
  #s-reveal .wrap, #s-final .wrap {
    width: min(100%, 1540px);
    max-width: 1540px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 350px);
    column-gap: clamp(24px, 3vw, 46px);
    align-content: start;
  }
  #s-reveal .wrap > :not(.record-rail):not(.topbar),
  #s-final .wrap > :not(.record-rail):not(.topbar) { grid-column: 1; min-width: 0; }
  #s-reveal .topbar, #s-final .topbar { grid-column: 1 / -1; }
  #s-reveal .wrap > #round-results-banner { grid-column: 1 / -1; margin-bottom: 16px; }
  #s-reveal .record-rail, #s-final .record-rail {
    grid-column: 2;
    grid-row: 2 / span 12;
    align-self: start;
    position: sticky;
    top: 22px;
  }
  #s-reveal .record-rail { grid-row: 3 / span 12; }
  #s-round .topiccard { margin-top: -28px; }
  #s-round #answer { max-width: none; min-height: 66px; font-size: 21px; }
  #s-round .chips { min-height: 160px; align-content: start; }
  #s-reveal .matrix { grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); }
  #s-final .wrap > .recgrid,
  #s-final .wrap > .foot,
  #s-final .wrap > #again-btn,
  #s-final .wrap > .pillbtn { grid-column: 1 / -1 !important; }
  #s-final .wrap > .recgrid { margin-top: 22px; align-items: start; }
  #s-final .wrap > .hero { max-width: 900px; }
  #s-final .wrap > .frame.overlap { margin-top: -28px; }
}
@media (min-width: 1450px) {
  #s-reveal .wrap, #s-final .wrap {
    grid-template-columns: minmax(0, 1fr) 380px;
  }
}
@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; }
  .topbar .audio-controls.soundbar { margin-left: auto; }
  #s-lobby .hero { margin-top: 12px; }
  #s-lobby .lobby-setup { gap: 20px; margin-top: -10px; }
  #s-lobby .lobby-setup > .frame { padding: 22px 12px 16px; border-radius: 22px; }
  #s-lobby .lobby-setup .frame-title { font-size: 13px; letter-spacing: .12em; }
  #s-lobby .lobby-roster > .frame-title::before,
  #s-lobby .lobby-roster > .frame-title::after { width: 24px; }
  #s-lobby .lobby-setup .plist { gap: 18px 10px; }
  #s-lobby .lobby-setup .prow { flex-basis: calc((100% - 10px) / 2); padding: 6px 3px; }
  #s-lobby .lobby-setup .prow .player-avatar { width: clamp(80px, 23vw, 120px); height: clamp(80px, 23vw, 120px); }
  #s-lobby .lobby-setup .prow .player-avatar__fallback { font-size: 34px; }
  #s-lobby .lobby-setup .prow .st { width: 16px; height: 16px; top: calc(clamp(80px, 23vw, 120px) - 10px); left: calc(50% + clamp(80px, 23vw, 120px) * .3); }
  #s-lobby .lobby-setup .prow .player-identity__name { font-size: 18px; }
  #s-lobby .lobby-setup .prow .tag,
  #s-lobby .lobby-setup .prow .bot { min-width: 70px; padding: 4px 10px; font-size: 10px; }
  #s-lobby #host-controls { gap: 8px; }
  #s-lobby #host-controls button { font-size: 14px; }
  #s-lobby #start-btn { min-height: 58px; font-size: 24px; }
  #s-lobby .lobby-setup > .lobby-invite { flex-direction: column; gap: 14px; padding: 18px 14px; }
  #s-lobby .lobby-room-code { padding: 0; border: 0; }
  #s-lobby .lobby-invite .row { width: 100%; }
  #s-lobby .lobby-setup .code { font-size: 28px; }
  #s-lobby .lobby-invite .row button { font-size: 14px; }
}
@media (min-width: 701px) and (max-width: 999px) {
  #s-lobby .lobby-setup .prow { flex-basis: calc((100% - 28px) / 3); }
}
@media (max-width: 999px) {
  .record-rail { margin-top: 20px; }
  .difficulty-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .difficulty-card { grid-template-columns: 1fr; gap: 4px; padding: 12px; }
  .difficulty-card__score { grid-column: 1; grid-row: 2; font-size: 25px; }
  .difficulty-card__detail { grid-column: 1; grid-row: 3; }
}
@media (max-width: 700px) {
  .round-results-scene { min-height: 280px; aspect-ratio: auto; }
  .round-results-stage { top: auto; height: auto; bottom: 0; object-fit: contain; }
  .round-results-logo { top: 6px; left: 7%; width: 86%; height: 94px; }
  .round-results-laurels { top: 91px; left: 8%; width: 84%; height: 88px; }
  #round-results-title { top: 94px; left: 8%; width: 84%; font-size: clamp(25px, 6vw, 36px); }
  .round-winner { top: 136px; left: 12%; width: 76%; }
  .round-winner__label { font-size: 9px; }
  .round-winner .player-identity { font-size: 18px; }
  .round-winner .player-avatar { width: 32px; height: 32px; }
  .round-results-banner.has-tie .round-winner { padding: 14px; }
  .round-player { font-size: 11px; }
  .round-players { gap: 8px 12px; }
}
@media (max-width: 540px) {
  .topbar .audio-controls.soundbar { gap: 5px; padding: 3px 5px; }
  .topbar .audio-controls input[type="range"] { width: 54px; min-width: 45px; flex-basis: 54px; }
  .topbar .audio-controls .pct { display: none; }
  .abandon-dialog__actions { flex-direction: column; }
  .record-rail { padding: 22px 14px; }
  .difficulty-cards { gap: 6px; }
  .difficulty-card { padding: 10px 8px; }
  .difficulty-card__label { font-size: 12px; }
  .difficulty-card__score { font-size: 23px; }
  .difficulty-card__detail { font-size: 10px; }
  .difficulty-dialog__tabs button, .difficulty-dialog__views button { flex: 1; padding-inline: 8px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  #difficulty-dialog::backdrop { backdrop-filter: none; }
}

/* Round results: centered cast artwork, with readable round recognition. */
#s-reveal .wrap {
  display: block;
  width: min(100%, 1540px);
  max-width: 1540px;
}
#s-reveal .round-results-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr);
  grid-template-areas: "heading brand score" "winner brand score";
  gap: 8px 16px;
  align-items: center;
  padding: 8px 18px;
  overflow: visible;
  margin-bottom: 0;
  border-color: #9d7f3b;
  background: linear-gradient(120deg, #0b1725, #071526 55%, #07101c);
  box-shadow: inset 0 0 0 3px #cfaa4520, 0 14px 35px #0004;
}
#s-reveal .round-results-scene {
  grid-area: brand;
  align-self: end;
  justify-self: center;
  width: 100%;
  max-width: 540px;
  min-height: 0;
  height: auto;
  aspect-ratio: 1.95;
  margin-top: -40px;
  margin-bottom: -9px;
  overflow: hidden;
  border-radius: 0;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
#s-reveal .round-results-stage {
  inset: auto 0 0;
  width: 100%; height: auto;
  /* The gold rim is 93.5% down the source, above its dark footer. */
  transform: translateY(6.5%);
  object-fit: contain;
  object-position: center bottom;
}
#s-reveal .round-results-logo {
  top: 0; left: 0; width: 100%; height: auto;
  object-fit: contain;
}
#s-reveal .round-results-heading { grid-area: heading; }
.round-results-heading { min-width: 0; text-align: center; }
#s-reveal #round-results-title {
  position: static;
  width: auto;
  color: #eed49b;
  font: 700 14px/1.4 "Cinzel", Georgia, serif;
  text-transform: uppercase;
  letter-spacing: .22em;
  text-shadow: none;
}
#round-results-topic {
  margin: 6px 0 7px;
  color: #fff4d8;
  font: 700 clamp(24px, 2.7vw, 40px)/1.08 Georgia, serif;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.results-eyebrow {
  margin: 0;
  color: #eed49b;
  font: 700 11px/1.5 "Cinzel", Georgia, serif;
  letter-spacing: .15em;
  text-transform: uppercase;
}
#round-results-difficulty { color: #c1cbda; font-size: 12px; letter-spacing: .08em; }
.round-personal-score {
  grid-area: score;
  align-self: stretch;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  border-left: 1px solid #d9b7534a;
  text-align: center;
}
.round-personal-score strong {
  color: #f6d97e;
  font: 700 clamp(36px, 4.2vw, 60px)/1.1 Georgia, serif;
  letter-spacing: -.04em;
}
.round-personal-score [hidden] { display: none; }
[data-personal-pending], .results-pending { color: #aebcd0; font-size: 13px; }
#s-reveal .round-winner,
#s-reveal .round-results-banner.has-tie .round-winner {
  grid-area: winner;
  justify-self: center;
  position: static;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 12px;
  padding: 8px 12px;
  border: 1px solid #ddc06b80;
  border-radius: 12px;
  background: linear-gradient(110deg, #e8b9491f, #142338, #e8b94917);
  box-shadow: inset 0 1px #ffe9a822, 0 0 18px #efbb3012;
  text-shadow: none;
}
#s-reveal .round-winner[hidden] { display: none; }
#s-reveal .round-winner__label { flex-basis: 100%; margin: 0; font-size: 13px; color: #ffe092; }
#s-reveal .round-winner__label > span { font-size: 18px; vertical-align: middle; }
#s-reveal .round-winner .player-identity { font: 700 24px/1.2 "Hanken Grotesk", system-ui, sans-serif; }
#s-reveal .round-winner .player-avatar { width: 56px; height: 56px; box-shadow: 0 0 14px #efbd4440; border-color: #f4d982; }
#s-reveal .round-winner__players { gap: 5px 18px; }
#s-reveal .round-winner__score { font: 700 28px/1.2 Georgia, serif; color: #ffdfa0; white-space: nowrap; }
#s-reveal .round-winner__empty { font-size: 17px; color: #c1cbda; }
#s-reveal #rev-topic { display: none; }
#s-reveal #rev-meter { height: 4px; margin-block: 10px 18px !important; }
#s-reveal #scoreframe { margin: 0 0 16px !important; padding: 20px 12px 12px; }
#s-reveal #scoreframe .frame-title { font-size: 10px; letter-spacing: .13em; }
#scoreframe .frame-title span { font: 500 10px/1.5 "Hanken Grotesk", sans-serif; letter-spacing: .02em; text-transform: none; color: #b2c2d7; }
#s-reveal .sboard { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
#s-reveal .srow {
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr) auto;
  gap: 3px 10px;
  padding: 10px;
  min-height: 78px;
  border: 1px solid #b8c7df29;
  border-radius: 11px;
  background: #061322d9;
}
#s-reveal .srow .rk {
  grid-row: 1 / span 2;
  display: grid; place-items: center;
  width: 29px; height: 34px;
  border: 1px solid #c0d2ee59;
  border-radius: 40% 40% 46% 46%;
  background: linear-gradient(#435772, #1c2c42);
  color: #dce6f5;
  font-size: 17px;
}
#s-reveal .srow.podium-1 .rk { color: #ffde76; border-color: #f5cc68; background: linear-gradient(#786027, #211c13); box-shadow: 0 0 16px #efbd4438; }
#s-reveal .srow.podium-2 .rk { color: #ecf4ff; border-color: #c8d5ec; }
#s-reveal .srow.podium-3 .rk { color: #f9c8a0; border-color: #ba8864; background: linear-gradient(#77543e, #28201c); }
#s-reveal .srow .nm { grid-column: 2 / -1; grid-row: 1; }
#s-reveal .srow .player-identity { display: flex; font-size: 18px; }
#s-reveal .srow .player-avatar { width: 48px; height: 48px; }
#s-reveal .srow .player-identity__name { white-space: normal; overflow-wrap: anywhere; }
#s-reveal .srow .tot { grid-column: 2; margin: 0; padding-left: 57px; font: 700 19px/1 Georgia, serif; }
#s-reveal .srow .gain { grid-column: 3; font-size: 12px; color: #80dab5; }
#s-reveal .srow.me { border-color: #d8b654; background: linear-gradient(115deg, #ae852b40, #112234); box-shadow: inset 0 0 12px #d4ae4224; }
.results-dashboard { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 16px; }
.results-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid #a58a45;
  border-radius: 13px;
  background: linear-gradient(125deg, #081a2ceb, #061321f5);
  box-shadow: inset 0 0 0 3px #dbbb5910, 0 10px 25px #0003;
}
.results-self { padding: 16px 0; border-bottom: 1px solid #bdcae12b; }
.results-self .player-avatar { width: 50px; height: 50px; }
.results-self .player-identity { font: 700 24px/1.15 Georgia, serif; }
.results-breakdown-list { margin: 6px 0 0; }
.results-breakdown-list > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid #bdcae122; }
.results-breakdown-list dt { font-size: 13px; color: #e4e9f0; }
.results-breakdown-list dt small { display: block; font-size: 11px; color: #91a6bf; }
.results-breakdown-list dd { margin: 0; color: #edf1f8; font: 700 19px/1 Georgia, serif; }
.results-breakdown-list [data-breakdown="total"] { margin: 10px -7px 0; padding: 12px 7px; border: 1px solid #d4b45780; border-radius: 8px; background: #d3ad3620; }
.results-breakdown-list [data-breakdown="total"] dt { color: #fff0bc; font-weight: 700; }
.results-breakdown-list [data-breakdown="total"] dd { font-size: 29px; color: #ffdf8d; }
.results-breakdown-list [data-breakdown="match"] { border-bottom: 0; }
.results-breakdown-list [data-breakdown="match"] dd { color: #95dfbd; }
.results-breakdown-note { font-size: 10px; line-height: 1.45; color: #91a6bf; margin: 9px 0 0; }
#s-reveal .record-rail { position: static; padding: 18px; margin: 0; border-radius: 13px; grid-column: auto; grid-row: auto; background: linear-gradient(125deg, #081a2ceb, #061321f5); }
#s-reveal .record-rail::before, #s-reveal .record-rail::after { display: none; }
#s-reveal .record-rail h2 { font: 700 20px/1.2 Georgia, serif; }
#s-reveal .record-rail__intro { font-size: 11px; margin-bottom: 12px; }
#s-reveal .difficulty-cards { grid-template-columns: 1fr; gap: 7px; }
#s-reveal .difficulty-card { padding: 10px 12px; }
#s-reveal .difficulty-card__label { font-size: 12px; }
#s-reveal .difficulty-card__score { font-size: 25px; }
#s-reveal .difficulty-card__detail { font-size: 10px; }
#s-reveal .results-words { padding: 16px 12px 10px; margin-top: 16px; }
.results-words > h2 { margin: 0 3px 9px; }
#s-reveal .matrix { gap: 9px; margin: 0; padding: 4px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
#s-reveal .col { border: 1px solid #b6c5d746; border-radius: 10px; padding: 9px 7px 7px; background: linear-gradient(#fff8e2, #eae4d3); box-shadow: none; }
#s-reveal .col.me { border-color: #e8c754; box-shadow: 0 0 0 2px #dab33b55, 0 0 20px #ddae2730; }
#s-reveal .colhead { --result-avatar-size: 64px; flex-wrap: nowrap; align-items: center; gap: 5px; padding-bottom: 8px; }
#s-reveal .colhead .player-avatar { width: var(--result-avatar-size); height: var(--result-avatar-size); }
#s-reveal .colhead .nm {
  display: flex;
  flex: 1 1 0;
  padding: 2px;
  overflow: visible;
  white-space: normal;
  font: 700 20px/1.15 "Hanken Grotesk", sans-serif;
}
#s-reveal .colhead .sc, #s-reveal .colhead .gain { flex: none; margin-left: 0; white-space: nowrap; }
#s-reveal .colhead .player-identity { position: relative; align-items: center; gap: 9px; }
#s-reveal .colhead .player-identity__name { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
#s-reveal .colhead .bot {
  position: absolute;
  top: calc(50% + var(--result-avatar-size) / 2 - 7px);
  left: calc(var(--result-avatar-size) / 2);
  transform: translateX(-50%);
  margin: 0;
  padding: 1px 5px;
  border-color: #bd9b48;
  background: #102035;
  color: #ffedbc;
  font: 700 8px/1.2 "Hanken Grotesk", sans-serif;
  letter-spacing: .12em;
}
#s-reveal .wordrow { font-size: 11px; }
#s-reveal .results-unclaimed { margin-top: 0; padding: 15px 18px; }
.results-unclaimed > h2 { margin-bottom: 10px; }
#s-reveal .results-unclaimed .wordrow.invalid { background: #15273c; border-color: #a6c0de30; color: #c5d2e4; }
#s-reveal #next-btn { width: min(100%, 330px); margin: 20px auto 0 !important; min-height: 48px; border-color: #f5d773; color: #30200a; background: linear-gradient(#fff0b2, #d9ac3d); box-shadow: inset 0 0 0 3px #fff4c42e, 0 7px 24px #0004; font: 700 22px/1 Georgia, serif; }
#s-reveal #rev-foot { margin-top: 15px; font-size: 11px; }
@media (min-width: 1600px) {
  .results-dashboard { grid-template-columns: 310px minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  #s-reveal .round-results-banner { gap: 8px 12px; padding-inline: 12px; }
  #s-reveal .round-results-scene { margin-top: 0; }
  .results-dashboard { grid-template-columns: 250px minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 900px) {
  #s-reveal .round-results-banner {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "brand" "heading" "winner" "score";
    padding: 12px;
    gap: 10px;
  }
  #s-reveal .round-results-scene { width: min(100%, 420px); height: auto; margin: 0 auto; }
  #s-reveal .round-results-heading { text-align: center; }
  #s-reveal #round-results-title { text-align: center; font-size: 13px; letter-spacing: .13em; }
  #round-results-topic { font-size: 32px; }
  .round-personal-score .results-eyebrow { font-size: 11px; }
  .round-personal-score strong { font-size: 40px; }
  #s-reveal .round-personal-score { display: flex; align-items: center; justify-content: center; gap: 12px; border-left: 0; }
  .results-dashboard { grid-template-columns: 1fr; }
  #s-reveal .record-rail { padding: 15px; }
  #s-reveal .sboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #s-reveal .srow { grid-template-columns: 22px minmax(0, 1fr) auto; gap: 4px 7px; padding: 8px; }
  #s-reveal .srow .rk { width: 22px; height: 28px; font-size: 13px; }
  #s-reveal .srow .player-avatar { width: 44px; height: 44px; }
  #s-reveal .srow .player-identity { font-size: 16px; gap: 6px; }
  #s-reveal .srow .tot { padding-left: 0; font-size: 18px; }
  #s-reveal .srow .gain { font-size: 11px; }
  #s-reveal #scoreframe .frame-title { font-size: 9px; white-space: nowrap; }
}
@media (max-width: 619px) {
  #s-reveal .col { flex-basis: 280px; }
}
@media (max-width: 480px) {
  #s-reveal .sboard { grid-template-columns: 1fr; }
  #s-reveal .srow .player-avatar { width: 48px; height: 48px; }
  #s-reveal .srow .player-identity { font-size: 18px; }
  #s-reveal .srow .tot { padding-left: 57px; }
  #s-reveal .record-rail .difficulty-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #s-reveal .record-rail { padding: 14px; }
  #s-reveal .difficulty-card { padding: 9px 7px; }
  .results-panel { padding: 15px; }
  #s-reveal .results-words { padding: 13px 7px 7px; }
  #s-reveal .colhead { --result-avatar-size: 60px; }
  #s-reveal .colhead .nm { font-size: 18px; }
  #s-reveal #scoreframe .frame-title span { display: none; }
}
@media (max-width: 420px) {
  #s-reveal .round-results-banner { grid-template-columns: minmax(0, 1fr); }
  #s-reveal .round-results-heading,
  #s-reveal #round-results-title { text-align: center; }
  #s-reveal .round-personal-score {
    border-left: 0;
    border-top: 1px solid #d9b7534a;
    padding-top: 10px;
  }
}
