html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #061412;
  color: #f8edcf;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

.game-shell {
  box-sizing: border-box;
  display: grid;
  align-content: start;
  min-height: 0;
  padding: clamp(10px, 2vw, 18px);
}

.duel-panel {
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto auto auto auto;
  gap: clamp(8px, 1.4vw, 14px);
  width: min(1480px, 100%);
  margin: 0 auto;
  align-self: start;
  padding: clamp(10px, 1.8vw, 18px);
  border: 1px solid rgb(255 230 164 / 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgb(3 16 15 / 0.34), rgb(2 10 10 / 0.82)),
    #061412;
  box-shadow: 0 24px 70px rgb(0 0 0 / 0.42);
}

.hero-copy {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  min-height: clamp(232px, 34vh, 330px);
  overflow: hidden;
  gap: clamp(8px, 1.4vw, 14px);
  padding: clamp(12px, 2vw, 20px);
  border-radius: 8px;
  isolation: isolate;
}

.hero-copy::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(90deg, rgb(2 12 10 / 0.9), rgb(2 12 10 / 0.32) 55%, rgb(2 12 10 / 0.18));
}

.hero-copy > img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-copy > div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.hero-copy > .hero-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  max-width: none;
}

.hero-secondarybar {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid rgb(255 230 164 / 0.22);
  border-radius: 8px;
  background: rgb(2 12 10 / 0.58);
}

.hero-secondarybar .daily-banner {
  margin-left: auto;
  border-color: rgba(247, 201, 87, 0.7);
  background: #f7c957;
  color: #17120d;
}

.hero-branding {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.hero-home-link {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 8px 20px rgb(0 0 0 / 0.28);
}

.hero-home-link img {
  position: static;
  inset: auto;
  z-index: auto;
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: contain;
}

.hero-utilities {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.hero-title-lane {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(144px, 23vh, 224px);
}

.eyebrow,
.score-strip span,
.duel-card p,
.hand-head p {
  margin: 0;
  color: #f1d27e;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.provenance-badge,
.provenance-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  box-shadow: 0 8px 20px rgb(0 0 0 / 0.28);
  transition:
    transform 160ms ease,
    filter 160ms ease;
}

.provenance-badge:hover,
.provenance-badge:focus-visible,
.provenance-icon:hover,
.provenance-icon:focus-visible {
  transform: translateY(-1px) scale(1.04);
  filter: brightness(1.08);
  outline: 2px solid rgb(241 210 126 / 0.62);
  outline-offset: 3px;
}

.provenance-badge img,
.provenance-icon img {
  position: static;
  inset: auto;
  z-index: auto;
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: contain;
}

.game-titlemark {
  position: relative;
  inset: auto;
  z-index: 1;
  display: block;
  width: min(100%, 720px);
  max-height: none;
  height: auto;
  object-fit: contain;
}

.game-titlemark--landing {
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.26));
}

.hero-copy .game-titlemark {
  position: relative;
  inset: auto;
  z-index: 1;
  width: min(100%, 720px);
  max-height: none;
  height: auto;
  object-fit: contain;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 5.2rem);
  line-height: 0.9;
}

h2 {
  font-size: clamp(1.2rem, 3vw, 1.7rem);
}

.hero-copy p:not(.eyebrow),
.buzz-footer p,
dialog p,
dialog li {
  color: rgb(248 237 207 / 0.84);
  font-size: clamp(0.92rem, 1.5vw, 1.05rem);
  line-height: 1.38;
}

.hero-copy p {
  margin: 0;
}

.score-strip {
  display: grid;
  grid-template-columns: minmax(86px, 0.6fr) minmax(220px, 2.8fr) minmax(118px, 1fr) minmax(118px, 1fr);
  gap: 8px;
}

.score-strip div,
.records-panel,
dialog {
  border: 1px solid rgb(255 230 164 / 0.24);
  border-radius: 8px;
  background: rgb(2 10 10 / 0.42);
}

.score-strip div {
  display: grid;
  gap: 2px;
  min-height: 42px;
  padding: 7px 10px;
}

.score-strip strong {
  font-size: clamp(1.1rem, 2.4vw, 1.65rem);
}

.scoreboard-tile {
  min-width: 0;
}

.scoreboard-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 5px;
}

.score-seat {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 3px 6px;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid rgb(255 230 164 / 0.16);
  border-radius: 6px;
  background: rgb(255 255 255 / 0.05);
}

.score-seat.is-player {
  border-color: rgb(147 255 172 / 0.45);
}

.score-seat span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-seat strong {
  font-size: 1.05rem;
}

.score-seat em {
  grid-column: 1 / -1;
  color: rgb(248 237 207 / 0.68);
  font-size: 0.68rem;
  font-style: normal;
}

.table-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(290px, 0.9fr) minmax(430px, 1.35fr) minmax(300px, 1fr);
  align-items: stretch;
  gap: 10px;
  min-height: 0;
  isolation: isolate;
}

.table-grid::before {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: -1;
  width: min(52vw, 560px);
  aspect-ratio: 1920 / 819;
  content: "";
  background: url("./assets/high-card-duel-titlemark-v2.png") center / contain no-repeat;
  opacity: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.pile-area,
.duel-zone,
.hand-panel,
.records-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.pile-area {
  align-content: center;
  justify-content: center;
  flex-wrap: nowrap;
}

.duel-panel .buzz-zone {
  min-inline-size: 112px;
  min-block-size: 92px;
  padding: 8px;
}

.duel-panel .buzz-card {
  inline-size: clamp(58px, 6.6vw, 86px);
}

.duel-zone {
  justify-content: space-between;
  padding: 10px;
  border-radius: 8px;
  background: rgb(0 0 0 / 0.2);
}

.table-showdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  align-items: start;
  flex: 1 1 260px;
  gap: 8px;
  min-width: 0;
}

.duel-card {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-width: 0;
}

.showdown-seat {
  padding: 5px;
  border: 1px solid rgb(255 230 164 / 0.12);
  border-radius: 8px;
  background: rgb(255 255 255 / 0.04);
}

.showdown-seat.is-player {
  border-color: rgb(147 255 172 / 0.32);
}

.showdown-seat.is-winner {
  border-color: rgb(241 210 126 / 0.72);
  box-shadow: 0 0 18px rgb(241 210 126 / 0.16);
}

