:root {
  color-scheme: light;
  --ink: #1d1c20;
  --muted: #69626d;
  --paper: #fff8eb;
  --panel: rgba(255, 248, 235, 0.9);
  --felt: #145f4f;
  --felt-deep: #062b27;
  --gold: #f6b83a;
  --red: #b92835;
  --black: #171b25;
  --line: rgba(32, 33, 38, 0.16);
  --shadow: 0 22px 60px rgba(29, 18, 9, 0.24);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Daily state belongs in the shared header; keep the hero art clear like the family benchmark. */
.buzz-platform-landing .landing-table-notes {
  display: none !important;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 214, 105, 0.42), transparent 18rem),
    radial-gradient(circle at 86% 16%, rgba(20, 95, 79, 0.22), transparent 24rem),
    linear-gradient(135deg, #fff2d1 0%, #f9efe2 38%, #e8f0e8 100%);
}

button,
a {
  font: inherit;
}

button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.68rem 0.9rem;
  color: var(--ink);
  background: #fffdf8;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(32, 33, 38, 0.08);
}

button:hover,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(244, 184, 58, 0.48);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary-action {
  border-color: rgba(147, 255, 172, 0.52);
  color: #071c12;
  background: linear-gradient(180deg, #9cf4a7, #4fb86a);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.44);
  font-weight: 950;
}

.app-shell {
  width: min(1240px, calc(100% - 24px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 12px 0;
  overflow-x: clip;
}

.landing-screen,
.game-surface {
  position: relative;
  min-height: calc(100vh - 24px);
}

.landing-screen {
  display: block;
  min-height: calc(100vh - 24px);
}

.hero-copy {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  min-height: 0;
  align-content: start;
  color: #fffaf1;
}

.hero-art {
  position: relative;
  min-height: clamp(220px, 32vh, 420px);
  margin-top: 6px;
  overflow: hidden;
  border-radius: 8px;
}

.hero-art > .table-scene {
  position: absolute;
  inset: 0;
  min-height: 0;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(2, 12, 11, 0.26), rgba(2, 12, 11, 0.06) 42%, rgba(2, 12, 11, 0.34)),
    url("./assets/war-hero-table.webp") center / cover no-repeat;
}

.hero-art .war-landing-table-scene {
  min-height: 100%;
  border-width: 1px;
  border-color: rgba(255, 248, 235, 0.22);
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.08), transparent 36%);
  box-shadow: inset 0 0 70px rgba(0, 0, 0, 0.22);
}

.hero-topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 52px;
}

.hero-branding,
.hero-actions,
.landing-secondary-actions,
.mode-picker,
.play-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.hero-topbar,
.hero-branding,
.hero-actions {
  flex-wrap: nowrap;
}

.hero-secondarybar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 230, 164, 0.22);
  border-radius: 8px;
  background: rgba(2, 12, 10, 0.58);
}

.hero-secondarybar .daily-banner {
  margin-left: auto;
  border-color: rgba(247, 201, 87, 0.7);
  background: #f7c957;
  color: #17120d;
}

.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;
}

.landing-bee,
.bee-link,
.buzz-footer [data-buzz-home],
.play-footer__home,
.provenance-icon {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(122, 79, 0, 0.58);
  border-radius: 50%;
  color: #2c1b00;
  background: linear-gradient(180deg, #ffe9a9, #f0bd43);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.42);
  overflow: hidden;
}

.landing-bee {
  position: static;
}

.landing-bee img,
.bee-link img,
.buzz-footer img,
.play-footer img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.provenance-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rules-chip {
  position: static;
}

.icon-button,
.rules-button,
.sound-toggle {
  width: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 50%;
  font-weight: 900;
}

.rules-button,
.sound-toggle,
.music-settings-button {
  display: inline-grid;
  place-items: center;
}

.music-settings-button {
  min-width: 44px;
}

.sound-toggle[aria-pressed="false"] {
  opacity: 0.66;
}

.hero-actions > :is(.sound-toggle, .music-settings-button, .rules-button),
.top-actions > :is(.sound-toggle, .music-settings-button, .rules-button) {
  border-color: rgba(122, 79, 0, 0.58);
  color: #2c1b00;
  background: linear-gradient(180deg, #ffe9a9, #f0bd43);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.music-toggle {
  color: #7a4f00;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.game-titlemark {
  display: block;
  width: min(100%, 620px);
  height: auto;
  object-fit: contain;
}

.game-titlemark--landing {
  position: absolute;
  z-index: 3;
  top: 10%;
  right: 0;
  left: 0;
  width: min(62%, 720px);
  max-height: 58%;
  margin: 0 auto;
  filter: drop-shadow(0 18px 28px rgba(68, 38, 11, 0.2));
  pointer-events: none;
}

.game-titlemark--compact {
  width: clamp(156px, 22vw, 280px);
}

.landing-copy {
  padding-top: 0;
}

.landing-copy p,
.title-block p {
  margin: 0 0 0.35rem;
  color: #7a4f00;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.landing-copy h1,
.title-block h1 {
  margin: 0;
  line-height: 0.92;
  letter-spacing: 0;
}

.landing-copy h1 {
  font-size: clamp(5rem, 18vw, 10.5rem);
  text-shadow: 0 14px 32px rgba(68, 38, 11, 0.16);
}

.landing-copy span {
  display: block;
  width: min(28rem, 100%);
  margin-top: 1rem;
  color: #393b43;
  font-size: 1.2rem;
  line-height: 1.42;
}

.hero-copy > span {
  display: block;
  width: min(30rem, 100%);
  margin-top: 0.75rem;
  color: rgba(255, 250, 241, 0.86);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.38;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.landing-actions,
.top-actions,
.control-panel,
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.dialog-actions {
  margin-top: 0.85rem;
}

.landing-actions {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 8px;
  width: 100%;
  margin-top: 1rem;
  border: 1px solid rgba(255, 250, 241, 0.18);
  border-radius: 8px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(3, 20, 17, 0.76), rgba(3, 20, 17, 0.62));
  backdrop-filter: blur(3px);
}

.setup-label {
  width: 100%;
  margin: 0;
  color: #f8cf62;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.mode-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  gap: 8px;
}

.mode-picker button {
  min-height: 46px;
  border: 1px solid rgba(255, 250, 241, 0.28);
  color: #fffaf1;
  background: rgba(2, 20, 17, 0.56);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 241, 0.06);
  font-weight: 950;
  text-align: center;
}

.mode-picker button.is-active {
  border-color: rgba(122, 79, 0, 0.62);
  color: #211500;
  background: linear-gradient(180deg, #ffe498, #f2c34c);
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.opponent-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  gap: 8px;
}

.opponent-picker button {
  min-width: 0;
  min-height: 46px;
  border: 1px solid rgba(255, 250, 241, 0.28);
  color: #fffaf1;
  background: rgba(2, 20, 17, 0.56);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 241, 0.06);
  font-weight: 950;
  text-align: center;
}

.opponent-picker button.is-active {
  border-color: rgba(122, 79, 0, 0.62);
  color: #211500;
  background: linear-gradient(180deg, #ffe498, #f2c34c);
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.mode-description {
  margin: 0;
  color: rgba(255, 250, 241, 0.82);
  font-size: 0.88rem;
  line-height: 1.25;
}

.start-game-button {
  width: 100%;
  min-height: 50px;
  border-color: rgba(204, 255, 215, 0.9);
  color: #04140c;
  background: linear-gradient(180deg, #93ffac, #1fb45f 70%, #0d843f);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  font-size: 1rem;
}

.landing-secondary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 0.15rem;
}

.landing-secondary-actions button,
.landing-secondary-actions a,
.play-footer button {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 250, 241, 0.24);
  border-radius: 7px;
  color: #fffaf1;
  background: rgba(2, 20, 17, 0.48);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 241, 0.05);
  font-weight: 900;
  text-decoration: none;
}

.opponent-roster-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: center;
  width: 100%;
  border: 1px solid rgba(255, 250, 241, 0.22);
  border-radius: 8px;
  padding: 0.66rem;
  color: #fffaf1;
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.11), rgba(255, 250, 241, 0.055)),
    rgba(2, 20, 17, 0.46);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 241, 0.06);
}