.showdown-seat p {
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duel-result {
  display: grid;
  gap: 6px;
  flex: 0 0 min(100%, 230px);
  width: min(100%, 230px);
  padding: 10px;
  text-align: center;
}

.duel-result strong {
  font-size: clamp(1.05rem, 2.2vw, 1.45rem);
}

.duel-result span {
  color: rgb(248 237 207 / 0.78);
  font-size: 0.92rem;
}

.score-flash {
  justify-self: center;
  min-width: 86px;
  padding: 5px 10px;
  border: 1px solid rgb(255 230 164 / 0.36);
  border-radius: 999px;
  background: rgb(0 0 0 / 0.32);
  color: #f8edcf;
  font-size: 1rem;
  font-weight: 950;
  animation: score-pop 520ms ease-out;
}

.score-flash[data-tone="gain"] {
  border-color: rgb(170 255 194 / 0.5);
  color: #bcffd0;
}

.score-flash[data-tone="loss"] {
  border-color: rgb(255 162 132 / 0.52);
  color: #ffb299;
}

.last-hand-line {
  display: block;
  padding-top: 4px;
  border-top: 1px solid rgb(255 230 164 / 0.16);
  color: rgb(248 237 207 / 0.86);
  font-weight: 800;
}

.round-history-button {
  justify-self: center;
  min-width: 142px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid rgb(255 230 164 / 0.42);
  border-radius: 8px;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.12), rgb(255 255 255 / 0.05));
  color: #fff8df;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.1),
    0 10px 26px rgb(0 0 0 / 0.24);
  font-size: 0.88rem;
  font-weight: 950;
  line-height: 1;
}

.room-end-actions {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgb(255 230 164 / 0.18);
}

.room-end-actions[hidden] {
  display: none;
}

.room-end-actions span {
  color: rgb(248 237 207 / 0.84);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.18;
}

.room-end-actions div {
  display: grid;
  grid-template-columns: repeat(2, minmax(112px, 1fr));
  justify-content: center;
  gap: 8px;
  width: min(100%, 300px);
}

.room-end-actions button {
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid rgb(255 230 164 / 0.42);
  border-radius: 8px;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.13), rgb(255 255 255 / 0.06));
  color: #fff8df;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.11),
    0 10px 26px rgb(0 0 0 / 0.24);
  font-size: 0.88rem;
  font-weight: 950;
  line-height: 1;
}

.room-end-actions button[data-room-play-again] {
  border-color: rgb(255 230 164 / 0.66);
  background: linear-gradient(180deg, #ffe18a, #d8a945);
  color: #151108;
}

.room-end-actions button[data-room-quit-game]:last-child {
  grid-column: 1 / -1;
}

.round-history-body {
  display: grid;
  gap: 12px;
}

.round-history-summary {
  padding: 10px;
  border: 1px solid rgb(255 230 164 / 0.2);
  border-radius: 8px;
  background: rgb(0 0 0 / 0.24);
}

.round-history-summary p {
  margin: 0;
}

.ranked-results-list {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.ranked-results-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid rgb(255 230 164 / 0.18);
  border-radius: 8px;
  background: rgb(255 255 255 / 0.04);
}

.ranked-results-list li.is-player {
  border-color: rgb(147 255 172 / 0.42);
}

.ranked-results-list em {
  color: rgb(248 237 207 / 0.68);
  font-style: normal;
}

.record-variant-list {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.record-variant-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  padding: 6px 8px;
  border: 1px solid rgb(255 230 164 / 0.14);
  border-radius: 8px;
  background: rgb(255 255 255 / 0.04);
}

.record-variant-list em {
  grid-column: 1 / -1;
  color: rgb(248 237 207 / 0.68);
  font-style: normal;
}

.ranked-record-stats {
  display: grid;
  gap: 6px;
  margin: 8px 0;
}

.ranked-record-stats div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 8px;
  align-items: start;
}

.ranked-record-stats dt,
.ranked-record-stats dd {
  margin: 0;
}