.player-count-control {
  display: grid;
  grid-column: 1 / -1;
  gap: 0.25rem;
  color: #fffaf1;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.player-count-control select {
  min-height: 36px;
  border: 1px solid rgba(255, 250, 241, 0.3);
  border-radius: 7px;
  padding: 0.35rem 0.5rem;
  color: #211500;
  background: #fffaf1;
  font: inherit;
}

.multi-participant-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px solid rgba(255, 250, 241, 0.2);
  border-radius: 10px;
  background: rgba(2, 20, 17, 0.36);
}

.multi-participant {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255, 250, 241, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.08);
}

.multi-participant.is-you {
  border-color: #f2c34c;
  box-shadow: inset 0 0 0 1px rgba(242, 195, 76, 0.35);
}

.multi-participant.is-out { opacity: 0.52; }

.multi-participant__heading {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  color: #fffaf1;
  font-size: 0.78rem;
}

.multi-participant__heading span { color: #f2c34c; }

.multi-participant__card {
  display: grid;
  place-items: center;
  min-height: 100px;
  margin-top: 6px;
}

.opponent-roster-summary {
  display: flex;
  min-width: 0;
  gap: 9px;
  align-items: center;
  font-weight: 950;
}

.opponent-roster-summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opponent-roster-panel button {
  min-height: 38px;
  border: 1px solid rgba(122, 79, 0, 0.58);
  color: #211500;
  background: linear-gradient(180deg, #ffe498, #f2c34c);
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.36);
  font-weight: 950;
}

.opponent-roster-panel p {
  grid-column: 1 / -1;
  margin: 0;
  color: #f8efd7;
  font-size: 0.86rem;
  font-weight: 760;
  line-height: 1.32;
}

.opponent-avatar {
  display: inline-block;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255, 228, 152, 0.86);
  border-radius: 999px;
  background-color: #19493f;
  background-image: var(--avatar-image);
  background-position: var(--avatar-position);
  background-size: 400% 500%;
  background-repeat: no-repeat;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.22);
  vertical-align: middle;
}

.opponent-avatar--tiny {
  width: 34px;
  height: 34px;
}

.opponent-avatar--medium {
  width: 54px;
  height: 54px;
}

.wide-dialog {
  width: min(780px, calc(100% - 24px));
}

.dialog-intro {
  max-width: 64ch;
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 720;
  line-height: 1.42;
}

.opponent-dialog .dialog-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.opponent-choice {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 76px;
  border: 1px solid rgba(70, 63, 51, 0.18);
  border-radius: 8px;
  padding: 0.62rem;
  background: #fffdf8;
  color: var(--ink);
  cursor: pointer;
}

.opponent-choice.is-active {
  border-color: rgba(122, 79, 0, 0.62);
  background: linear-gradient(180deg, #fff2c6, #f7d36c);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.46);
}

.opponent-choice input {
  width: 17px;
  height: 17px;
  accent-color: #b78612;
}

.opponent-choice span {
  display: grid;
  min-width: 0;
  gap: 0.2rem;
}

.opponent-choice strong {
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.18;
}

.opponent-choice strong,
.opponent-choice small {
  overflow-wrap: anywhere;
}

.opponent-choice small {
  color: inherit;
  opacity: 0.74;
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.76rem;
  font-weight: 720;
  line-height: 1.28;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.opponent-dialog[open] {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.opponent-dialog .dialog-body {
  max-height: min(64vh, 620px);
}

#roomDialog {
  width: min(980px, calc(100% - 22px));
  max-height: min(94vh, 860px);
}

.table-scene {
  position: relative;
  min-height: 0;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  padding: clamp(14px, 2.5vw, 26px);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.18), transparent 30%),
    radial-gradient(circle at 70% 16%, rgba(255, 214, 105, 0.22), transparent 19rem),
    linear-gradient(135deg, #704530, #281b18 68%);
  box-shadow: 0 32px 80px rgba(34, 17, 8, 0.36);
  isolation: isolate;
}

.table-scene::before,
.table-scene::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.table-scene::before {
  inset: 16px;
  border: 1px solid rgba(255, 248, 235, 0.22);
  border-radius: 8px;
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.25);
}

.table-scene::after {
  inset: auto 8% 6% 8%;
  height: 24%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.28), transparent 68%);
  filter: blur(16px);
  z-index: -1;
}

.table-glow {
  position: absolute;
  inset: -20% -10% auto auto;
  width: 58%;
  height: 58%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 210, 102, 0.4), transparent 64%);
  filter: blur(6px);
}

.war-landing-table-scene {
  position: relative;
  display: grid;
  min-height: min(540px, calc(100vh - 120px));
  place-items: center;
  overflow: hidden;
  border: 14px solid rgba(255, 248, 235, 0.2);
  border-radius: 999px;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.13), transparent 34%),
    var(--buzz-classic-table),
    radial-gradient(circle at center, #21856d 0%, var(--felt) 42%, var(--felt-deep) 100%);
  background-size: auto, 420px, auto;
  box-shadow:
    inset 0 0 48px rgba(255, 255, 255, 0.16),
    inset 0 -42px 80px rgba(0, 0, 0, 0.2);
}

.hero-table-rail {
  position: absolute;
  inset: 7%;
  border: 1px solid rgba(255, 248, 235, 0.16);
  border-radius: 999px;
}

.hero-table-orbit {
  position: absolute;
  width: 72%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px dashed rgba(255, 248, 235, 0.17);
}

.hero-player {
  position: absolute;
  display: flex;
  gap: 12px;
  align-items: center;
  color: #fff8eb;
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  z-index: 6;
}

.hero-player > span {
  position: relative;
  z-index: 8;
  padding: 0.28rem 0.48rem;
  border: 1px solid rgba(255, 248, 235, 0.16);
  border-radius: 8px;
  background: rgba(4, 22, 20, 0.52);
  backdrop-filter: blur(5px);
}

.hero-player--opponent {
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
}

.hero-player--player {
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
}

.hero-battle-fan {
  position: relative;
  width: min(460px, 72%);
  height: min(330px, 58vw);
}

.hero-battle-zone {
  display: grid;
  width: min(520px, 78%);
  place-items: center;
}

.hero-battle-zone .buzz-zone {
  width: 100%;
  min-height: min(350px, 62vw);
  background-color: rgba(255, 248, 235, 0.08);
  box-shadow:
    inset 0 0 42px rgba(0, 0, 0, 0.2),
    0 24px 44px rgba(0, 0, 0, 0.12);
}

.hero-battle-zone .hero-battle-fan {
  width: 100%;
}

.hero-card {
  position: absolute;
  filter: drop-shadow(0 22px 22px rgba(0, 0, 0, 0.25));
}

.hero-card .buzz-card {
  width: clamp(82px, 11vw, 122px);
}

.hero-card--tie-a {
  left: 18%;
  top: 26%;
  transform: rotate(-11deg);
}

.hero-card--tie-b {
  right: 18%;
  top: 26%;
  transform: rotate(9deg);
}

.hero-card--win {
  left: 40%;
  top: 2%;
  transform: rotate(3deg);
}

.hero-card--miss {
  left: 38%;
  bottom: 2%;
  transform: rotate(-4deg);
}

.war-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  width: 118px;
  height: 118px;
  place-items: center;
  transform: translate(-50%, -50%) rotate(-8deg);
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff7cd 0 28%, transparent 29%),
    conic-gradient(from 0deg, #f7d94b, #f08f29, #f7d94b, #fff0a3, #f7d94b);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.27);
}

.war-burst span {
  padding: 0.4rem 0.62rem;
  border: 2px solid #2b1b11;
  border-radius: 8px;
  color: #251409;
  background: var(--gold);
  font-weight: 900;
}

.hero-spoils {
  position: absolute;
  right: 8%;
  bottom: 20%;
}

.hero-rack {
  position: absolute;
  left: 9%;
  bottom: 17%;
  width: min(240px, 36%);
}

.hero-rack .buzz-rack {
  display: flex;
  justify-content: center;
  min-height: 92px;
  padding: 12px;
}

.hero-rack .buzz-card {
  width: 58px;
  margin-left: -22px;
}

.hero-rack .buzz-card:first-child {
  margin-left: 0;
}

.landing-table-notes {
  position: absolute;
  right: 22px;
  bottom: 18px;
  display: grid;
  gap: 2px;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(255, 248, 235, 0.24);
  border-radius: 8px;
  color: #fff8eb;
  background: rgba(16, 18, 20, 0.32);
  backdrop-filter: blur(8px);
}

.landing-table-notes span {
  color: #f8cf62;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.game-surface {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
  gap: 8px;
  min-height: calc(100vh - 24px);
  overflow: hidden;
  border: 1px solid rgba(255, 230, 164, 0.28);
  border-radius: 8px;
  padding: clamp(10px, 1.6vw, 18px);
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(3, 16, 15, 0.34), rgba(2, 10, 10, 0.82)),
    var(--buzz-classic-table),
    #061412;
  background-size: auto, 460px, auto;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.game-surface[hidden] {
  display: none;
}

#gameSurface:not([hidden]) {
  max-height: calc(100dvh - 24px);
}

#gameSurface:not([hidden]) .multi-participant-panel,
#gameSurface:not([hidden]) .control-panel,
#gameSurface:not([hidden]) .log-panel {
  display: none;
}