.round-history-list {
  display: grid;
  gap: 8px;
  max-height: min(52vh, 480px);
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.round-history-list li {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgb(255 230 164 / 0.18);
  border-radius: 8px;
  background: rgb(2 10 10 / 0.36);
}

.round-history-list strong,
.round-history-list em {
  color: #f8edcf;
}

.hand-panel {
  display: grid;
  align-content: center;
  gap: 10px;
}

.hand-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hand {
  display: grid;
  grid-template-columns: repeat(3, minmax(74px, 92px));
  justify-content: end;
  gap: 8px;
}

.hand .buzz-card {
  width: min(100%, 92px);
}

.card-button {
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
}

.card-button--selected {
  cursor: pointer;
}

.card-button--selected span {
  display: block;
  margin-top: 6px;
  color: #fff6cf;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.card-button:focus-visible,
.buzz-footer button:focus-visible,
.buzz-footer a:focus-visible,
.hero-copy a:focus-visible,
.hero-copy button:focus-visible,
.hand-head button:focus-visible,
dialog button:focus-visible {
  outline: 3px solid #f1d27e;
  outline-offset: 3px;
}

.card-button:disabled {
  cursor: default;
  opacity: 0.72;
}

.records-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(220px, 0.82fr);
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
}

body.is-landing .landing-records {
  display: none;
}

.play-toolbar {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.play-home-link {
  display: inline-grid;
  width: 36px;
  min-width: 36px;
  height: 36px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
}

.play-home-link img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.play-toolbar > * {
  flex: 0 0 auto;
}

.play-toolbar button {
  min-height: 36px;
  padding: 5px 9px;
}

.hero-utilities .sound-toggle,
.hero-utilities .rules-button,
.play-toolbar .sound-toggle,
.play-toolbar .rules-button {
  width: 36px;
  min-width: 36px;
  padding: 0;
  border-radius: 50%;
}

.play-toolbar .sound-toggle,
.play-toolbar .music-toggle,
.play-toolbar .rules-button {
  border: 0;
  background: linear-gradient(180deg, #ffe9a9, #f0bd43);
  color: #2c1b00;
}

.sound-toggle,
.music-toggle {
  font-size: 1.1rem;
}

.music-toggle,
#landingMusicSettingsButton,
#musicSettingsButton {
  color: #f7c957;
}

.table-talk-panel {
  display: block;
  margin-block: 10px;
  padding: 10px 12px;
  border: 1px solid rgb(255 230 164 / 0.24);
  border-radius: 8px;
  background: rgb(0 0 0 / 0.18);
}

.room-table-talk {
  display: grid;
  gap: 8px;
}

.room-table-talk > strong {
  color: #f1d27e;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.room-table-talk ol {
  display: grid;
  gap: 4px;
  max-height: 120px;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.room-table-talk li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f8edcf;
  font-size: 0.84rem;
}

.room-table-talk li span:first-child {
  min-width: 5.5rem;
  color: #f1d27e;
  font-weight: 800;
}

.room-table-talk li p { margin: 0; }

.quick-phrases {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-phrases button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 3px;
  border: 1px solid rgb(255 230 164 / 0.3);
  border-radius: 8px;
  background: rgb(255 255 255 / 0.08);
}

.table-talk-icon {
  display: inline-block;
  width: 27px;
  height: 27px;
  border-radius: 6px;
  background-image: url("./assets/table-talk-icons-v1.webp");
  background-repeat: no-repeat;
  background-size: 300% 200%;
  background-position: 100% 100%;
}

[data-room-icon="turn"] { background-position: 0 0; }
[data-room-icon="strength"] { background-position: 50% 0; }
[data-room-icon="target"] { background-position: 100% 0; }
[data-room-icon="clap"] { background-position: 0 100%; }
[data-room-icon="shake"] { background-position: 50% 100%; }

.room-chat-form {
  display: flex;
  gap: 8px;
}

.room-chat-form input { flex: 1; min-width: 0; }

.music-settings-form {
  display: grid;
  gap: 12px;
  margin-block: 12px;
}

.music-settings-form label {
  display: grid;
  gap: 5px;
  color: #665b4a;
  font-weight: 800;
}

.records-panel h2 {
  font-size: 1.25rem;
  line-height: 1;
}

.records-list {
  gap: 8px;
}

.record-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 27px;
  padding: 4px 8px;
  border: 1px solid rgb(255 230 164 / 0.26);
  border-radius: 999px;
  background: rgb(0 0 0 / 0.26);
  color: #f8edcf;
  font-size: 0.9rem;
  font-weight: 800;
}

.play-trail {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.play-trail span {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 7px;
  border: 1px solid rgb(255 230 164 / 0.2);
  border-radius: 999px;
  background: rgb(0 0 0 / 0.2);
  color: rgb(248 237 207 / 0.82);
  font-size: 0.78rem;
  font-weight: 800;
}

.play-trail .play-trail__label {
  color: #f1d27e;
  text-transform: uppercase;
}

.buzz-footer {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0 auto 6px;
  padding: 4px 8px;
}

.buzz-footer__mark {
  flex: 0 0 auto;
}

.buzz-footer__mark img {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.buzz-footer__body {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.buzz-footer p {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.2;
}

.buzz-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.buzz-footer a,
.buzz-footer button,
.hero-copy a,
.hero-copy button,
.play-toolbar button,
.hand-head button,
.room-button,
dialog button {
  min-height: 40px;
  padding: 6px 9px;
  border: 1px solid rgb(255 230 164 / 0.34);
  border-radius: 8px;
  background: rgb(255 255 255 / 0.09);
  color: #fff8df;
  line-height: 1;
  font-weight: 900;
  text-decoration: none;
}

.hero-copy .hero-home-link,
.buzz-footer .buzz-footer__mark {
  display: inline-grid;
  flex: 0 0 38px;
  place-items: center;
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
}

.hero-copy .hero-home-link {
  border: 0;
  background: transparent;
}

.buzz-footer .buzz-footer__mark {
  border: 0;
  background: transparent;
}

.hero-landing-actions {
  display: grid;
  justify-self: center;
  width: min(100%, 960px);
  margin-inline: auto;
  gap: 8px;
}

.mode-picker,
.opponent-picker,
.cpu-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.mode-description {
  min-height: 2.4em;
  color: rgb(248 237 207 / 0.82);
  font-size: 0.94rem;
  line-height: 1.32;
  text-wrap: pretty;
}

.mode-picker button,
.opponent-picker button,
.cpu-picker button {
  min-height: 34px;
  padding: 6px 9px;
  background: rgb(2 10 10 / 0.42);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-picker button.is-active,
.opponent-picker button.is-active,
.cpu-picker button.is-active {
  background: #f1d27e;
  color: #17120d;
}

.hero-landing-actions .start-duel-button {
  width: 100%;
  min-height: 48px;
  border-color: rgb(204 255 215 / 0.9);
  background: linear-gradient(180deg, #93ffac, #1fb45f 70%, #0d843f);
  color: #04140c;
  box-shadow: 0 14px 32px rgb(0 0 0 / 0.42), inset 0 1px 0 rgb(255 255 255 / 0.55);
  font-size: 1.08rem;
  opacity: 1;
}

.opponent-roster-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 230, 164, 0.24);
  border-radius: 8px;
  background: rgba(0, 18, 16, 0.5);
}

.opponent-roster-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  grid-column: 1 / -1;
  color: #f7c957;
  text-transform: uppercase;
  font-weight: 900;
}

.opponent-roster-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.opponent-roster-summary .opponent-avatar {
  flex: 0 0 auto;
}

.opponent-avatar {
  display: inline-block;
  width: 42px;
  height: 42px;
  border: 2px solid #f1d27e;
  border-radius: 50%;
  background-color: #19493f;
  background-image: var(--avatar-image);
  background-position: var(--avatar-position);
  background-size: 400% 500%;
  background-repeat: no-repeat;
  box-shadow: 0 6px 14px rgb(0 0 0 / 0.24);
}

.opponent-avatar--tiny {
  width: 30px;
  height: 30px;
}

.opponent-avatar--medium {
  width: 56px;
  height: 56px;
}

.opponent-dialog-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.opponent-choice {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 74px;
  padding: 10px;
  border: 1px solid rgb(255 230 164 / 0.24);
  border-radius: 8px;
  background: rgb(2 10 10 / 0.42);
}

.opponent-choice.is-active {
  border-color: rgb(255 230 164 / 0.72);
  background: rgb(241 210 126 / 0.16);
}

.opponent-choice input {
  accent-color: #f1d27e;
}

.opponent-choice span:last-child {
  display: grid;
  gap: 3px;
}

.opponent-choice small {
  color: rgb(248 237 207 / 0.72);
}

.opponent-roster-panel p {
  margin: 0;
  align-self: center;
}

.opponent-roster-button {
  justify-self: end;
  min-height: 38px;
  padding-inline: 16px;
  border-color: rgb(255 230 164 / 0.5);
  background: linear-gradient(180deg, #ffe498, #f2c34c);
  color: #17120d;
}

.cpu-roster-select {
  display: grid;
  gap: 3px;
  color: #f7c957;
  font-weight: 900;
}

.cpu-roster-select select {
  min-height: 34px;
}

body.is-playing .hero-utilities > :is(.sound-toggle, .music-toggle, .rules-button[aria-label*="Music"]) {
  display: none;
}

.landing-secondary-actions {
  display: grid;
  gap: 8px;
}

.landing-secondary-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.landing-secondary-actions a {
  display: inline-grid;
  place-items: center;
  text-align: center;
}

.setup-label {
  justify-self: start;
  color: #f1d27e;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rules-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  padding-inline: 0;
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
}

.room-button {
  position: absolute;
  right: clamp(4px, 1vw, 12px);
  bottom: clamp(4px, 1vw, 12px);
  z-index: 2;
  min-width: 122px;
  box-shadow: 0 10px 26px rgb(0 0 0 / 0.38);
}

.account-button {
  min-width: 0;
  max-width: 168px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-banner {
  min-height: 38px;
  padding: 6px 12px;
  border: 1px solid rgba(247, 201, 87, 0.7);
  border-radius: 8px;
  background: #f7c957;
  color: #17120d;
  font-weight: 900;
}

body.has-room .hero-copy {
  min-height: clamp(170px, 25vh, 240px);
}

body.is-playing .hero-copy {
  display: none;
}

body.has-room .hero-title-lane {
  min-height: clamp(118px, 18vh, 168px);
}

body.is-playing .hero-title-lane {
  position: absolute;
  inset: 0;
  min-height: 0;
  opacity: 0;
  pointer-events: none;
}

body.has-room .hero-copy .game-titlemark {
  width: min(100%, 470px);
  max-height: none;
}

body.is-playing .hero-copy .game-titlemark {
  width: min(100%, 300px);
  max-height: none;
}

body.has-room .hero-landing-actions {
  display: none;
}

body.is-playing .hero-landing-actions {
  display: none;
}

body.is-playing .hero-copy > img {
  opacity: 0.42;
}

body.is-landing .play-layer {
  display: none;
}

body.is-playing .landing-records {
  display: none;
}

body.is-playing .table-grid::before {
  opacity: 0.1;
}

body.is-landing .hero-copy {
  min-height: min(68vh, 560px);
}

body.is-landing .hero-title-lane {
  min-height: clamp(190px, 35vh, 330px);
}

dialog {
  max-width: min(92vw, 500px);
  max-height: min(78vh, 620px);
  overflow: auto;
  padding: 22px;
  background:
    linear-gradient(180deg, rgb(3 18 16 / 0.98), rgb(1 8 8 / 0.98)),
    #020c0b;
  box-shadow: 0 24px 80px rgb(0 0 0 / 0.62);
  color: #f8edcf;
}

dialog ol {
  display: grid;
  gap: 8px;
  padding-left: 22px;
}

.rules-preferences {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid rgb(255 230 164 / 0.18);
  margin-top: 12px;
  padding-top: 12px;
}

.rules-preferences button {
  min-height: 38px;
  border-color: rgb(255 230 164 / 0.28);
  background: rgb(255 255 255 / 0.07);
  color: #fff8df;
  font-size: 0.84rem;
}

.wide-dialog {
  max-width: min(96vw, 1120px);
}

.records-dialog-body {
  display: grid;
  gap: 16px;
  margin-block: 14px;
}

.record-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.record-tabs button {
  min-width: 106px;
  padding: 8px 12px;
  border: 1px solid rgb(255 230 164 / 0.3);
  border-radius: 8px;
  background: rgb(2 10 10 / 0.42);
  color: #f8edcf;
  font-weight: 900;
}

.record-tabs button.is-active {
  background: #f1d27e;
  color: #17120d;
}

.record-tab-panel {
  display: grid;
  gap: 16px;
}

.room-dialog-body {
  display: grid;
  gap: 10px;
  margin-block: 10px;
}

.room-live-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(280px, 1.1fr);
  gap: 10px;
}

.room-dialog-body form:not(.room-setup-card),
.room-actions,
.room-link-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 8px;
}

/* Room forms own one layout; the setup cards own the inner grid. */
.room-dialog-body form.room-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.room-dialog-body form.room-form > * {
  grid-column: 1;
  min-width: 0;
}

.room-form h3 {
  margin: 0;
  color: #fff8df;
  font-size: clamp(1.2rem, 2.2vw, 1.8rem);
}

.room-form .room-setup-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

.room-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  margin: 0;
  border: 1px solid rgb(255 230 164 / 0.24);
  border-radius: 8px;
  padding: 12px;
  background: rgb(0 0 0 / 0.24);
}

.room-card legend {
  grid-column: 1 / -1;
  padding: 0 4px;
  color: #f1d27e;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.room-card label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #fff8df;
  font-weight: 850;
}

.room-card label span,
.room-card label em,
.room-card small,
.room-policy-trigger-row,
.room-password small {
  color: rgb(248 237 207 / 0.78);
  line-height: 1.3;
}

.room-card label em {
  grid-column: 2;
  font-size: 0.78rem;
  font-style: italic;
  font-weight: 650;
}

.room-card input[type="radio"],
.room-card input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  accent-color: #f1c451;
}

.room-card--summary {
  align-content: center;
  gap: 4px;
}

.room-card--summary span {
  color: rgb(248 237 207 / 0.62);
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.room-card--summary strong {
  color: #fff8df;
  font-size: 1.1rem;
}

.room-card--summary small {
  grid-column: 1 / -1;
}

.room-card--spectators,
.room-card--music {
  grid-column: 1 / -1;
}

.room-card--music {
  grid-template-columns: minmax(0, 1fr);
}

.room-select-label,
.room-password {
  display: grid;
  gap: 6px;
  color: #f1d27e;
  font-weight: 900;
}

.room-select-label select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid rgb(255 230 164 / 0.34);
  border-radius: 8px;
  padding: 8px 10px;
  color: #fff8df;
  background: rgb(0 0 0 / 0.3);
  font: inherit;
  font-weight: 800;
}

.room-form > .room-password {
  grid-template-columns: minmax(130px, max-content) minmax(0, 1fr);
  align-items: center;
}

.room-form > .room-password small {
  grid-column: 2;
}

.room-form > .dialog-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.room-policy-trigger-row {
  display: block;
  padding: 2px 0;
}

.room-setup-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.room-setup-grid--join-only {
  grid-template-columns: minmax(260px, 420px);
}

.room-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.room-choice-grid--join {
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
}

.room-make-card {
  gap: 10px;
}

.room-make-card {
  grid-template-columns: minmax(190px, 0.55fr) minmax(420px, 1.35fr) minmax(240px, 0.72fr);
  align-items: stretch;
}

.room-make-card h3 {
  grid-column: 1;
  margin-block-start: 4px;
}

.room-make-card .room-option-columns {
  grid-column: 2;
}

.room-make-card .room-make-note {
  grid-column: 2 / 4;
}

.room-make-card .room-actions {
  grid-column: 3;
  grid-row: 1 / 3;
  align-self: stretch;
}

.room-make-card .room-actions button {
  min-height: 100%;
}

@media (max-width: 1100px) {
  .room-make-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .room-make-card h3,
  .room-make-card .room-option-columns,
  .room-make-card .room-password-row,
  .room-make-card .room-make-note,
  .room-make-card .room-actions {
    grid-column: auto;
    grid-row: auto;
  }

  .room-make-card h3 {
    grid-column: 1 / -1;
  }

  .room-make-card .room-actions button {
    min-height: 64px;
  }
}

.room-option-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.private-code-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(132px, max-content);
  align-items: stretch;
  gap: 8px;
}