.game-surface::before {
  position: absolute;
  inset: 52% auto auto 50%;
  z-index: -1;
  width: min(58vw, 620px);
  aspect-ratio: 1200 / 320;
  content: "";
  background: url("./assets/war-titlemark.png") center / contain no-repeat;
  opacity: 0.1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.topbar,
.scorebar,
.control-panel,
.log-panel,
.play-footer {
  border: 1px solid rgba(255, 230, 164, 0.22);
  border-radius: 8px;
  background: rgba(2, 13, 12, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 26px rgba(0, 0, 0, 0.18);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 6px;
  color: #fffaf1;
}

.play-toolbar {
  min-height: 52px;
}

.game-surface .bee-link {
  width: 38px;
  min-width: 38px;
  height: 38px;
  margin-right: 6px;
}

.game-surface .bee-link img {
  width: 38px;
  height: 38px;
}

.game-surface .game-titlemark--compact {
  display: none;
}

.game-surface .title-block {
  display: grid;
  min-width: 8rem;
  margin-right: auto;
}

.game-surface .title-block p {
  margin: 0;
  color: #f7c957;
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0;
}

.game-surface .top-actions {
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.game-surface .top-actions > * {
  flex: 0 0 auto;
}

.game-surface .top-actions button {
  flex: 0 0 auto;
  min-height: 38px;
  border-color: rgba(255, 230, 164, 0.28);
  padding: 0.48rem 0.7rem;
  color: #fffaf1;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.game-surface .top-actions > :is(.sound-toggle, .music-settings-button, .rules-button) {
  width: 38px;
  min-width: 38px;
  padding: 0;
  border-radius: 50%;
}

.game-surface .top-actions .music-toggle,
.game-surface .top-actions .music-settings-button {
  color: #f7c957;
}

.game-surface .top-actions #roomButton {
  border-color: rgba(147, 255, 172, 0.42);
}

.scorebar {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr repeat(3, minmax(76px, 0.72fr));
  gap: 8px;
  overflow: hidden;
  padding: 6px;
  color: #fffaf1;
}

.scorebar div {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid rgba(255, 230, 164, 0.12);
  border-radius: 8px;
  padding: 0.34rem 0.58rem;
  background: rgba(255, 255, 255, 0.06);
}

.scorebar span,
.zone-heading span,
.spoils-stack span,
.panel-heading span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.scorebar strong {
  color: #fffaf1;
  font-size: 1rem;
}

.play-table {
  display: grid;
  grid-template-columns: minmax(176px, 0.66fr) minmax(360px, 1.28fr) minmax(176px, 0.66fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 230, 164, 0.18);
  border-radius: 8px;
  padding: 12px;
  background:
    radial-gradient(circle at 50% 44%, rgba(247, 201, 87, 0.12), transparent 19rem),
    linear-gradient(180deg, rgba(8, 38, 34, 0.54), rgba(3, 20, 17, 0.72));
  background-size: auto, 420px, auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.table-hud {
  grid-column: 1 / -1;
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 250, 241, 0.24);
  border-radius: 8px;
  background: rgba(5, 30, 27, 0.48);
}

.table-hud div {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 0.42rem 0.62rem;
  color: #fffaf1;
  background: rgba(255, 250, 241, 0.08);
}

.table-hud span {
  color: rgba(255, 250, 241, 0.72);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.table-hud strong {
  font-size: 1.18rem;
  line-height: 1;
}

.side-zone,
.battle-zone {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 0;
  border: 1px solid rgba(255, 250, 241, 0.18);
  border-radius: 8px;
  color: #fffaf1;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), transparent),
    rgba(5, 30, 27, 0.34);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.12);
}

.zone-heading,
.panel-heading {
  display: flex;
  width: 100%;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 0 0.75rem;
}

.side-zone {
  grid-template-rows: auto minmax(132px, 1fr);
  gap: 10px;
  padding: 12px;
}

.side-zone--player {
  grid-column: 3;
  grid-row: 1;
  grid-template-rows: auto minmax(132px, 1fr);
}

.zone-heading h2,
.panel-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.deck-zone {
  display: grid;
  min-height: 132px;
  place-items: center;
}

.deck-zone .buzz-zone,
.card-slot .buzz-zone {
  min-width: clamp(104px, 13vw, 156px);
  min-height: clamp(132px, 17vw, 190px);
  background-color: rgba(255, 248, 235, 0.08);
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.18);
}

.buzz-deck-stack {
  position: relative;
  display: grid;
  place-items: center;
}

.buzz-deck-stack__shadow {
  position: absolute;
  inset: 9px -9px -9px 9px;
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.18);
}

.buzz-deck-stack__count {
  position: absolute;
  right: -12px;
  bottom: -10px;
  display: grid;
  min-width: 34px;
  min-height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #202126;
  background: var(--gold);
  font-weight: 900;
}

.battle-zone {
  position: relative;
  grid-template-rows: auto auto minmax(112px, 1fr) auto auto minmax(112px, 1fr) auto;
  gap: 8px;
  padding: 12px;
}

.turn-result {
  display: flex;
  width: min(28rem, 100%);
  min-height: 46px;
  justify-content: center;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255, 250, 241, 0.22);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  color: #fffaf1;
  background: rgba(5, 30, 27, 0.5);
  text-align: center;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.12);
}

.turn-result span {
  display: inline-grid;
  min-width: 58px;
  min-height: 28px;
  place-items: center;
  border-radius: 999px;
  color: #1d1c20;
  background: #fffaf1;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.turn-result strong {
  font-size: clamp(0.88rem, 2vw, 1.05rem);
}

.turn-result--player {
  background: rgba(25, 93, 55, 0.64);
}

.turn-result--opponent {
  background: rgba(126, 31, 44, 0.66);
}

.turn-result--war {
  background: rgba(122, 79, 0, 0.68);
}

.battle-card-label {
  display: block;
  color: rgba(255, 250, 241, 0.78);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.card-slot {
  display: grid;
  min-height: 112px;
  place-items: center;
}

.buzz-card {
  width: clamp(72px, 9vw, 106px);
  border-width: 2px;
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.24);
}

.buzz-card__corner {
  position: absolute;
  display: grid;
  justify-items: center;
  line-height: 1;
  font-weight: 900;
}

.buzz-card__corner--top {
  top: 9px;
  left: 9px;
}

.buzz-card__corner--bottom {
  right: 9px;
  bottom: 9px;
  transform: rotate(180deg);
}

.buzz-card__center {
  place-self: center;
  font-size: clamp(2rem, 4vw, 3.3rem);
}

.spoils-stack {
  display: grid;
  min-width: 84px;
  min-height: 64px;
  place-items: center;
  border: 2px dashed rgba(255, 250, 241, 0.44);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.08);
}

.buzz-token {
  color: #23190d;
}

.spoils-stack strong {
  font-size: 1.6rem;
}

.battle-message {
  width: min(32rem, 100%);
  min-height: 2rem;
  margin: 0;
  text-align: center;
  font-weight: 800;
}

.hand-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
  grid-column: 3;
  grid-row: 1;
  align-self: end;
  justify-self: stretch;
  z-index: 2;
  padding: 0 14px 14px;
}

.hand-actions button {
  min-height: 42px;
  border-color: rgba(255, 230, 164, 0.26);
  color: #fffaf1;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-weight: 900;
}

.hand-actions .primary-action {
  border-color: rgba(147, 255, 172, 0.52);
  color: #071c12;
  background: linear-gradient(180deg, #9cf4a7, #4fb86a);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.44);
}

.control-panel {
  justify-content: center;
  padding: 10px;
  border: 1px solid rgba(255, 250, 241, 0.18);
  border-radius: 8px;
  background: rgba(3, 20, 17, 0.58);
  backdrop-filter: blur(3px);
}

.room-code-chip {
  display: inline-grid;
  min-height: 38px;
  place-items: center;
  border: 1px solid rgba(32, 33, 38, 0.16);
  border-radius: 999px;
  padding: 0 0.75rem;
  color: #fffaf1;
  background: #145f4f;
  font-size: 0.82rem;
  font-weight: 900;
}

.room-form,
.room-panel,
.room-table-talk {
  display: grid;
  gap: 0.8rem;
}

.room-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.room-split--single {
  grid-template-columns: 1fr;
}

.room-form h3 {
  margin: 0;
  color: #201400;
  font-size: 0.96rem;
  font-weight: 950;
}

.room-form-note {
  margin: 0;
  color: #4b4d55;
}

.room-policy-note--compact {
  border-color: rgba(122, 79, 0, 0.22);
  background: linear-gradient(180deg, rgba(255, 248, 224, 0.98), rgba(255, 250, 241, 0.92));
}

.room-policy-trigger-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(122, 79, 0, 0.18);
  border-radius: 8px;
  padding: 0.52rem 0.6rem;
  background: rgba(255, 248, 235, 0.68);
}

.room-policy-trigger-row span {
  color: #4b4d55;
  font-size: 0.84rem;
  font-weight: 760;
}

.room-setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.room-card {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  border: 1px solid rgba(122, 79, 0, 0.18);
  border-radius: 8px;
  padding: 0.72rem;
  background: rgba(255, 250, 241, 0.82);
}

.room-card legend,
.room-card > span {
  color: #7a4f00;
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.room-card strong {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 950;
}

.room-card small {
  color: #4b4d55;
  font-size: 0.78rem;
  font-weight: 720;
  line-height: 1.32;
}

.room-card--music {
  grid-column: 1 / -1;
}

.room-music-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.room-select-label {
  display: grid;
  gap: 0.34rem;
  color: #4b4d55;
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.room-select-label select,
.room-password input,
.room-code-entry input {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.56rem;
  color: var(--ink);
  background: #fffaf1;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 850;
}

.room-music-preview {
  min-height: 42px;
  border-color: rgba(122, 79, 0, 0.38);
  color: #211500;
  background: linear-gradient(180deg, #ffe498, #f2c34c);
  font-weight: 950;
  white-space: nowrap;
}

.room-policy-note,
.room-status-line,
.room-code-entry,
.room-password,
.room-choice,
.table-talk-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.room-policy-note,
.room-status-line,
.room-code-entry,
.room-password {
  padding: 0.75rem;
}

.room-form {
  border: 1px solid rgba(122, 79, 0, 0.18);
  border-radius: 8px;
  padding: 0.85rem;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 14px 28px rgba(122, 79, 0, 0.08);
}

.room-choice {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 0.72rem;
  color: var(--ink);
  font-weight: 900;
}

.room-choice span {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: nowrap;
}

.room-policy-note strong,
.room-table-talk strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #7a4f00;
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.room-policy-note p,
.room-code-entry small,
.room-password small,
.room-status-message {
  margin: 0;
  color: #4b4d55;
}

.room-password,
.room-code-entry {
  display: grid;
  gap: 0.38rem;
  color: #4b4d55;
  font-size: 0.8rem;
  font-weight: 920;
  text-transform: uppercase;
}

.room-status-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.room-lobby-notice {
  display: grid;
  gap: 0.2rem;
  width: min(100% - 2rem, 680px);
  margin: 0 auto 1rem;
  padding: 0.85rem 1rem;
  border: 2px solid #c98d1a;
  border-radius: 10px;
  background: #fff0bd;
  color: #4b3510;
  text-align: center;
  box-shadow: 0 8px 20px rgb(43 28 0 / 12%);
}

.room-lobby-notice span {
  color: #6a5a3d;
  font-size: 0.88rem;
  font-weight: 750;
}

.room-status-line span,
.room-status-message {
  font-weight: 800;
}

.room-code-entry {
  display: grid;
  gap: 0.35rem;
  font-weight: 800;
}

.room-code-entry input,
.room-chat-form input {
  min-height: 42px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font: inherit;
}

.table-talk-panel {
  padding: 10px;
}

.log-panel {
  display: grid;
  gap: 8px;
  min-height: 0;
  padding: 8px;
  color: #fffaf1;
}

.log-panel .panel-heading {
  padding: 0;
}

.log-panel ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 86px;
  margin: 0;
  overflow: auto;
  padding: 0;
  list-style: none;
}

.log-panel li {
  border: 1px solid rgba(255, 230, 164, 0.12);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  font-weight: 760;
}

.room-table-talk ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.room-table-talk li {
  display: grid;
  gap: 2px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  background: #fffaf1;
}

.room-table-talk li span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.room-table-talk li p {
  margin: 0;
  font-weight: 800;
}

.table-talk-icon {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border-radius: 7px;
  background-image: url("./assets/table-talk-icons-v1.webp");
  background-repeat: no-repeat;
  background-size: 300% 200%;
  background-position: 100% 100%;
  vertical-align: middle;
}

.table-talk-icon[data-room-icon="turn"] { background-position: 0% 0%; }
.table-talk-icon[data-room-icon="strength"] { background-position: 50% 0%; }
.table-talk-icon[data-room-icon="target"] { background-position: 100% 0%; }
.table-talk-icon[data-room-icon="clap"] { background-position: 0% 100%; }
.table-talk-icon[data-room-icon="shake"] { background-position: 50% 100%; }

.quick-phrases,
.room-chat-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-phrases button {
  display: inline-grid;
  width: 48px;
  min-width: 48px;
  min-height: 48px;
  place-items: center;
  padding: 3px;
}

.quick-phrases button .table-talk-icon {
  width: 100%;
  height: 100%;
}

.room-chat-form {
  align-items: center;
}

.room-chat-form input {
  flex: 1 1 220px;
}

.log-panel {
  min-height: 92px;
  padding: 10px;
}

.log-panel ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.log-panel li {
  min-height: 34px;
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  color: #2f332f;
  background: #fffdf8;
  font-size: 0.9rem;
}

.log-panel li[data-tone="war"] {
  background: #fff1bf;
}

.log-panel li[data-tone="player"] {
  background: #dff7e9;
}

.log-panel li[data-tone="opponent"] {
  background: #ffe4e6;
}

dialog {
  width: min(860px, calc(100% - 22px));
  max-height: min(90vh, 820px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  color: var(--ink);
  background: #fffaf1;
  box-shadow: var(--shadow);
}

dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
}

dialog::backdrop {
  background: rgba(17, 24, 39, 0.42);
}

dialog h2 {
  margin: 0;
}

.dialog-body {
  min-height: 0;
  overflow: auto;
  padding-right: 0.35rem;
  line-height: 1.5;
}

.dialog-body:focus {
  outline: none;
}

.music-settings-form {
  display: grid;
  gap: 0.8rem;
  min-width: min(100%, 360px);
}

.music-settings-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.music-settings-form select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  color: var(--ink);
  background: #fffdf8;
  font: inherit;
  font-weight: 800;
}

dialog > button {
  justify-self: start;
}

.rules-summary,
.records-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.rules-summary article,
.records-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem;
  background: #fffdf8;
}