.room-dialog-body .private-code-row input {
  min-height: 44px;
}

.private-code-row button {
  min-width: 132px;
  white-space: nowrap;
}

.room-setup-card,
.room-current-card {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgb(255 230 164 / 0.22);
  border-radius: 8px;
  background: rgb(0 0 0 / 0.22);
}

.room-current-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.room-current-card__head span {
  color: #f1d27e;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.room-setup-card h3,
.room-current-card h3 {
  margin: 0;
}

.room-setup-card h3 {
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.room-current-card h3 {
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
}

.room-current-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

.room-current-card dl div {
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid rgb(255 230 164 / 0.18);
  border-radius: 8px;
  background: rgb(2 10 10 / 0.28);
}

.room-current-card dt {
  color: rgb(248 237 207 / 0.62);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.room-current-card dd {
  margin: 0;
  font-weight: 900;
}

.room-setup-card p {
  margin: 0;
  color: rgb(248 237 207 / 0.78);
  font-size: 0.84rem;
  line-height: 1.22;
}

.room-mode-picker {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.room-mode-picker legend {
  color: rgb(248 237 207 / 0.68);
  font-size: 0.75rem;
  font-weight: 950;
  text-transform: uppercase;
}

.room-mode-picker label {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 5px 7px;
  border: 1px solid rgb(255 230 164 / 0.22);
  border-radius: 8px;
  background: rgb(2 10 10 / 0.34);
  font-weight: 900;
}

.room-mode-picker label:has(input:checked) {
  border-color: rgb(241 210 126 / 0.72);
  background: rgb(241 210 126 / 0.12);
  color: #fff6dd;
  box-shadow:
    inset 0 0 0 1px rgb(255 244 198 / 0.12),
    0 8px 18px rgb(0 0 0 / 0.22);
}

.room-mode-picker label::before {
  box-sizing: border-box;
  display: block;
  grid-column: 1;
  width: 18px;
  height: 18px;
  border: 2px solid rgb(248 237 207 / 0.58);
  border-radius: 50%;
  background: rgb(2 10 10 / 0.56);
  content: "";
  box-shadow: inset 0 0 0 2px rgb(2 10 10 / 0.82);
}

.room-mode-picker label:has(input:checked)::before {
  border-color: rgb(255 229 140 / 0.98);
  background:
    radial-gradient(circle, rgb(255 229 140 / 0.98) 0 42%, transparent 46%),
    linear-gradient(180deg, rgb(241 210 126 / 0.98), rgb(178 121 30 / 0.98));
  box-shadow:
    inset 0 0 0 2px rgb(2 10 10 / 0.78),
    0 0 12px rgb(241 210 126 / 0.42);
}

.room-mode-picker label:has(input:focus-visible) {
  outline: 2px solid rgb(255 244 198 / 0.82);
  outline-offset: 2px;
}

.room-mode-picker label span,
.room-mode-picker label em {
  position: relative;
  z-index: 0;
}

.room-mode-picker input[type="radio"] {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.room-mode-picker input[type="radio"]:disabled {
  cursor: not-allowed;
}

.room-mode-picker label.is-disabled {
  opacity: 0.58;
}

.room-mode-picker em {
  color: #f1d27e;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 950;
  text-transform: uppercase;
}

.room-invite-card {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgb(241 210 126 / 0.42);
  border-radius: 8px;
  background: linear-gradient(180deg, rgb(241 210 126 / 0.14), rgb(0 0 0 / 0.18));
}

.room-invite-card span {
  color: #f1d27e;
  font-size: 0.75rem;
  font-weight: 950;
  text-transform: uppercase;
}

.room-invite-card strong {
  font-size: clamp(1.8rem, 6vw, 2.7rem);
  letter-spacing: 0.08em;
  line-height: 0.95;
}

.room-invite-card p {
  margin: 0;
}

.room-invite-card input {
  width: 100%;
  box-sizing: border-box;
  text-transform: none;
}

.room-dialog-body input {
  min-height: 44px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgb(255 230 164 / 0.34);
  border-radius: 8px;
  background: rgb(0 0 0 / 0.24);
  color: #fff8df;
  font: inherit;
  font-size: max(1rem, 16px);
  font-weight: 800;
  padding: 9px 12px;
  text-transform: uppercase;
}

.room-dialog-body input[name="playerName"] {
  text-transform: none;
}

.room-dialog-body input[type="password"] {
  text-transform: none;
}

.room-password-row {
  display: grid;
  grid-template-columns: minmax(140px, max-content) minmax(180px, 1fr) minmax(190px, max-content);
  grid-column: 2 / 4;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.room-password-row span,
.room-password-row em {
  color: rgb(248 237 207 / 0.74);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 900;
}

.room-password-card form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, max-content) minmax(120px, max-content);
  gap: 8px;
  align-items: stretch;
}

.room-dialog-body button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.room-join-card form {
  display: grid;
  gap: 10px;
}

.room-join-card button,
.room-join-card input {
  touch-action: manipulation;
}

.room-dialog-body .room-invite-card input,
.room-dialog-body .room-link-card input {
  text-transform: none;
}

.room-note {
  margin: 0;
  color: rgb(248 237 207 / 0.78);
  font-size: 0.88rem;
  line-height: 1.25;
}

.room-note--status {
  color: #f1d27e;
  font-weight: 900;
}

.record-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.record-card,
.achievement-list li {
  border: 1px solid rgb(255 230 164 / 0.22);
  border-radius: 8px;
  background: rgb(0 0 0 / 0.22);
}

.record-card {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.record-card h3,
.achievement-list h3 {
  margin: 0;
}

.record-card p {
  margin: 0;
}

.record-card dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.record-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.record-card dt {
  color: rgb(248 237 207 / 0.68);
}

.record-card dd {
  margin: 0;
  font-weight: 900;
}

.achievement-list {
  display: grid;
  gap: 8px;
}

.achievement-list ul {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.achievement-list li {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(180px, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
}

.room-live-layout > .achievement-list {
  grid-column: auto;
}

.room-live-layout > .achievement-list ol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.room-live-layout > .achievement-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
}

.achievement-list li.is-locked {
  opacity: 0.72;
}

.achievement-list em {
  justify-self: end;
  color: #f1d27e;
  font-style: normal;
  font-weight: 900;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block: 12px;
}

dialog::backdrop {
  background: rgb(0 0 0 / 0.7);
}

@keyframes score-pop {
  0% {
    opacity: 0;
    transform: translateY(4px) scale(0.94);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 980px) {
  .game-shell {
    min-height: auto;
  }

  .table-grid {
    grid-template-columns: 1fr;
  }

  .pile-area,
  .duel-zone {
    justify-content: center;
  }

  .buzz-footer__body {
    grid-template-columns: 1fr;
  }

  .buzz-footer nav {
    justify-content: flex-start;
  }

  .room-setup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .room-option-columns {
    grid-template-columns: 1fr;
  }

  .room-password-row,
  .room-password-card form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .room-dialog-body form.room-make-card {
    grid-template-columns: 1fr;
  }

  .room-form .room-setup-grid {
    grid-template-columns: 1fr;
  }

  .room-form > .room-password {
    grid-template-columns: 1fr;
  }

  .room-form > .room-password small {
    grid-column: 1;
  }

  .hero-copy {
    grid-template-columns: 1fr;
    min-height: 286px;
    gap: 10px;
    padding: 12px;
  }

  .hero-topbar {
    align-items: center;
  }

  .hero-secondarybar {
    justify-content: stretch;
  }

  .hero-secondarybar > * {
    flex: 1 1 0;
  }

  .hero-secondarybar .daily-banner {
    margin-left: 0;
  }

  .hero-utilities {
    flex: 1 1 auto;
    min-width: 0;
    gap: 5px;
  }

  .hero-copy .hero-utilities button {
    display: inline-grid;
    place-items: center;
    min-height: 36px;
    padding: 5px 8px;
    font-size: 0.82rem;
    line-height: 1;
  }

  .hero-title-lane {
    min-height: 168px;
  }

  .hero-landing-actions {
    width: 100%;
  }

  .mode-picker,
  .mode-picker button,
  .opponent-picker,
  .opponent-picker button,
  .cpu-picker,
  .cpu-picker button {
    width: 100%;
  }

  .mode-picker,
  .opponent-picker,
  .cpu-picker {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mode-picker button,
  .opponent-picker button,
  .cpu-picker button {
    min-width: 0;
    padding-inline: 7px;
    font-size: clamp(0.78rem, 3.8vw, 0.96rem);
  }

  .rules-button {
    justify-self: end;
  }

  .hero-copy > div {
    max-width: 100%;
  }

  .hero-copy .game-titlemark {
    width: min(100%, 348px);
  }

  body.has-room .hero-copy {
    min-height: 224px;
  }

  body.is-playing .hero-copy {
    min-height: 0;
    padding: 8px 10px;
  }

  body.has-room .hero-title-lane {
    min-height: 138px;
  }

  body.is-playing .hero-title-lane {
    min-height: 0;
  }

  body.has-room .hero-copy .game-titlemark {
    width: min(100%, 320px);
  }

  h1 {
    max-width: 100%;
    font-size: clamp(2rem, 10vw, 2.65rem);
    line-height: 0.96;
    overflow-wrap: normal;
  }

  .score-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .records-panel {
    grid-template-columns: 1fr;
  }

  .play-trail {
    justify-content: flex-start;
  }

  .duel-zone {
    justify-content: center;
  }

  .duel-result {
    width: min(100%, 360px);
  }

  .round-history-button {
    width: min(100%, 220px);
    min-height: 46px;
    font-size: 0.94rem;
  }

  .room-end-actions {
    position: fixed;
    inset: auto max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    z-index: 30;
    width: auto;
    padding: 10px;
    border: 1px solid rgb(255 230 164 / 0.3);
    border-radius: 8px;
    background:
      linear-gradient(180deg, rgb(4 18 16 / 0.95), rgb(2 10 10 / 0.97)),
      #061412;
    box-shadow: 0 18px 42px rgb(0 0 0 / 0.46);
  }

  .room-end-actions div {
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    width: 100%;
  }

  .room-end-actions button {
    width: 100%;
    min-height: 46px;
    font-size: 0.92rem;
  }

  .room-end-actions button[data-room-quit-game]:last-child {
    grid-column: auto;
  }

  .hand {
    grid-template-columns: repeat(3, minmax(68px, 1fr));
  }

  .buzz-footer {
    align-items: center;
    justify-content: center;
  }

  .record-summary-grid,
  .room-setup-grid,
  .room-choice-grid,
  .room-option-columns,
  .room-live-layout,
  .achievement-list li {
    grid-template-columns: 1fr;
  }

  .room-make-card {
    grid-template-columns: 1fr;
  }

  .room-make-card h3,
  .room-make-card .room-option-columns,
  .room-make-card .room-password-row,
  .room-make-card .room-make-note,
  .room-make-card .room-actions {
    grid-column: 1;
    grid-row: auto;
  }

  .room-make-card .room-option-columns {
    grid-template-columns: 1fr;
  }

  .private-code-row {
    grid-template-columns: 1fr;
  }

  .room-password-row,
  .room-password-card form {
    grid-template-columns: 1fr;
  }

  dialog {
    padding: 14px;
  }

  .wide-dialog {
    max-width: min(96vw, 520px);
    max-height: 82vh;
  }

  .room-make-card .room-actions button {
    min-height: 54px;
  }

  .room-join-card form,
  .room-join-card .room-actions {
    grid-template-columns: 1fr;
  }

  .room-join-card input,
  .room-join-card button {
    min-height: 52px;
  }

  .room-current-card dl {
    grid-template-columns: 1fr;
  }

  .room-invite-card strong {
    font-size: clamp(1.7rem, 10vw, 2.35rem);
  }

  .room-live-layout > .achievement-list ol,
  .room-live-layout > .achievement-list li {
    grid-template-columns: 1fr;
  }

  .achievement-list em {
    justify-self: start;
  }
}

@media (max-height: 820px) and (min-width: 981px) {
  .game-shell {
    min-height: 0;
    padding-block: 2px;
  }

  .hero-copy {
    min-height: 214px;
    padding-block: 9px;
  }

  .hero-title-lane {
    min-height: 142px;
  }

  .hero-copy .game-titlemark {
    width: min(100%, 560px);
  }

  body.has-room .hero-copy {
    min-height: 154px;
  }

  body.is-playing .hero-copy {
    min-height: 0;
    padding: 6px 8px;
  }

  body.has-room .hero-title-lane {
    min-height: 104px;
  }

  body.is-playing .hero-title-lane {
    min-height: 0;
  }

  body.has-room .hero-copy .game-titlemark {
    width: min(100%, 390px);
  }

  .wide-dialog {
    max-height: 92vh;
    padding: 16px;
  }

  .room-dialog-body {
    gap: 8px;
    margin-block: 8px;
  }

  .room-setup-grid {
    gap: 8px;
  }

  .room-choice-grid,
  .room-choice-grid--join,
  .room-make-card,
  .room-option-columns {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .room-make-card h3,
  .room-make-card .room-option-columns,
  .room-make-card .room-password-row,
  .room-make-card .room-make-note,
  .room-make-card .room-actions {
    grid-column: 1;
    grid-row: auto;
  }

  .room-setup-card {
    gap: 5px;
    padding: 8px;
  }

  .room-setup-card p {
    font-size: 0.78rem;
    line-height: 1.15;
  }

  h1 {
    font-size: clamp(1.8rem, 3.8vw, 2.85rem);
  }

  .hero-copy p:not(.eyebrow) {
    max-width: 680px;
    font-size: 0.92rem;
    line-height: 1.25;
  }

  .pile-area .buzz-zone {
    min-block-size: 96px;
  }

  .duel-panel {
    gap: 8px;
    padding: 10px;
  }

  .buzz-footer {
    margin-bottom: 0;
    padding-block: 6px;
  }

  .buzz-footer__body {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .buzz-footer p {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .buzz-footer a,
  .buzz-footer button {
    min-height: 34px;
    padding: 5px 8px;
    font-size: 0.82rem;
  }

  .wide-dialog {
    max-height: 88vh;
  }

  .room-setup-card {
    gap: 6px;
    padding: 10px;
  }

  .room-setup-card p {
    font-size: 0.84rem;
  }

  .room-mode-picker label {
    min-height: 28px;
    padding-block: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

.buzz-footer[data-buzz-footer] {
  flex-direction: row;
  align-items: center;
  justify-content: center;
}

.buzz-footer--play {
  display: none;
}

body.is-playing .buzz-footer--global {
  display: none;
}

body.is-playing .buzz-footer--play {
  display: grid;
  justify-content: center;
  place-items: center;
  min-height: 54px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.is-playing .buzz-footer--play .buzz-footer__mark {
  width: 48px;
  height: 48px;
}

body.is-playing .buzz-footer--play .buzz-footer__mark img {
  width: 42px;
  height: 42px;
}

@media (max-width: 720px) {
  body.is-playing {
    overflow: hidden;
  }

  body.is-playing .game-shell {
    min-height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    padding: 8px;
  }

  body.is-playing .duel-panel {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 6px;
    max-height: calc(100dvh - 16px);
    overflow: hidden;
    padding: 10px;
  }

  body.is-playing .hero-copy {
    display: none;
  }

  body.is-playing .play-toolbar {
    overflow: hidden;
    padding: 3px;
  }

  body.is-playing .play-toolbar #roomButton,
  body.is-playing .play-toolbar #playAccountButton {
    display: none;
  }

  body.is-playing .play-toolbar .play-home-link {
    width: 32px;
    min-width: 32px;
    height: 32px;
  }

  body.is-playing .play-toolbar .play-home-link img {
    width: 32px;
    height: 32px;
  }

  body.is-playing .play-toolbar button {
    min-height: 32px;
    padding: 4px 7px;
    font-size: 0.76rem;
  }

  body.is-playing .score-strip {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.7fr) minmax(0, 0.9fr);
    gap: 5px;
  }

  body.is-playing .score-strip > :nth-child(3) {
    display: none;
  }

  body.is-playing .score-strip div {
    min-height: 44px;
    padding: 5px 6px;
  }

  body.is-playing .score-strip span {
    font-size: 0.6rem;
  }

  body.is-playing .score-strip strong,
  body.is-playing .scoreboard-list {
    font-size: 0.75rem;
    line-height: 1.05;
  }

  body.is-playing .scoreboard-list {
    display: grid;
    gap: 3px;
  }

  body.is-playing .scoreboard-list > span {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    white-space: nowrap;
  }

  body.is-playing .table-grid {
    display: grid;
    grid-template-columns: minmax(74px, 0.55fr) minmax(112px, 1fr) minmax(112px, 1fr);
    gap: 6px;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    padding: 6px;
  }

  body.is-playing .table-grid > *,
  body.is-playing .pile-area,
  body.is-playing .duel-zone,
  body.is-playing .hand-panel {
    min-width: 0;
  }

  body.is-playing .pile-area {
    align-content: center;
    justify-items: center;
    overflow: hidden;
  }

  body.is-playing #drawPile,
  body.is-playing #discardPile {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  body.is-playing .duel-zone {
    gap: 6px;
    min-height: 0;
  }

  body.is-playing .table-showdown {
    gap: 6px;
  }

  body.is-playing .duel-result {
    min-height: 0;
    padding: 7px;
  }

  body.is-playing .duel-result :is(#roundDetail, #lastHandLine, #scoreFlash) {
    display: none;
  }

  body.is-playing .hand-panel {
    min-height: 0;
    overflow: hidden;
  }

  body.is-playing .hand-head {
    gap: 4px;
  }

  body.is-playing .hand-head button {
    min-height: 30px;
    padding: 4px 6px;
    font-size: 0.7rem;
  }

  body.is-playing .hand {
    grid-template-columns: repeat(3, minmax(34px, 1fr));
    justify-content: stretch;
    gap: 4px;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    overflow: hidden;
  }

  body.is-playing .duel-panel .buzz-card {
    inline-size: clamp(34px, 11vw, 48px);
  }

  body.is-playing .duel-panel .buzz-zone {
    min-inline-size: 0;
    min-block-size: 72px;
    padding: 4px;
  }

  body.is-playing .buzz-footer--play {
    min-height: 42px;
  }

  body.is-playing .buzz-footer--play .buzz-footer__mark {
    width: 42px;
    height: 42px;
  }

  body.is-playing .buzz-footer--play .buzz-footer__mark img {
    width: 36px;
    height: 36px;
  }
}

/* Crazy Eights is the literal landing-page composition benchmark. */
.hero-copy > .hero-commandbar {
  min-height: 70px;
  padding: 8px 12px;
  border: 1px solid rgb(255 230 164 / 0.24);
  border-radius: 8px;
  background: rgb(3 18 16 / 0.82);
}

.hero-commandbar .hero-room-actions {
  display: flex;
  gap: 8px;
}

body.is-landing .hero-title-lane {
  width: 100%;
  min-height: clamp(230px, 34vh, 420px);
  margin-top: 4px;
  overflow: hidden;
  border: 1px solid rgb(255 226 148 / 0.34);
  border-radius: 8px;
  background: rgb(11 44 31 / 0.54);
}

.hero-landing-actions {
  width: 100%;
  padding: 14px;
  border: 1px solid rgb(255 230 164 / 0.2);
  border-radius: 8px;
  background: rgb(5 18 13 / 0.74);
}

.buzz-footer--landing {
  display: grid;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  place-items: center;
}

.buzz-footer--landing .buzz-footer__mark {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
}

.buzz-footer--landing .buzz-footer__mark img {
  width: 28px;
  height: 28px;
}

@media (max-width: 620px) {
  body.is-landing .hero-copy {
    min-height: calc(100dvh - 16px);
    padding: 12px;
  }

  .hero-copy > .hero-commandbar {
    display: grid;
    grid-template-columns: 28px 28px minmax(78px, 1fr) repeat(4, 28px);
    grid-template-rows: 34px 28px;
    grid-template-areas:
      "bee provenance account sound music settings help"
      "join join join join daily daily daily";
    gap: 4px;
    min-height: 70px;
    padding: 4px;
  }

  .hero-commandbar .hero-branding,
  .hero-commandbar .hero-room-actions,
  .hero-commandbar .hero-utilities {
    display: contents;
  }

  .hero-commandbar .hero-home-link { grid-area: bee; }
  .hero-commandbar .provenance-icon { grid-area: provenance; }
  .hero-commandbar #accountButton { grid-area: account; }
  .hero-commandbar #landingSoundButton { grid-area: sound; }
  .hero-commandbar #landingMusicButton { grid-area: music; }
  .hero-commandbar #landingMusicSettingsButton { grid-area: settings; }
  .hero-commandbar #howToPlayButton { grid-area: help; }
  .hero-commandbar #joinRoomButton { grid-area: join; }
  .hero-commandbar #dailyChallengeButton { grid-area: daily; }

  .hero-commandbar :is(.hero-home-link, .provenance-icon) {
    display: grid;
    width: 28px;
    min-width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
    place-items: center;
  }

  .hero-commandbar :is(.hero-home-link, .provenance-icon) img {
    width: 28px;
    height: 28px;
  }

  .hero-commandbar #accountButton {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 4px 8px;
  }

  .hero-copy .hero-commandbar .hero-utilities button {
    width: 28px;
    min-width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
  }

  .hero-commandbar :is(#joinRoomButton, #dailyChallengeButton) {
    width: 100%;
    min-width: 0;
    min-height: 28px;
    padding: 3px 5px;
  }

  body.is-landing .hero-title-lane {
    min-height: clamp(96px, 13vh, 116px);
  }

  .hero-copy .game-titlemark--landing {
    width: min(64vw, 300px);
    max-height: 94px;
  }

  .hero-landing-actions {
    gap: 10px;
    padding: 14px;
  }

  .hero-landing-actions .opponent-roster-panel {
    grid-template-columns: minmax(0, 1fr) minmax(132px, auto);
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
  }

  .hero-landing-actions .opponent-roster-panel > p {
    display: none;
  }

  .hero-landing-actions .opponent-roster-heading {
    grid-column: 1;
    grid-row: 1;
  }

  .hero-landing-actions .opponent-roster-heading > span {
    display: none;
  }

  .hero-landing-actions .opponent-roster-button {
    grid-column: 2;
    grid-row: 1;
    min-height: 44px;
    padding: 6px 10px;
  }
}