.rules-summary strong {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #fffaf1;
  background: var(--black);
}

.rules-summary span {
  display: block;
  margin-top: 0.45rem;
}

.records-grid article {
  display: grid;
  gap: 0.3rem;
}

.records-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.records-grid strong {
  font-size: 1.3rem;
}

.records-grid p {
  margin: 0;
  color: #4b4d55;
  font-size: 0.92rem;
}

.platform-records-note {
  margin-top: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem;
  background: #fffaf1;
}

.platform-records-note h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.platform-records-note p {
  margin: 0;
  color: #4b4d55;
}

.platform-leaderboard {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding-left: 1.2rem;
}

.platform-leaderboard li {
  padding: 0.35rem 0;
}

.platform-leaderboard span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.buzz-footer {
  display: flex;
  width: 100%;
  gap: 14px;
  align-items: center;
  margin: 12px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 250, 241, 0.94);
  box-shadow: 0 8px 22px rgba(32, 33, 38, 0.08);
}

.buzz-footer--landing {
  align-self: center;
  width: fit-content;
  margin-inline: auto;
  margin-top: auto;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.buzz-footer p {
  margin: 0 0 0.45rem;
  color: #4b4d55;
  font-size: 0.9rem;
}

.buzz-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.buzz-footer a:not([data-buzz-home]),
.buzz-footer button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.68rem;
  color: var(--ink);
  background: #fffdf8;
  text-decoration: none;
  box-shadow: none;
}

.play-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  padding: 6px;
}

.play-footer__home {
  width: 38px;
  min-width: 38px;
  height: 38px;
  margin-right: auto;
}

.play-footer__home img {
  width: 38px;
  height: 38px;
}

.play-footer button {
  min-height: 36px;
  border-color: rgba(255, 230, 164, 0.24);
  color: rgba(255, 250, 241, 0.88);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

@media (prefers-reduced-motion: no-preference) {
  .is-revealing {
    animation: revealCard 260ms ease-out;
  }

  @keyframes revealCard {
    from {
      transform: translateY(8px) rotateY(65deg);
      opacity: 0.42;
    }
    to {
      transform: translateY(0) rotateY(0);
      opacity: 1;
    }
  }
}

@media (max-width: 860px) {
  .landing-screen {
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: start;
  }

  .hero-copy {
    grid-template-rows: auto auto auto auto auto;
  }

  .hero-art {
    min-height: clamp(210px, 30vh, 340px);
  }

  .table-scene {
    min-height: clamp(340px, 46vh, 520px);
  }

  .war-landing-table-scene {
    min-height: clamp(320px, 44vh, 480px);
  }

  .hero-battle-zone {
    width: 82%;
  }

  .hero-battle-zone .buzz-zone {
    min-height: 340px;
  }

  .hero-player {
    z-index: 4;
  }

  .hero-player--opponent {
    top: 11%;
  }

  .hero-player--player {
    bottom: 10%;
    flex-direction: column;
  }

  .hero-spoils {
    right: 8%;
    bottom: 24%;
    z-index: 5;
  }

  .hero-rack {
    left: 8%;
    bottom: 21%;
    z-index: 5;
  }

  .game-surface {
    min-height: auto;
    overflow: visible;
  }

  .play-table {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-zone {
    min-height: 188px;
    padding: 10px;
  }

  .side-zone--opponent {
    order: 1;
  }

  .side-zone--player {
    order: 2;
    grid-column: auto;
    grid-row: auto;
  }

  .hand-actions {
    order: 3;
    grid-column: 1 / -1;
    grid-row: auto;
    padding: 0;
  }

  .battle-zone {
    order: 4;
    grid-column: 1 / -1;
    min-height: 330px;
  }

  .deck-zone {
    min-height: 96px;
  }

  .scorebar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .log-panel ol,
  .room-table-talk ol {
    grid-template-columns: 1fr;
  }

  .rules-summary,
  .records-grid,
  .room-setup-grid,
  .room-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .multi-participant-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell {
    width: min(100% - 14px, 1160px);
    min-height: auto;
    padding-top: 8px;
  }

  .landing-screen {
    min-height: auto;
  }

  .hero-topbar {
    gap: 4px;
    justify-content: flex-start;
  }

  .hero-secondarybar {
    justify-content: stretch;
  }

  .hero-secondarybar > * {
    flex: 1 1 0;
  }

  .hero-secondarybar .daily-banner {
    margin-left: 0;
  }

  .hero-actions {
    flex: 1 1 auto;
    gap: 4px;
    justify-content: flex-end;
    min-width: 0;
  }

  .hero-actions button {
    min-height: 34px;
    padding: 0.4rem 0.46rem;
    font-size: 0.92rem;
  }

  .hero-actions > :is(.sound-toggle, .music-settings-button, .rules-button),
  .hero-branding > :is(.landing-bee, .provenance-icon) {
    width: 32px;
    min-width: 32px;
    height: 32px;
  }

  .landing-bee img,
  .provenance-icon img {
    width: 26px;
    height: 26px;
  }

  .hero-branding {
    gap: 4px;
    flex: 0 0 auto;
  }

  .hero-secondarybar #saveButton,
  .hero-secondarybar #joinRoomButton {
    min-width: 0;
    padding-inline: 0.58rem;
    white-space: nowrap;
  }

  .game-titlemark--landing {
    top: 9%;
    width: 86%;
    max-height: 56%;
    object-fit: contain;
  }

  .hero-copy > span {
    margin-top: 0.55rem;
    font-size: 1rem;
    line-height: 1.32;
  }

  .landing-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 0.7rem;
  }

  .mode-picker {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .landing-secondary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .opponent-roster-panel,
  .opponent-dialog .dialog-body {
    grid-template-columns: 1fr;
  }

  .opponent-dialog {
    width: min(620px, calc(100% - 18px));
  }

  .opponent-roster-panel button {
    width: 100%;
  }

  .opponent-choice {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .room-setup-grid,
  .room-music-controls {
    grid-template-columns: 1fr;
  }

  .preview-pot {
    grid-template-columns: repeat(2, 86px);
  }

  .table-scene {
    min-height: 318px;
    padding: 8px;
  }

  .war-landing-table-scene {
    min-height: 300px;
  }

  .hero-battle-zone {
    width: 78%;
  }

  .hero-battle-zone .buzz-zone {
    min-height: 222px;
  }

  .hero-card .buzz-card {
    width: 62px;
  }

  .war-burst {
    width: 76px;
    height: 76px;
  }

  .hero-spoils {
    right: 4%;
    bottom: 20%;
  }

  .hero-rack {
    left: 5%;
    bottom: 18%;
    width: 38%;
  }

  .landing-table-notes {
    right: 12px;
    bottom: 10px;
    max-width: 152px;
  }

  .game-surface {
    width: 100%;
    gap: 8px;
    padding: 8px;
    overflow-x: hidden;
  }

  .topbar {
    align-items: center;
  }

  .game-surface .bee-link {
    width: 34px;
    min-width: 34px;
    height: 34px;
    margin-right: 0;
  }

  .game-surface .bee-link img {
    width: 34px;
    height: 34px;
  }

  .game-surface .title-block {
    min-width: 3.3rem;
  }

  .game-surface .title-block p {
    font-size: 0.68rem;
  }

  .game-surface .top-actions {
    flex: 1 1 auto;
    gap: 4px;
    justify-content: flex-start;
  }

  .game-surface .top-actions button {
    min-height: 30px;
    padding: 0.3rem 0.4rem;
    font-size: 0.72rem;
  }

  .game-surface .top-actions > :is(.sound-toggle, .music-settings-button, .rules-button) {
    width: 28px;
    min-width: 28px;
  }

  .game-surface .top-actions #roomButton,
  .game-surface .top-actions #copyRoomLinkButton,
  .game-surface .top-actions #roomCodeChip {
    display: none;
  }

  .scorebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scorebar div {
    padding: 0.32rem 0.48rem;
  }

  .play-table {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
  }

  .play-table > * {
    min-width: 0;
  }

  .side-zone {
    min-height: 178px;
  }

  .side-zone .zone-heading {
    padding: 0;
  }

  .zone-heading h2 {
    font-size: 0.9rem;
  }

  .zone-heading span {
    font-size: 0.62rem;
  }

  .battle-zone {
    min-height: 318px;
    padding: 10px;
  }

  .buzz-card {
    width: 72px;
  }

  .deck-zone .buzz-zone,
  .card-slot .buzz-zone {
    min-width: 90px;
    min-height: 116px;
  }

  .hand-actions {
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hand-actions button {
    min-height: 36px;
    padding: 0.4rem 0.32rem;
    font-size: 0.72rem;
  }

  #stopAutoButton {
    grid-column: 1 / -1;
  }

  .log-panel ol {
    max-height: 74px;
  }

  .buzz-footer {
    width: min(100% - 14px, 1160px);
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  body:has(#gameSurface:not([hidden])) {
    overflow: hidden;
  }

  body:has(#gameSurface:not([hidden])) .app-shell {
    width: 100%;
    min-height: 100dvh;
    max-height: 100dvh;
    padding: 0;
    overflow: hidden;
  }

  #gameSurface:not([hidden]) {
    grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
    gap: 5px;
    min-height: 100dvh;
    max-height: 100dvh;
    padding: 6px;
    overflow: hidden;
    border-radius: 0;
  }

  #gameSurface:not([hidden]) .play-toolbar {
    min-height: 38px;
    padding: 3px;
    overflow: hidden;
  }

  #gameSurface:not([hidden]) .title-block,
  #gameSurface:not([hidden]) .top-actions #newGameButton,
  #gameSurface:not([hidden]) .top-actions #roomButton,
  #gameSurface:not([hidden]) .top-actions #copyRoomLinkButton,
  #gameSurface:not([hidden]) .top-actions #roomCodeChip,
  #gameSurface:not([hidden]) .top-actions #recordsButton,
  #gameSurface:not([hidden]) .top-actions #playAccountButton,
  #gameSurface:not([hidden]) .top-actions #playSupportButton {
    display: none;
  }

  #gameSurface:not([hidden]) .top-actions {
    gap: 6px;
    overflow: hidden;
  }

  #gameSurface:not([hidden]) .scorebar {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
  }

  #gameSurface:not([hidden]) .scorebar div {
    min-height: 38px;
    padding: 4px;
  }

  #gameSurface:not([hidden]) .scorebar span {
    font-size: 0.54rem;
  }

  #gameSurface:not([hidden]) .scorebar strong {
    font-size: 0.72rem;
    line-height: 1.05;
  }

  #gameSurface:not([hidden]) .play-table {
    grid-template-columns: minmax(58px, 0.42fr) minmax(0, 1fr) minmax(58px, 0.42fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 5px;
    min-height: 0;
    padding: 5px;
  }

  #gameSurface:not([hidden]) .side-zone,
  #gameSurface:not([hidden]) .battle-zone {
    min-width: 0;
    min-height: 0;
    padding: 5px;
  }

  #gameSurface:not([hidden]) .side-zone {
    grid-template-rows: auto minmax(0, 1fr);
    gap: 4px;
  }

  #gameSurface:not([hidden]) .zone-heading {
    padding: 0;
  }

  #gameSurface:not([hidden]) .zone-heading h2,
  #gameSurface:not([hidden]) .zone-heading span,
  #gameSurface:not([hidden]) .battle-card-label,
  #gameSurface:not([hidden]) .battle-message {
    font-size: 0.58rem;
    line-height: 1.05;
  }

  #gameSurface:not([hidden]) .deck-zone,
  #gameSurface:not([hidden]) .card-slot {
    min-height: 58px;
  }

  #gameSurface:not([hidden]) .deck-zone .buzz-zone,
  #gameSurface:not([hidden]) .card-slot .buzz-zone {
    min-width: 0;
    min-height: 58px;
    padding: 3px;
  }

  #gameSurface:not([hidden]) .buzz-card {
    width: clamp(38px, 13vw, 48px);
  }

  #gameSurface:not([hidden]) .buzz-deck-stack {
    transform: scale(0.42);
  }

  #gameSurface:not([hidden]) .battle-zone {
    grid-template-rows: auto auto minmax(42px, 1fr) auto auto minmax(42px, 1fr) auto;
    gap: 3px;
  }

  #gameSurface:not([hidden]) .turn-result {
    min-height: 34px;
    padding: 4px;
  }

  #gameSurface:not([hidden]) .turn-result strong {
    font-size: 0.7rem;
    line-height: 1.05;
  }

  #gameSurface:not([hidden]) .spoils-stack {
    min-height: 40px;
    padding: 4px;
  }

  #gameSurface:not([hidden]) .multi-participant-panel,
  #gameSurface:not([hidden]) .control-panel,
  #gameSurface:not([hidden]) .log-panel {
    display: none;
  }

  #gameSurface:not([hidden]) .hand-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  #gameSurface:not([hidden]) .hand-actions button {
    min-height: 32px;
    padding: 4px;
    font-size: 0.68rem;
  }

  #gameSurface:not([hidden]) #stopAutoButton {
    grid-column: auto;
  }

  #gameSurface:not([hidden]) .play-footer {
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  #gameSurface:not([hidden]) .play-footer button {
    display: none;
  }

  #gameSurface:not([hidden]) .play-footer__home {
    width: 42px;
    min-width: 42px;
    height: 42px;
    margin: 0;
  }

  #gameSurface:not([hidden]) .play-footer__home img {
    width: 38px;
    height: 38px;
  }
}

.play-footer--minimal {
  display: grid !important;
  grid-template-columns: 1fr !important;
  place-items: center !important;
}

.play-footer--minimal .play-footer__home {
  justify-self: center !important;
  margin-inline: auto !important;
}

#rulesDialog .dialog-body {
  max-height: min(58vh, 560px);
  overflow-y: auto;
}

/* Crazy Eights is the literal landing-page composition benchmark. */
.hero-copy > .hero-commandbar {
  width: 100%;
  min-height: 70px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 230, 164, 0.24);
  border-radius: 8px;
  background: rgba(3, 18, 16, 0.82);
}

.hero-commandbar .hero-room-actions {
  display: flex;
  gap: 8px;
}

.hero-art.hero-title-lane {
  width: 100%;
  min-height: clamp(230px, 34vh, 420px);
  margin: 4px 0 0;
  border: 1px solid rgba(255, 226, 148, 0.34);
}

.landing-actions.hero-landing-actions {
  width: 100%;
  margin-top: 0;
  padding: 14px;
}

.buzz-footer--landing .buzz-footer__mark {
  display: grid;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  place-items: center;
}

.buzz-footer--landing .buzz-footer__mark img {
  width: 28px;
  height: 28px;
}

@media (max-width: 620px) {
  .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-actions {
    display: contents;
  }

  .hero-commandbar .landing-bee { grid-area: bee; }
  .hero-commandbar .provenance-icon { grid-area: provenance; }
  .hero-commandbar #saveButton { grid-area: account; }
  .hero-commandbar #landingSoundButton { grid-area: sound; }
  .hero-commandbar #landingMusicButton { grid-area: music; }
  .hero-commandbar #landingMusicSettingsButton { grid-area: settings; }
  .hero-commandbar #landingRulesButton { grid-area: help; }
  .hero-commandbar #joinRoomButton { grid-area: join; }
  .hero-commandbar #dailyTopButton { grid-area: daily; }

  .hero-commandbar :is(.landing-bee, .provenance-icon) {
    display: grid;
    width: 28px;
    min-width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
    place-items: center;
  }

  .hero-commandbar :is(.landing-bee, .provenance-icon) img {
    width: 28px;
    height: 28px;
  }

  .hero-commandbar #saveButton {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 4px 8px;
  }

  .hero-commandbar .hero-actions button {
    width: 28px;
    min-width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
  }

  .hero-commandbar :is(#joinRoomButton, #dailyTopButton) {
    width: 100%;
    min-width: 0;
    min-height: 28px;
    padding: 3px 5px;
  }

  .hero-art.hero-title-lane {
    min-height: clamp(96px, 13vh, 116px);
  }

  .hero-art .game-titlemark--landing {
    top: 8%;
    width: min(64vw, 300px);
    max-height: 88%;
  }

  .landing-actions.hero-landing-actions {
    gap: 10px;
    margin-top: 0;
    padding: 14px;
  }

  .landing-actions .mode-picker,
  .landing-actions .opponent-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-actions .opponent-roster-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(132px, auto);
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
  }

  .landing-actions #opponentRosterDescription {
    display: none;
  }

  .landing-actions #openOpponentRosterButton {
    grid-column: 2;
    grid-row: 1;
    min-height: 44px;
    padding: 6px 10px;
  }
}
