@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,600;12..96,700;12..96,800&family=DM+Mono:wght@400;500&family=Nunito+Sans:wght@400;600;700;800;900&display=swap");

:root {
  color-scheme: dark;
  font-family: "Nunito Sans", sans-serif;
  background: #17182a;
  --ink: #fff8e9;
  --muted: #b6b3c4;
  --acid: #f6c453;
  --mint: #68d4c5;
  --ember: #f06449;
  --violet: #6b65c8;
  --paper: #fff7e6;
  --paper-ink: #262034;
  --panel: rgba(30, 29, 49, 0.92);
  --line: rgba(255, 248, 233, 0.14);
}

/* Board life, readable movement and in-context game guidance */
.class-portrait canvas {
  cursor: grab;
  height: 100%;
  inset: 0;
  min-height: 10rem;
  position: absolute;
  touch-action: none;
  width: 100%;
  z-index: 3;
}

.class-portrait canvas:active {
  cursor: grabbing;
}

.class-portrait:has(canvas) > span,
.class-portrait:has(canvas) > i {
  opacity: 0;
}

.class-portrait small {
  background: rgba(35, 35, 59, 0.78);
  border: 1px solid rgba(255, 247, 230, 0.22);
  border-radius: 999px;
  bottom: 0.25rem;
  color: #fff7e6;
  font: 600 0.48rem "DM Mono", monospace;
  left: 50%;
  padding: 0.3rem 0.55rem;
  pointer-events: none;
  position: absolute;
  text-transform: uppercase;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 4;
}

.class-preview-speech {
  background: rgba(24, 27, 37, 0.96);
  border: 2px solid var(--class-color);
  border-radius: 0.7rem;
  color: #fff7e6;
  font-size: 0.58rem;
  font-weight: 800;
  left: 4.6rem;
  line-height: 1.25;
  max-width: 10.5rem;
  padding: 0.45rem 0.55rem;
  pointer-events: none;
  position: absolute;
  top: 0.15rem;
  width: max-content;
  z-index: 7;
}

.class-preview-speech::after {
  border-color: transparent var(--class-color) transparent transparent;
  border-style: solid;
  border-width: 0.35rem 0.5rem 0.35rem 0;
  content: "";
  left: -0.5rem;
  position: absolute;
  top: 1rem;
}

.class-preview-speech[data-active="true"] {
  animation: character-speech-arrive 180ms ease-out both;
}

.camera-hint {
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 247, 230, 0.72);
  margin-left: 0.25rem;
  padding-left: 0.65rem;
}

.movement-breakdown {
  color: #fff7e6;
  font: 600 0.5rem/1.35 "DM Mono", monospace;
  grid-column: 1 / -1;
  max-width: 12rem;
  text-align: center;
  white-space: nowrap;
}

.turn-controls .dice-readout {
  grid-template-columns: repeat(2, 2.25rem);
  justify-content: center;
  min-width: 11rem;
}

.space-inspector {
  align-items: flex-start;
  background: rgba(255, 247, 230, 0.97);
  border: 2px solid #282741;
  border-radius: 1.1rem;
  bottom: 7.6rem;
  box-shadow: 0.65rem 0.65rem 0 #292942, 0 1.5rem 4rem rgba(10, 9, 20, 0.32);
  color: #292942;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: 4.4rem minmax(0, 1fr);
  max-width: min(27rem, calc(100vw - 2rem));
  opacity: 0;
  padding: 1rem;
  position: fixed;
  right: 1.2rem;
  transform: translateX(calc(100% + 3rem)) rotate(1deg);
  transition: opacity 180ms ease, transform 260ms cubic-bezier(.2,.8,.2,1);
  visibility: hidden;
  width: 25rem;
  z-index: 30;
}

.space-inspector[data-open="true"] {
  opacity: 1;
  transform: translateX(0) rotate(0);
  visibility: visible;
}

.space-inspector-close {
  align-items: center;
  background: #292942;
  border: 0;
  border-radius: 50%;
  color: #fff7e6;
  cursor: pointer;
  display: flex;
  font-size: 1rem;
  height: 1.8rem;
  justify-content: center;
  position: absolute;
  right: 0.7rem;
  top: 0.7rem;
  width: 1.8rem;
}

.space-number {
  align-items: center;
  background: #f6c453;
  border: 2px solid #292942;
  border-radius: 0.8rem;
  box-shadow: 0.3rem 0.3rem 0 #292942;
  display: flex;
  font: 900 1.45rem "DM Mono", monospace;
  height: 4.4rem;
  justify-content: center;
}

.space-inspector[data-type="event"] .space-number {
  background: #f06449;
}

.space-inspector[data-type="special"] .space-number {
  background: #9d91ed;
}

.space-inspector[data-type="start"] .space-number {
  background: #68d4c5;
}

.space-inspector h2 {
  font-size: 1.2rem;
  margin: 0.16rem 2rem 0.35rem 0;
}

.space-inspector p {
  font-size: 0.68rem;
  line-height: 1.45;
  margin: 0;
}

.space-metrics {
  display: grid;
  gap: 0.4rem;
  grid-template-columns: repeat(3, 1fr);
  margin: 0.8rem 0 0;
}

.space-metrics div {
  background: #ebe2d0;
  border-radius: 0.55rem;
  padding: 0.5rem;
}

.space-metrics dt {
  color: #756d78;
  font: 600 0.46rem "DM Mono", monospace;
  text-transform: uppercase;
}

.space-metrics dd {
  font-size: 0.68rem;
  font-weight: 800;
  margin: 0.16rem 0 0;
}

.guide-dialog {
  background: transparent;
  border: 0;
  color: #292942;
  max-height: 100vh;
  max-width: 100vw;
  padding: 1rem;
}

.guide-dialog::backdrop {
  background: rgba(24, 22, 40, 0.76);
  backdrop-filter: blur(8px);
}

.guide-shell {
  background: #fff7e6;
  border: 2px solid #292942;
  border-radius: 1.4rem;
  box-shadow: 0.8rem 0.8rem 0 #f06449;
  max-width: 48rem;
  overflow: hidden;
  padding: 1.35rem;
  width: calc(100vw - 2rem);
}

.guide-header {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
}

.guide-header h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  letter-spacing: -0.05em;
  margin: 0.2rem 0 1rem;
}

.guide-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(4, 1fr);
}

.guide-grid article {
  background: #ebe2d0;
  border-radius: 0.9rem;
  padding: 0.9rem;
}

.guide-grid article span {
  color: #f06449;
  font: 900 0.7rem "DM Mono", monospace;
}

.guide-grid h3 {
  font-size: 0.92rem;
  margin: 0.5rem 0 0.35rem;
}

.guide-grid p,
.guide-note p {
  font-size: 0.65rem;
  line-height: 1.5;
  margin: 0;
}

.guide-note {
  align-items: start;
  background: #292942;
  border-radius: 0.9rem;
  color: #fff7e6;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: auto 1fr;
  margin-top: 0.65rem;
  padding: 0.9rem;
}

.guide-note strong {
  color: #68d4c5;
  font: 800 0.58rem "DM Mono", monospace;
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .guide-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .space-inspector {
    bottom: 10.5rem;
    left: 0.7rem;
    right: 0.7rem;
    width: auto;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

#game-canvas {
  display: block;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  outline: none;
}

.scene-vignette {
  background:
    linear-gradient(180deg, rgba(4, 10, 9, 0.66) 0%, transparent 28%),
    radial-gradient(circle at 50% 46%, transparent 30%, rgba(3, 9, 8, 0.42) 100%);
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.entry-flow {
  align-items: center;
  backdrop-filter: blur(12px);
  background:
    radial-gradient(circle at 50% 25%, rgba(39, 77, 64, 0.42), transparent 48%),
    rgba(3, 10, 8, 0.74);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 5.5rem 1rem 1rem;
  position: fixed;
  z-index: 40;
}

.entry-flow[hidden] {
  display: none;
}

.entry-shell {
  backdrop-filter: blur(28px);
  background: rgba(7, 20, 17, 0.94);
  border: 1px solid rgba(215, 245, 66, 0.18);
  border-radius: 1.4rem;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.48);
  max-height: calc(100vh - 7rem);
  overflow: auto;
  padding: clamp(1.25rem, 4vw, 2rem);
  width: min(31rem, 100%);
}

.entry-shell h2 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  letter-spacing: -0.055em;
  margin: 0.35rem 0 0;
}

.entry-copy {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
  margin: 0.65rem 0 1.25rem;
}

.entry-form {
  display: grid;
  gap: 0.65rem;
}

.entry-form label {
  color: #b5c5bf;
  font: 0.6rem "DM Mono", monospace;
  letter-spacing: 0.1em;
  margin-top: 0.25rem;
  text-transform: uppercase;
}

.entry-form input,
.entry-form select {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  color: var(--ink);
  font: 0.82rem "Manrope", sans-serif;
  min-height: 3rem;
  padding: 0.75rem 0.85rem;
}

.entry-form input:focus,
.entry-form select:focus {
  border-color: rgba(215, 245, 66, 0.55);
  outline: 2px solid rgba(215, 245, 66, 0.1);
}

.entry-main-action {
  margin-top: 0.45rem;
}

.entry-divider {
  align-items: center;
  color: var(--muted);
  display: flex;
  font: 0.56rem "DM Mono", monospace;
  gap: 0.7rem;
  margin: 0.45rem 0;
  text-transform: uppercase;
}

.entry-divider::before,
.entry-divider::after {
  background: var(--line);
  content: "";
  flex: 1;
  height: 1px;
}

.join-row {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 1fr auto;
}

#room-code {
  font: 700 1rem "DM Mono", monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lobby-title-row {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.room-code-button {
  background: rgba(215, 245, 66, 0.09);
  border: 1px solid rgba(215, 245, 66, 0.24);
  border-radius: 0.8rem;
  color: var(--acid);
  cursor: pointer;
  padding: 0.55rem 0.75rem;
}

.room-code-button span,
.room-code-button strong {
  display: block;
}

.room-code-button span {
  color: var(--muted);
  font: 0.5rem "DM Mono", monospace;
  text-transform: uppercase;
}

.room-code-button strong {
  font: 700 0.95rem "DM Mono", monospace;
  letter-spacing: 0.12em;
  margin-top: 0.15rem;
}

.lobby-players {
  display: grid;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  max-height: 16rem;
  overflow: auto;
  padding: 0;
}

.lobby-players li {
  align-items: center;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  display: flex;
  justify-content: space-between;
  padding: 0.7rem 0.8rem;
}

.lobby-players li div,
.lobby-players li strong,
.lobby-players li span {
  display: block;
}

.lobby-players li strong {
  font-size: 0.78rem;
}

.lobby-players li div span {
  color: var(--muted);
  font: 0.58rem "DM Mono", monospace;
  margin-top: 0.15rem;
  text-transform: capitalize;
}

.lobby-ready {
  color: #e8b16b;
  font: 0.58rem "DM Mono", monospace;
  text-transform: uppercase;
}

.lobby-ready.is-ready {
  color: var(--mint);
}

.lobby-bot-remove {
  background: transparent;
  border: 1px solid rgba(166, 86, 50, 0.28);
  border-radius: 999px;
  color: #a65632;
  cursor: pointer;
  font: 0.54rem "DM Mono", monospace;
  padding: 0.38rem 0.55rem;
  text-transform: uppercase;
}

.lobby-bot-remove:hover {
  background: rgba(166, 86, 50, 0.08);
}

.lobby-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.entry-error {
  color: #ffad92;
  font-size: 0.72rem;
  min-height: 1.1rem;
  margin: 0.8rem 0 0;
  text-align: center;
}

.turn-controls {
  align-items: center;
  backdrop-filter: blur(24px);
  background: rgba(7, 20, 17, 0.92);
  border: 1px solid rgba(215, 245, 66, 0.2);
  border-radius: 1rem;
  bottom: 1.25rem;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
  display: grid;
  gap: 0.8rem;
  grid-template-columns: minmax(8rem, 1fr) auto minmax(8rem, 1fr) auto;
  left: 50%;
  max-width: min(58rem, calc(100vw - 2rem));
  padding: 0.75rem;
  position: fixed;
  transform: translateX(-50%);
  width: max-content;
  z-index: 25;
}

.turn-controls[hidden] {
  display: none;
}

.local-player-readout strong,
.local-player-readout span {
  display: block;
}

.local-player-readout strong {
  font-size: 0.78rem;
  margin-top: 0.2rem;
}

.local-player-readout span,
.turn-action-status {
  color: var(--muted);
  font: 0.58rem "DM Mono", monospace;
  margin: 0.15rem 0 0;
}

.dice-readout {
  align-items: center;
  display: grid;
  gap: 0.3rem;
  grid-template-columns: repeat(2, 2.25rem);
}

.dice-readout span {
  align-items: center;
  background: #e8e5d9;
  border-radius: 0.48rem;
  color: #152019;
  display: flex;
  font: 800 1rem "DM Mono", monospace;
  height: 2.25rem;
  justify-content: center;
}

.dice-readout strong {
  color: var(--acid);
  font: 0.55rem "DM Mono", monospace;
  grid-column: 1 / -1;
  text-align: center;
  text-transform: uppercase;
}

.property-offer span,
.property-offer strong,
.property-offer small {
  display: block;
}

.property-offer span,
.property-offer small {
  color: var(--muted);
  font: 0.52rem "DM Mono", monospace;
  text-transform: uppercase;
}

.property-offer strong {
  font-size: 0.72rem;
  margin: 0.12rem 0;
}

.turn-actions {
  display: flex;
  gap: 0.4rem;
}

.turn-action-status {
  grid-column: 1 / -1;
  text-align: center;
}

.game-over-shell {
  text-align: center;
}

.winner-mark {
  color: var(--acid);
  filter: drop-shadow(0 0 18px rgba(215, 245, 66, 0.35));
  font-size: 2.8rem;
}

.game-over-shell h2 {
  font-size: 1.7rem;
  margin: 0.35rem 0;
}

.game-over-shell > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0.4rem 0 1.25rem;
}

.skip-link {
  background: var(--acid);
  color: #101b16;
  font-weight: 800;
  left: 1rem;
  padding: 0.65rem 1rem;
  position: fixed;
  top: -5rem;
  z-index: 100;
}

.skip-link:focus {
  top: 1rem;
}

.brand-lockup {
  filter: drop-shadow(0 2px 14px rgba(0, 0, 0, 0.35));
  line-height: 1;
}

.brand-kicker,
.eyebrow {
  color: var(--acid);
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  margin: 0;
  text-transform: uppercase;
}

.brand-lockup h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.07em;
  margin: 0.22rem 0 0;
  text-transform: uppercase;
}

.brand-lockup h1 span {
  color: var(--acid);
}

.brand-subtitle {
  color: #a4b4af;
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  margin: 0.35rem 0 0 0.1rem;
  text-transform: uppercase;
}

.status-pill {
  align-items: center;
  backdrop-filter: blur(16px);
  background: rgba(7, 17, 15, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  font-family: "DM Mono", monospace;
  font-size: 0.68rem;
  gap: 0.55rem;
  letter-spacing: 0.08em;
  padding: 0.65rem 0.9rem;
  text-transform: uppercase;
}

.status-dot {
  background: #efb75e;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(239, 183, 94, 0.12);
  height: 0.45rem;
  width: 0.45rem;
}

.status-pill[data-state="connected"] .status-dot {
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(70, 214, 164, 0.12);
}

.status-pill[data-state="disconnected"] .status-dot {
  background: var(--ember);
  box-shadow: 0 0 0 4px rgba(255, 135, 92, 0.12);
}

.social-toggle,
.icon-button {
  align-items: center;
  backdrop-filter: blur(16px);
  background: rgba(7, 17, 15, 0.76);
  border: 1px solid var(--line);
  color: #dce5e1;
  cursor: pointer;
  display: inline-flex;
  font-family: "DM Mono", monospace;
  justify-content: center;
  text-transform: uppercase;
}

.social-toggle {
  border-radius: 999px;
  font-size: 0.66rem;
  gap: 0.45rem;
  letter-spacing: 0.08em;
  min-height: 2.15rem;
  padding: 0.55rem 0.75rem;
}

.social-toggle > span:first-child {
  color: var(--acid);
}

.social-toggle:hover,
.social-toggle:focus-visible,
.icon-button:hover,
.icon-button:focus-visible {
  border-color: rgba(215, 245, 66, 0.48);
  color: var(--acid);
  outline: none;
}

.hud-card,
.turn-card,
.board-legend {
  backdrop-filter: blur(20px);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.hud-card {
  border-radius: 1.15rem;
  padding: 1rem;
}

.hud-heading {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding-bottom: 0.8rem;
}

.hud-card h2,
.turn-card h2 {
  font-size: 0.96rem;
  font-weight: 700;
  margin: 0.25rem 0 0;
}

.count-badge {
  align-items: center;
  background: rgba(215, 245, 66, 0.12);
  border: 1px solid rgba(215, 245, 66, 0.22);
  border-radius: 999px;
  color: var(--acid);
  display: inline-flex;
  font-family: "DM Mono", monospace;
  font-size: 0.7rem;
  height: 1.65rem;
  justify-content: center;
  min-width: 1.65rem;
}

.empty-state {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 0.8rem;
  padding: 1.1rem 0.2rem 0.25rem;
}

.empty-state[hidden] {
  display: none;
}

.empty-state-icon {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  color: var(--acid);
  display: flex;
  flex: 0 0 auto;
  font-size: 1.3rem;
  height: 2.5rem;
  justify-content: center;
  width: 2.5rem;
}

.empty-state strong {
  color: #d5ded9;
  display: block;
  font-size: 0.78rem;
  margin-bottom: 0.15rem;
}

.empty-state p,
.asset-card p,
.turn-card p {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
  margin: 0;
}

.players-list {
  display: grid;
  gap: 0.45rem;
  list-style: none;
  margin: 0.75rem 0 0;
  max-height: min(42vh, 22rem);
  overflow: auto;
  padding: 0;
}

.player-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid transparent;
  border-radius: 0.8rem;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: auto 1fr auto;
  padding: 0.6rem;
}

.player-row.is-current {
  background: rgba(215, 245, 66, 0.07);
  border-color: rgba(215, 245, 66, 0.2);
}

.player-monogram,
.turn-content > span {
  align-items: center;
  background: var(--player-color, var(--acid));
  border-radius: 0.6rem;
  color: #102019;
  display: flex;
  font-size: 0.72rem;
  font-weight: 800;
  height: 2rem;
  justify-content: center;
  width: 2rem;
}

.player-meta strong {
  display: block;
  font-size: 0.72rem;
}

.player-meta span,
.player-balance span {
  color: var(--muted);
  display: block;
  font-family: "DM Mono", monospace;
  font-size: 0.58rem;
  margin-top: 0.15rem;
  text-transform: uppercase;
}

.player-balance {
  font-family: "DM Mono", monospace;
  font-size: 0.68rem;
  text-align: right;
}

.asset-icon {
  align-items: center;
  background: rgba(70, 214, 164, 0.1);
  border: 1px solid rgba(70, 214, 164, 0.18);
  border-radius: 0.75rem;
  color: var(--mint);
  display: flex;
  font-size: 1.35rem;
  height: 2.65rem;
  justify-content: center;
  width: 2.65rem;
}

.asset-path {
  background: rgba(0, 0, 0, 0.16);
  border-radius: 0.75rem;
  margin-top: 0.9rem;
  padding: 0.7rem;
}

.asset-path span {
  color: var(--muted);
  display: block;
  font-size: 0.58rem;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
}

.asset-path code {
  color: #bfd0ca;
  display: block;
  font-family: "DM Mono", monospace;
  font-size: 0.58rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-legend {
  border-radius: 999px;
  color: #b4c2bd;
  font-family: "DM Mono", monospace;
  font-size: 0.58rem;
  gap: 1rem;
  padding: 0.7rem 1rem;
  text-transform: uppercase;
}

.board-legend span {
  align-items: center;
  display: flex;
  gap: 0.4rem;
}

.board-legend i {
  border-radius: 0.18rem;
  display: inline-block;
  height: 0.55rem;
  width: 0.55rem;
}

.legend-property {
  background: #d5caa7;
}

.legend-event {
  background: var(--ember);
}

.legend-player {
  background: var(--acid);
  border-radius: 50% !important;
}

.legend-minion {
  background: #b7352c;
  border: 1px solid #ff8b78;
  border-radius: 50% !important;
}

.turn-card {
  border-radius: 1rem;
  min-width: min(20rem, 88vw);
  padding: 0.8rem 1rem;
}

.turn-content {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  margin-top: 0.55rem;
}

.turn-content > span {
  height: 2.4rem;
  width: 2.4rem;
}

.social-panel {
  backdrop-filter: blur(24px);
  background: rgba(7, 18, 16, 0.96);
  border: 1px solid rgba(217, 242, 230, 0.14);
  border-radius: 1.2rem;
  bottom: 1.5rem;
  box-shadow: -24px 22px 70px rgba(0, 0, 0, 0.38);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: fixed;
  right: 1.5rem;
  top: 7rem;
  transform: translateX(calc(100% + 2rem));
  transition:
    transform 220ms ease,
    visibility 220ms;
  visibility: hidden;
  width: min(23rem, calc(100vw - 2rem));
  z-index: 40;
}

.social-panel[data-open="true"] {
  transform: translateX(0);
  visibility: visible;
}

.social-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 1rem 1rem 0.85rem;
}

.social-header h2 {
  font-size: 1.05rem;
  margin: 0.22rem 0 0;
}

.icon-button {
  border-radius: 0.7rem;
  font-family: "Manrope", sans-serif;
  font-size: 1.35rem;
  height: 2.2rem;
  width: 2.2rem;
}

.voice-section,
.chat-section {
  padding: 0.9rem 1rem;
}

.voice-section {
  border-bottom: 1px solid var(--line);
}

.social-section-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.social-section-heading h3 {
  font-size: 0.78rem;
  margin: 0.2rem 0 0;
}

.voice-button {
  align-items: center;
  background: rgba(70, 214, 164, 0.08);
  border: 1px solid rgba(70, 214, 164, 0.2);
  border-radius: 0.75rem;
  color: #d7e3de;
  cursor: pointer;
  display: flex;
  font-size: 0.68rem;
  font-weight: 700;
  gap: 0.6rem;
  margin-top: 0.7rem;
  padding: 0.68rem 0.75rem;
  text-align: left;
  width: 100%;
}

.voice-button i {
  background: var(--mint);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(70, 214, 164, 0.1);
  height: 0.48rem;
  width: 0.48rem;
}

.voice-button[data-state="active"] {
  background: rgba(255, 102, 85, 0.1);
  border-color: rgba(255, 102, 85, 0.3);
}

.voice-button[data-state="active"] i {
  background: #ff6655;
  box-shadow: 0 0 0 4px rgba(255, 102, 85, 0.12);
}

.voice-button:focus-visible,
.voice-button:hover {
  border-color: rgba(215, 245, 66, 0.5);
  outline: none;
}

.voice-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.social-helper {
  color: var(--muted);
  font-size: 0.58rem;
  line-height: 1.4;
  margin: 0.5rem 0 0;
}

.voice-participants {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0.6rem 0 0;
  max-height: 9.5rem;
  overflow: auto;
  padding: 0;
}

.voice-participants li {
  align-items: center;
  background: rgba(255, 255, 255, 0.035);
  border-radius: 999px;
  display: flex;
  font-size: 0.58rem;
  gap: 0.35rem;
  padding: 0.32rem 0.48rem;
}

.voice-participant-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-action {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #c9d1ce;
  cursor: pointer;
  font-family: "DM Mono", monospace;
  font-size: 0.46rem;
  padding: 0.2rem 0.34rem;
}

.participant-action:hover,
.participant-action:focus-visible {
  border-color: rgba(215, 245, 66, 0.55);
  color: #fff;
  outline: none;
}

.participant-action.is-muted {
  border-color: rgba(255, 102, 85, 0.45);
  color: #ffb5ad;
}

.voice-participants small {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.48rem;
}

.voice-dot {
  background: #5d6c67;
  border-radius: 50%;
  height: 0.38rem;
  width: 0.38rem;
}

.voice-dot.is-live {
  background: var(--mint);
  box-shadow: 0 0 0 3px rgba(70, 214, 164, 0.1);
}

.settings-dialog,
.report-dialog {
  background: #171825;
  border: 1px solid rgba(215, 245, 66, 0.2);
  border-radius: 1rem;
  color: #f4f2eb;
  max-height: min(90vh, 760px);
  padding: 0;
  width: min(92vw, 720px);
}

.settings-dialog::backdrop,
.report-dialog::backdrop {
  background: rgba(8, 8, 14, 0.78);
  backdrop-filter: blur(5px);
}

.settings-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.1rem;
}

.settings-header h2,
.settings-section h3 {
  margin: 0.2rem 0 0;
}

.settings-content {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: calc(90vh - 9rem);
  overflow: auto;
  padding: 1rem 1.1rem;
}

.settings-section {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 0.9rem;
}

.settings-section-heading {
  align-items: center;
  display: flex;
  gap: 0.65rem;
  margin-bottom: 0.8rem;
}

.settings-section-heading > span {
  align-items: center;
  background: rgba(215, 245, 66, 0.08);
  border-radius: 0.65rem;
  color: var(--acid);
  display: flex;
  font-size: 1rem;
  height: 2.2rem;
  justify-content: center;
  width: 2.2rem;
}

.settings-section-heading p,
.settings-range small,
.report-content small {
  color: var(--muted);
  font-size: 0.58rem;
  line-height: 1.45;
  margin: 0.16rem 0 0;
}

.settings-range {
  display: grid;
  gap: 0.32rem;
  margin-top: 0.75rem;
}

.settings-select {
  display: grid;
  gap: 0.42rem;
  margin-top: 0.75rem;
}

.settings-select > span {
  font-size: 0.66rem;
}

.settings-select select {
  background: #202133;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  color: #f4f2eb;
  padding: 0.62rem 0.7rem;
  width: 100%;
}

.settings-select small {
  color: var(--muted);
  font-size: 0.58rem;
  line-height: 1.45;
}

.settings-range > span {
  align-items: center;
  display: flex;
  font-size: 0.66rem;
  justify-content: space-between;
}

.settings-range output {
  color: var(--acid);
  font-family: "DM Mono", monospace;
  font-size: 0.58rem;
}

.settings-range input[type="range"] {
  accent-color: var(--acid);
  cursor: pointer;
  width: 100%;
}

.settings-actions {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
  padding: 0.85rem 1.1rem;
}

.report-dialog {
  width: min(92vw, 520px);
}

.report-content {
  display: grid;
  gap: 0.55rem;
  padding: 1rem 1.1rem;
}

.report-content > p {
  font-size: 0.68rem;
  line-height: 1.5;
  margin: 0 0 0.3rem;
}

.report-content label {
  font-size: 0.62rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.report-content select,
.report-content textarea {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  color: #f4f2eb;
  font: 0.66rem/1.45 "Manrope", sans-serif;
  padding: 0.65rem;
}

.report-content option {
  background: #171825;
}

.report-content select:focus,
.report-content textarea:focus {
  border-color: rgba(215, 245, 66, 0.55);
  outline: none;
}

.danger-action {
  background: rgba(255, 102, 85, 0.16);
  border: 1px solid rgba(255, 102, 85, 0.45);
  border-radius: 0.65rem;
  color: #ffd4cf;
  cursor: pointer;
  font-weight: 800;
  padding: 0.65rem 0.9rem;
}

.report-error {
  color: #ff8c80;
}

@media (max-width: 640px) {
  .settings-content {
    grid-template-columns: 1fr;
  }

  .settings-actions {
    justify-content: stretch;
  }

  .settings-actions button {
    flex: 1;
  }
}

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

.identity-label {
  color: #aab9b4;
  font-family: "DM Mono", monospace;
  font-size: 0.54rem;
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-scroll {
  flex: 1;
  min-height: 5rem;
  overflow: hidden;
  position: relative;
}

.chat-empty {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  font-size: 0.62rem;
  inset: 0;
  justify-content: center;
  line-height: 1.45;
  padding: 1rem 2rem;
  position: absolute;
  text-align: center;
}

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

.chat-empty span {
  color: var(--acid);
  font-size: 1.25rem;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  height: 100%;
  list-style: none;
  margin: 0.7rem 0;
  overflow-y: auto;
  padding: 0 0.2rem 0 0;
}

.chat-message {
  background: rgba(255, 255, 255, 0.035);
  border-left: 2px solid var(--mint);
  border-radius: 0.15rem 0.65rem 0.65rem 0.15rem;
  padding: 0.5rem 0.6rem;
}

.chat-message.is-system {
  background: rgba(215, 245, 66, 0.045);
  border-left-color: var(--acid);
}

.chat-message > div {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.chat-message strong {
  color: #d8e2de;
  font-size: 0.62rem;
}

.chat-message time {
  color: #64756f;
  font-family: "DM Mono", monospace;
  font-size: 0.48rem;
}

.chat-message p {
  color: #aebdb8;
  font-size: 0.62rem;
  line-height: 1.42;
  margin: 0.25rem 0 0;
  overflow-wrap: anywhere;
}

.chat-form {
  align-items: stretch;
  display: flex;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.chat-form input {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  color: var(--ink);
  flex: 1;
  font: 0.68rem "Manrope", sans-serif;
  min-width: 0;
  padding: 0.65rem 0.7rem;
}

.chat-form input::placeholder {
  color: #64756f;
}

.chat-form input:focus {
  border-color: rgba(215, 245, 66, 0.45);
  outline: none;
}

.chat-form button {
  background: var(--acid);
  border: 0;
  border-radius: 0.7rem;
  color: #142019;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
  width: 2.55rem;
}

.chat-form button:focus-visible,
.chat-form button:hover {
  box-shadow: 0 0 0 3px rgba(215, 245, 66, 0.2);
  outline: none;
}

.social-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  color: #667872;
  display: flex;
  font-family: "DM Mono", monospace;
  font-size: 0.46rem;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  text-transform: uppercase;
}

.social-footer > div {
  align-items: center;
  display: flex;
  gap: 0.35rem;
}

.social-footer i {
  background: #53635e;
  border-radius: 50%;
  height: 0.38rem;
  width: 0.38rem;
}

.social-footer [data-connected="true"] {
  color: var(--mint);
}

.social-footer [data-connected="true"] i {
  background: var(--mint);
}

.async-panel {
  backdrop-filter: blur(24px);
  background: rgba(7, 18, 16, 0.96);
  border: 1px solid rgba(217, 242, 230, 0.14);
  border-radius: 1.2rem;
  box-shadow: 24px 22px 70px rgba(0, 0, 0, 0.38);
  left: 1.5rem;
  overflow: hidden;
  position: fixed;
  top: 7rem;
  transform: translateX(calc(-100% - 2rem));
  transition:
    transform 220ms ease,
    visibility 220ms;
  visibility: hidden;
  width: min(22rem, calc(100vw - 2rem));
  z-index: 40;
}

.async-panel[data-open="true"] {
  transform: translateX(0);
  visibility: visible;
}

.bingo-section,
.duel-shortcuts {
  padding: 1rem;
}

.bingo-section {
  border-bottom: 1px solid var(--line);
}

.bingo-ball {
  align-items: center;
  background: var(--acid);
  border-radius: 50%;
  color: #172019;
  display: inline-flex;
  font: 800 0.8rem "DM Mono", monospace;
  height: 2.25rem;
  justify-content: center;
  width: 2.25rem;
}

.bingo-metrics {
  color: var(--muted);
  display: flex;
  font: 0.56rem "DM Mono", monospace;
  justify-content: space-between;
  margin: 0.9rem 0 0.65rem;
  text-transform: uppercase;
}

.bingo-metrics strong {
  color: var(--ink);
}

.bingo-grid {
  display: grid;
  gap: 0.32rem;
  grid-template-columns: repeat(5, 1fr);
  min-height: 10rem;
}

.bingo-grid > span {
  align-items: center;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 0.48rem;
  color: #b9c7c2;
  display: flex;
  font: 600 0.68rem "DM Mono", monospace;
  justify-content: center;
  min-height: 2.2rem;
}

.bingo-grid > span[data-drawn="true"] {
  background: rgba(70, 214, 164, 0.16);
  border-color: rgba(70, 214, 164, 0.4);
  color: #8ce8c7;
}

.bingo-grid > span[data-completed="true"] {
  background: var(--acid);
  border-color: var(--acid);
  color: #172019;
}

.mini-helper,
.duel-shortcuts p {
  color: var(--muted);
  font-size: 0.6rem;
  line-height: 1.45;
  margin: 0.65rem 0 0;
}

.duel-shortcuts h3 {
  font-size: 0.78rem;
  margin: 0.2rem 0 0;
}

.minigame-dialog {
  background: transparent;
  border: 0;
  color: var(--ink);
  max-height: calc(100vh - 2rem);
  max-width: calc(100vw - 2rem);
  margin: auto;
  padding: 0;
  width: min(31rem, calc(100vw - 2rem));
}

.minigame-dialog::backdrop {
  backdrop-filter: blur(5px);
  background: rgba(2, 8, 7, 0.7);
}

.modal-shell {
  background:
    linear-gradient(145deg, rgba(16, 38, 32, 0.98), rgba(7, 18, 16, 0.99));
  border: 1px solid rgba(215, 245, 66, 0.18);
  border-radius: 1.15rem;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.56);
  overflow: hidden;
}

.hot-shell {
  border-color: rgba(255, 135, 92, 0.28);
}

.modal-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 1rem;
}

.modal-header h2 {
  font-size: 1.12rem;
  margin: 0.22rem 0 0;
}

.modal-content {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
}

.minigame-status {
  color: #c2cec9;
  font-size: 0.7rem;
  line-height: 1.5;
  margin: 0;
}

.trump-readout {
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
}

.trump-readout span,
.field-label,
.charge-value {
  color: var(--muted);
  font: 0.56rem "DM Mono", monospace;
  text-transform: uppercase;
}

.trump-readout strong {
  color: var(--acid);
  font: 700 0.8rem "DM Mono", monospace;
}

.field-label {
  display: block;
  margin-bottom: 0.4rem;
}

.liars-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-height: 4.5rem;
}

.liars-card {
  background: #eae7db;
  border: 2px solid transparent;
  border-radius: 0.62rem;
  color: #172019;
  cursor: pointer;
  font: 800 0.76rem "DM Mono", monospace;
  height: 4.2rem;
  min-width: 3rem;
  padding: 0.5rem;
  transform: translateY(0);
  transition: transform 120ms ease;
}

.liars-card[data-selected="true"] {
  border-color: var(--acid);
  box-shadow: 0 0 0 3px rgba(215, 245, 66, 0.14);
  transform: translateY(-0.28rem);
}

.liars-card:disabled {
  cursor: default;
  opacity: 0.62;
}

.modal-actions {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: 1.4fr 1fr 1fr;
}

.primary-action,
.secondary-action,
.danger-action {
  border-radius: 0.7rem;
  cursor: pointer;
  font: 700 0.65rem "Manrope", sans-serif;
  min-height: 2.65rem;
  padding: 0.65rem 0.75rem;
}

.primary-action {
  background: var(--acid);
  border: 1px solid var(--acid);
  color: #172019;
}

.secondary-action {
  background: rgba(70, 214, 164, 0.1);
  border: 1px solid rgba(70, 214, 164, 0.3);
  color: #a1ebd0;
}

.danger-action {
  background: rgba(255, 135, 92, 0.12);
  border: 1px solid rgba(255, 135, 92, 0.35);
  color: #ffb095;
}

.primary-action:disabled,
.secondary-action:disabled,
.danger-action:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.primary-action:focus-visible,
.secondary-action:focus-visible,
.danger-action:focus-visible,
.liars-card:focus-visible {
  box-shadow: 0 0 0 3px rgba(215, 245, 66, 0.24);
  outline: none;
}

.target-select {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  border-radius: 0.72rem;
  color: var(--ink);
  width: 100%;
}

.target-select:focus {
  border-color: rgba(215, 245, 66, 0.55);
  outline: none;
}

.code-picker {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(var(--code-length, 3), minmax(0, 1fr));
  outline: none;
}

.code-picker button[data-locked="true"] {
  background: rgba(70, 214, 164, 0.18);
  border-color: var(--mint);
  color: #9ff0d2;
  opacity: 1;
}

.invasion-metrics {
  display: grid;
  gap: 0.4rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.invasion-metrics span {
  background: rgba(255, 255, 255, 0.045);
  border-radius: 0.55rem;
  color: var(--muted);
  font: 0.52rem "DM Mono", monospace;
  padding: 0.55rem;
}

.invasion-metrics strong {
  color: var(--ink);
  display: block;
  font-size: 0.62rem;
  margin-top: 0.2rem;
}

.invasion-actions {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1.2fr 1fr;
}

.invasion-hints {
  background: rgba(246, 196, 83, 0.08);
  border: 1px solid rgba(246, 196, 83, 0.22);
  border-radius: 0.7rem;
  padding: 0.7rem;
}

.invasion-hints > strong {
  color: #f6c453;
  font: 700 0.58rem "DM Mono", monospace;
}

.invasion-hints ul {
  color: #e8dfca;
  font-size: 0.62rem;
  line-height: 1.45;
  margin: 0.45rem 0 0;
  padding-left: 1.1rem;
}

.invasion-resume-card {
  align-items: center;
  background: rgba(104, 212, 197, 0.09);
  border: 1px solid rgba(104, 212, 197, 0.24);
  border-radius: 0.7rem;
  display: flex;
  gap: 0.65rem;
  justify-content: space-between;
  margin-top: 0.65rem;
  padding: 0.65rem;
}

.invasion-resume-card strong,
.invasion-resume-card span {
  display: block;
}

.invasion-resume-card strong {
  color: #b6f3dc;
  font-size: 0.65rem;
}

.invasion-resume-card span {
  color: var(--muted);
  font-size: 0.56rem;
  margin-top: 0.2rem;
}

.code-picker button {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  color: var(--ink);
  font: 800 2rem "DM Mono", monospace;
  min-height: 4.3rem;
}

.code-picker button[data-selected="true"] {
  background: rgba(215, 245, 66, 0.13);
  border-color: var(--acid);
  box-shadow: 0 0 0 3px rgba(215, 245, 66, 0.17);
  color: var(--acid);
  transform: translateY(-0.12rem);
}

.code-picker[data-disabled="true"] button:not([data-locked="true"]) {
  opacity: 0.45;
}

.controller-hint {
  color: var(--muted);
  font: 0.57rem/1.5 "DM Mono", monospace;
  margin: -0.25rem 0 0;
  text-align: center;
}

.invasion-feedback {
  background: rgba(70, 214, 164, 0.08);
  border-left: 2px solid var(--mint);
  border-radius: 0.2rem 0.65rem 0.65rem 0.2rem;
  color: #a9d9c8;
  font: 0.62rem/1.5 "DM Mono", monospace;
  min-height: 2.6rem;
  padding: 0.65rem 0.75rem;
}

.charge-meter {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: 999px;
  height: 0.8rem;
  overflow: hidden;
}

.charge-meter i {
  background: linear-gradient(90deg, #efc458, var(--ember));
  display: block;
  height: 100%;
  transition: width 180ms ease;
  width: 0;
}

.charge-value {
  margin: -0.35rem 0 0;
}

.charge-value strong {
  color: #ffc1aa;
}

.charge-action {
  min-height: 4.2rem;
  text-transform: uppercase;
}

.target-select {
  font: 0.68rem "Manrope", sans-serif;
  padding: 0.7rem;
}

.sr-only {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.fatal-error,
.noscript-message {
  background: #471d18;
  border: 1px solid #a74b3d;
  color: #ffe7df;
  left: 50%;
  padding: 1rem 1.25rem;
  position: fixed;
  text-align: center;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
}

.fatal-error strong,
.fatal-error span {
  display: block;
}

.fatal-error span {
  font-size: 0.75rem;
  margin-top: 0.35rem;
}

@media (max-width: 640px) {
  .brand-subtitle,
  .asset-card {
    display: none;
  }

  .hud-card {
    padding: 0.8rem;
  }

  .players-list {
    max-height: 30vh;
  }

  .turn-card {
    padding: 0.7rem 0.8rem;
  }

  .social-panel {
    bottom: 0.75rem;
    right: 0.75rem;
    top: 5.7rem;
    width: calc(100vw - 1.5rem);
  }

  .async-panel {
    left: 0.75rem;
    top: 5.7rem;
    width: calc(100vw - 1.5rem);
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }

  .status-pill {
    padding-inline: 0.7rem;
  }

  .social-footer > span {
    display: none;
  }

  .turn-controls {
    bottom: 0.6rem;
    grid-template-columns: 1fr auto;
    width: calc(100vw - 1.2rem);
  }

  .property-offer,
  .turn-actions {
    grid-column: 1 / -1;
  }

  .turn-actions > button {
    flex: 1;
  }
}

/* Exploration mode, local-player actions, and the responsive property dossier */
.camera-mode-toggle[hidden] {
  display: none;
}

.camera-mode-toggle[data-active="true"] {
  background: #f6c453;
  border-color: #f6c453;
  color: #292942;
}

.exploration-controls {
  align-items: center;
  backdrop-filter: blur(14px);
  background: rgba(31, 29, 49, 0.92);
  border: 1px solid rgba(255, 248, 233, 0.18);
  border-radius: 1rem;
  bottom: 1rem;
  color: #fff7e6;
  display: flex;
  gap: 1rem;
  left: 50%;
  opacity: 0;
  padding: 0.65rem 0.8rem;
  position: fixed;
  transform: translate(-50%, calc(100% + 2rem));
  transition: opacity 180ms ease, transform 220ms ease;
  visibility: hidden;
  z-index: 29;
}

.exploration-controls[data-active="true"] {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
}

.exploration-controls > div:first-child {
  display: grid;
  gap: 0.12rem;
}

.exploration-controls strong {
  color: #f6c453;
  font-size: 0.72rem;
}

.exploration-controls span {
  color: #b6b3c4;
  font: 0.48rem "DM Mono", monospace;
  white-space: nowrap;
}

.repair-interaction {
  background: linear-gradient(135deg, #f6c453, #ef8b45);
  border: 0;
  border-radius: 0.72rem;
  color: #29233a;
  cursor: pointer;
  font-size: 0.64rem;
  font-weight: 900;
  max-width: 15rem;
  padding: 0.62rem 0.78rem;
}

.repair-interaction[hidden] {
  display: none;
}

.exploration-pad {
  display: none;
  grid-template-columns: repeat(3, 2.25rem);
  grid-template-rows: repeat(2, 2.25rem);
  touch-action: none;
}

.exploration-pad button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff7e6;
  cursor: pointer;
}

.exploration-pad [data-move="forward"] {
  grid-column: 2;
}

.exploration-pad [data-jump] {
  background: rgba(246, 196, 83, 0.18);
  border-color: rgba(246, 196, 83, 0.48);
  color: #f6c453;
  grid-column: 3;
  grid-row: 1;
}

.exploration-pad [data-move="left"] {
  grid-column: 1;
}

.exploration-pad [data-move="backward"] {
  grid-column: 2;
}

.exploration-pad [data-move="right"] {
  grid-column: 3;
}

.player-row.is-local {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "avatar meta balance"
    "avatar meta leave";
}

.player-row.is-local .player-monogram {
  grid-area: avatar;
}

.player-row.is-local .player-meta {
  grid-area: meta;
  min-width: 0;
}

.player-row.is-local .player-balance {
  grid-area: balance;
}

.player-class-benefit {
  color: #f6c453;
  display: block;
  font: 600 0.5rem/1.35 "DM Mono", monospace;
  margin-top: 0.3rem;
}

.player-leave-action {
  align-self: end;
  background: transparent;
  border: 0;
  color: #f58b78;
  cursor: pointer;
  font: 800 0.5rem "DM Mono", monospace;
  grid-area: leave;
  justify-self: end;
  padding: 0.2rem 0;
  text-decoration: underline;
  text-underline-offset: 0.15rem;
}

.space-inspector {
  display: block;
  max-height: min(74vh, 34rem);
  overflow: auto;
  padding: 1rem;
}

.space-inspector-header {
  align-items: center;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: 4.4rem minmax(0, 1fr);
  padding-right: 1.7rem;
}

.space-inspector-body {
  margin-top: 0.85rem;
}

.space-inspector-body > p {
  background: #eee5d5;
  border-left: 0.22rem solid #f6c453;
  border-radius: 0.55rem;
  padding: 0.65rem 0.7rem;
}

.space-inspector[data-type="market"] .space-number {
  background: #68d4c5;
}

.space-inspector[data-type="duel"] .space-number {
  background: #ff7964;
}

.space-inspector[data-type="fork"] .space-number,
.space-inspector[data-type="premium"] .space-number {
  background: #ffbd54;
}

body[data-camera-mode="explore"] .players-card,
body[data-camera-mode="explore"] .board-legend,
body[data-camera-mode="explore"] .turn-card,
body[data-camera-mode="explore"] .turn-controls {
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.75rem);
  transition:
    opacity 180ms ease,
    transform 220ms ease,
    visibility 0s linear 220ms;
  visibility: hidden;
}

body[data-camera-mode="explore"] .header-player {
  opacity: 0.35;
}

body[data-camera-mode="explore"] .space-inspector[data-open="true"] {
  bottom: max(7.2rem, calc(env(safe-area-inset-bottom) + 6.5rem));
}

@media (max-width: 760px), (pointer: coarse) {
  .exploration-controls {
    bottom: 0.65rem;
    justify-content: space-between;
    width: calc(100vw - 1.3rem);
  }

  .exploration-pad {
    display: grid;
  }

  .exploration-controls span {
    white-space: normal;
  }
}

@media (max-width: 640px) {
  .camera-mode-toggle > span:last-child {
    display: inline;
  }

  .space-inspector {
    bottom: max(0.7rem, env(safe-area-inset-bottom));
    left: 0.7rem;
    max-height: min(58vh, 28rem);
    max-width: none;
    right: 0.7rem;
    width: auto;
  }

  body[data-camera-mode="explore"] .space-inspector[data-open="true"] {
    bottom: max(8.2rem, calc(env(safe-area-inset-bottom) + 7.5rem));
  }

  .space-inspector-header {
    gap: 0.65rem;
    grid-template-columns: 3.5rem minmax(0, 1fr);
  }

  .space-number {
    height: 3.5rem;
  }

  .space-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .space-metrics div:last-child {
    grid-column: 1 / -1;
  }

  .player-row.is-local {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "avatar meta"
      "leave leave";
  }

  .player-row.is-local .player-balance {
    display: none;
  }

  .player-leave-action {
    justify-self: stretch;
    text-align: right;
  }
}

@media (max-width: 390px) {
  .exploration-controls > div:first-child {
    max-width: 8.5rem;
  }

  .space-metrics {
    grid-template-columns: 1fr;
  }

  .space-metrics div:last-child {
    grid-column: auto;
  }
}

.exit-shell {
  max-width: min(28rem, calc(100vw - 2rem));
}

.exit-shell > p:not(.eyebrow) {
  color: #cbc6d5;
  font-size: 0.72rem;
  line-height: 1.55;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
[role="button"]:focus-visible {
  outline: 0.2rem solid #68d4c5;
  outline-offset: 0.16rem;
}

/* Interactive neighborhood drawer and lightweight action dock. */
html,
body {
  height: 100%;
  overflow: hidden;
  width: 100%;
}

body > main {
  inset: 0;
  overflow: hidden;
  position: fixed !important;
}

.header-player {
  border-left: 1px solid rgba(255, 248, 233, 0.16);
  display: grid;
  gap: 0.05rem 0.75rem;
  grid-template-columns: auto auto;
  margin-left: 1rem;
  margin-right: auto;
  padding-left: 1rem;
}

.header-player span {
  color: #fff7e6;
  font-size: 0.68rem;
  font-weight: 900;
}

.header-player strong {
  color: #f6c453;
  font: 700 0.62rem "DM Mono", monospace;
}

.header-player small {
  color: #9f9bad;
  font: 0.48rem "DM Mono", monospace;
  grid-column: 1 / -1;
}

.players-card {
  max-height: calc(100vh - 12rem);
  overflow: hidden;
  transition:
    width 260ms cubic-bezier(.2,.8,.2,1),
    transform 260ms cubic-bezier(.2,.8,.2,1);
}

.players-card .hud-heading {
  grid-template-columns: 1fr auto auto;
}

.neighbors-toggle {
  align-items: center;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  color: #fff7e6;
  cursor: pointer;
  display: flex;
  font-size: 1.25rem;
  height: 1.8rem;
  justify-content: center;
  width: 1.8rem;
}

.players-card[data-collapsed="true"] {
  height: 3.25rem;
  min-width: 3.25rem;
  padding: 0.65rem;
  width: 3.25rem;
}

.players-card[data-collapsed="true"] .hud-heading > div,
.players-card[data-collapsed="true"] .count-badge,
.players-card[data-collapsed="true"] .players-list,
.players-card[data-collapsed="true"] .empty-state,
.players-card[data-collapsed="true"] .neighbor-dossier,
.players-card[data-collapsed="true"] .incoming-offers {
  display: none;
}

.players-card[data-collapsed="true"] .hud-heading {
  display: block;
}

.player-row[role="button"] {
  cursor: pointer;
}

.player-row[role="button"]:hover,
.player-row[role="button"]:focus-visible {
  background: rgba(104, 212, 197, 0.12);
  outline: 1px solid #68d4c5;
}

.neighbor-dossier {
  margin-top: 0.65rem;
  max-height: min(58vh, 31rem);
  overflow: auto;
}

#neighbor-back {
  background: transparent;
  border: 0;
  color: #68d4c5;
  cursor: pointer;
  font: 700 0.55rem "DM Mono", monospace;
  padding: 0 0 0.6rem;
}

#neighbor-profile {
  background: rgba(255,255,255,.05);
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  padding: 0.7rem;
}

#neighbor-profile span,
#neighbor-profile small {
  color: #aaa6b7;
  font: 0.5rem "DM Mono", monospace;
}

#neighbor-profile strong {
  font-size: 0.9rem;
  margin: 0.15rem 0;
}

#neighbor-properties h3 {
  color: #f6c453;
  font: 800 0.56rem "DM Mono", monospace;
  margin: 0.8rem 0 0.45rem;
  text-transform: uppercase;
}

#neighbor-properties > p {
  color: #aaa6b7;
  font-size: 0.62rem;
}

#neighbor-properties article {
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 0.7rem;
  margin-bottom: 0.45rem;
  padding: 0.6rem;
}

#neighbor-properties article > div:first-child,
#neighbor-properties article strong,
#neighbor-properties article small {
  display: block;
}

#neighbor-properties article small {
  color: #aaa6b7;
  font-size: 0.5rem;
}

#neighbor-properties article > div:last-child {
  display: grid;
  gap: 0.35rem;
  grid-template-columns: 1fr auto;
  margin-top: 0.5rem;
}

#neighbor-properties input {
  background: #171625;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 0.45rem;
  color: #fff7e6;
  min-width: 0;
  padding: 0.45rem;
}

#neighbor-properties button,
.incoming-offers button {
  background: #f6c453;
  border: 0;
  border-radius: 0.45rem;
  color: #292942;
  cursor: pointer;
  font-size: 0.55rem;
  font-weight: 900;
  padding: 0.45rem 0.55rem;
}

.danger-action {
  background: #ef684d;
  border: 0;
  border-radius: 0.6rem;
  color: #fff;
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 900;
  margin-top: 0.45rem;
  padding: 0.65rem;
  width: 100%;
}

.danger-action:disabled {
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: 0.38;
}

.incoming-offers {
  border-top: 1px solid rgba(246,196,83,.25);
  margin-top: 0.65rem;
  padding-top: 0.65rem;
}

.incoming-offers article {
  background: rgba(246,196,83,.08);
  border-radius: 0.65rem;
  padding: 0.6rem;
}

.incoming-offers p {
  font-size: 0.58rem;
  margin: 0 0 0.45rem;
}

.incoming-offers article div {
  display: flex;
  gap: 0.35rem;
}

.narrative-stack {
  display: grid;
  gap: 0.65rem;
  max-width: min(25rem, calc(100vw - 2rem));
  pointer-events: none;
  position: fixed;
  right: 1rem;
  top: 5.5rem;
  width: 100%;
  z-index: 56;
}

.narrative-card {
  --class-color: #f6c453;
  align-items: start;
  animation: narrative-arrive 240ms ease-out both;
  background: linear-gradient(145deg, rgba(42, 39, 63, 0.98), rgba(25, 24, 42, 0.98));
  border: 1px solid color-mix(in srgb, var(--class-color) 48%, rgba(255, 255, 255, 0.12));
  border-left: 0.32rem solid var(--class-color);
  border-radius: 0.85rem;
  box-shadow: 0 1rem 2.8rem rgba(0, 0, 0, 0.4);
  color: #fff7e6;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: auto 1fr auto;
  padding: 0.75rem;
  pointer-events: auto;
  transition: opacity 180ms ease, transform 180ms ease;
}

.narrative-card[data-kind="district"] {
  --class-color: #f6c453;
}

.narrative-card[data-kind="conflict"]:not([data-class]) {
  --class-color: #ef684d;
}

.narrative-card[data-leaving="true"] {
  opacity: 0;
  transform: translateX(1rem);
}

.narrative-card[data-presentation="hero"] {
  border-width: 2px;
  left: 50%;
  max-width: min(38rem, calc(100vw - 2rem));
  padding: 1.15rem;
  position: fixed;
  top: 42vh;
  transform: translate(-50%, -50%);
  width: 100%;
}

.narrative-card[data-presentation="hero"][data-leaving="true"] {
  transform: translate(-50%, calc(-50% - 1rem));
}

.narrative-card[data-presentation="hero"] .narrative-mark {
  height: 3rem;
  width: 3rem;
}

.narrative-card[data-presentation="hero"] strong {
  font-size: 0.78rem;
}

.narrative-card[data-presentation="hero"] p {
  font-size: 0.82rem;
}

.narrative-mark {
  align-items: center;
  background: var(--class-color);
  border-radius: 0.55rem;
  color: #252035;
  display: flex;
  font: 900 0.72rem "Bricolage Grotesque", sans-serif;
  height: 2rem;
  justify-content: center;
  width: 2rem;
}

.narrative-card strong {
  color: var(--class-soft, #ffeab5);
  display: block;
  font: 800 0.58rem "DM Mono", monospace;
  letter-spacing: 0.06em;
}

.narrative-card p {
  color: #f3edf8;
  font-size: 0.68rem;
  line-height: 1.4;
  margin: 0.18rem 0 0;
}

.narrative-card small {
  color: #aaa5b4;
  display: block;
  font-size: 0.55rem;
  margin-top: 0.35rem;
}

.narrative-dismiss {
  background: transparent;
  color: #aaa5b4;
  font-size: 1rem;
  line-height: 1;
  padding: 0.1rem;
}

.narrative-toggle {
  position: relative;
}

.narrative-badge {
  align-items: center;
  background: #ef684d;
  border: 2px solid #292942;
  border-radius: 999px;
  color: #fff;
  display: flex;
  font-size: 0.48rem;
  height: 1rem;
  justify-content: center;
  min-width: 1rem;
  padding: 0 0.18rem;
  position: absolute;
  right: -0.22rem;
  top: -0.28rem;
}

.narrative-badge[hidden] {
  display: none;
}

.narrative-panel {
  background: linear-gradient(160deg, rgba(35, 32, 53, 0.99), rgba(20, 20, 35, 0.99));
  border-left: 1px solid rgba(246, 196, 83, 0.28);
  box-shadow: -1.2rem 0 3rem rgba(0, 0, 0, 0.38);
  color: #fff7e6;
  height: 100vh;
  max-width: min(28rem, 94vw);
  overflow-y: auto;
  padding: 1rem;
  position: fixed;
  right: 0;
  top: 0;
  transform: translateX(102%);
  transition: transform 220ms ease;
  width: 100%;
  z-index: 70;
}

.narrative-panel[data-open="true"] {
  transform: translateX(0);
}

.narrative-panel-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.narrative-panel-header h2 {
  font: 800 1.35rem "Bricolage Grotesque", sans-serif;
  margin: 0.1rem 0 0;
}

.narrative-panel-intro,
.narrative-empty {
  color: #aaa5b4;
  font-size: 0.65rem;
  line-height: 1.45;
}

.narrative-history {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.narrative-history .narrative-card {
  animation: none;
  box-shadow: none;
}

.contract-tracker {
  border-top: 1px solid rgba(246, 196, 83, 0.22);
  margin-top: 0.65rem;
  padding-top: 0.55rem;
}

.contract-tracker[hidden] {
  display: none;
}

.contract-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.contract-heading strong {
  color: #f6c453;
  font: 800 0.55rem "DM Mono", monospace;
  text-transform: uppercase;
}

.contract-heading small {
  color: #aaa5b4;
  font-size: 0.48rem;
}

.contract-tracker[data-audit="true"] .contract-heading small {
  color: #ff9d87;
  font-weight: 800;
}

.contract-seals {
  display: grid;
  gap: 0.32rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0.42rem;
}

.contract-seals > span {
  align-items: center;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.48rem;
  display: grid;
  gap: 0.04rem 0.28rem;
  grid-template-columns: auto 1fr;
  padding: 0.32rem;
}

.contract-seals b {
  color: #8f899b;
  grid-row: 1 / 3;
}

.contract-seals small,
.contract-seals em {
  font-size: 0.42rem;
  min-width: 0;
}

.contract-seals small {
  color: #d4ceda;
  font-weight: 800;
}

.contract-seals em {
  color: #928d9d;
  font-style: normal;
}

.contract-seals > span[data-complete="true"] {
  background: rgba(104, 212, 197, 0.12);
  border-color: rgba(104, 212, 197, 0.32);
}

.contract-seals > span[data-complete="true"] b,
.contract-seals > span[data-complete="true"] em {
  color: #68d4c5;
}

.game-over-stats {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0.85rem 0;
}

.game-over-stats article {
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(246, 196, 83, 0.18);
  border-radius: 0.65rem;
  display: grid;
  padding: 0.55rem;
}

.game-over-stats small {
  color: #aaa5b4;
  font-size: 0.46rem;
  text-transform: uppercase;
}

.game-over-stats strong {
  color: #fff7e6;
  font-size: 0.68rem;
  margin-top: 0.12rem;
}

.game-over-stats span {
  color: #f6c453;
  font: 700 0.5rem "DM Mono", monospace;
}

@keyframes narrative-arrive {
  from {
    opacity: 0;
    transform: translateX(1rem);
  }
}

.first-match-coach {
  backdrop-filter: blur(18px);
  background:
    linear-gradient(145deg, rgba(31, 29, 49, 0.97), rgba(18, 18, 34, 0.96));
  border: 1px solid rgba(246, 196, 83, 0.35);
  border-radius: 1rem;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  color: #fff7e6;
  display: grid;
  gap: 0.85rem;
  left: 1.25rem;
  max-width: min(34rem, calc(100vw - 2rem));
  padding: 1rem;
  position: fixed;
  top: 5.6rem;
  transform: none;
  width: min(34rem, calc(100vw - 2rem));
  z-index: 42;
}

.first-match-coach[hidden] {
  display: none;
}

.progression-toast {
  background: rgba(37, 31, 66, 0.96);
  border: 1px solid rgba(173, 162, 255, 0.5);
  border-radius: 999px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.38);
  color: #f0ebff;
  font: 700 0.7rem "DM Mono", monospace;
  left: 50%;
  opacity: 0;
  padding: 0.62rem 0.9rem;
  pointer-events: none;
  position: fixed;
  top: 5.25rem;
  transform: translate(-50%, -0.6rem);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 41;
}

.progression-toast[data-active="true"] {
  opacity: 1;
  transform: translate(-50%, 0);
}

.property-decision-metrics {
  display: grid;
  gap: 0.35rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0.45rem 0 0;
}

.property-decision-metrics div {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 0.45rem;
  padding: 0.35rem 0.4rem;
}

.property-decision-metrics dt {
  color: #aaa5b4;
  font: 600 0.52rem "DM Mono", monospace;
}

.property-decision-metrics dd {
  color: #fff7e6;
  font: 800 0.64rem "DM Mono", monospace;
  margin: 0.12rem 0 0;
}

.property-offer .property-modifier {
  color: #b9dcd4;
  display: block;
  font-size: 0.55rem;
  line-height: 1.35;
  margin-top: 0.4rem;
  max-width: 28ch;
  text-transform: none;
}

.player-xp-progress {
  accent-color: #a99cff;
  display: block;
  height: 0.42rem;
  margin-top: 0.35rem;
  max-width: 9rem;
  width: 100%;
}

.player-xp-label {
  color: #bcb5cf;
  display: block;
  font: 600 0.54rem "DM Mono", monospace;
  margin-top: 0.14rem;
}

/* Readability pass: essential rules must remain legible without enlarging HUDs. */
.turn-action-status {
  font-size: 0.68rem;
  line-height: 1.45;
}

#movement-breakdown {
  font-size: 0.6rem;
}

.property-offer > span,
.property-offer > small {
  font-size: 0.6rem;
}

.player-class-benefit {
  font-size: 0.6rem;
  line-height: 1.4;
}

.weather-pill {
  font-size: 0.6rem;
}

.weather-pill small {
  font-size: 0.49rem;
}

@media (max-width: 820px) {
  .header-actions .weather-pill {
    display: flex;
    max-width: 12.5rem;
    padding: 0.48rem 0.58rem;
  }

  .weather-pill #weather-label,
  .weather-pill #weather-forecast {
    display: none;
  }

  .weather-pill #weather-effect {
    display: block;
    line-height: 1.25;
    max-width: 19ch;
  }
}

@media (max-width: 640px) {
  .header-actions .weather-pill {
    max-width: 8.5rem;
  }

  .weather-pill #weather-effect {
    max-width: 12ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.first-match-coach h2 {
  font-size: 1rem;
  line-height: 1.3;
  margin: 0.25rem 0 0;
}

.first-match-coach p:not(.eyebrow) {
  color: #c9c5d2;
  font-size: 0.76rem;
  line-height: 1.55;
  margin: 0.45rem 0 0;
  max-width: 58ch;
}

.first-match-coach ol {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.first-match-coach li {
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 0.65rem;
  display: flex;
  font-size: 0.7rem;
  gap: 0.45rem;
  padding: 0.5rem;
}

.first-match-coach li b {
  align-items: center;
  background: #f6c453;
  border-radius: 50%;
  color: #24233a;
  display: flex;
  flex: 0 0 auto;
  font: 800 0.62rem "DM Mono", monospace;
  height: 1.45rem;
  justify-content: center;
  width: 1.45rem;
}

.first-match-actions {
  display: flex;
  gap: 0.55rem;
  justify-content: flex-end;
}

.first-match-actions button {
  min-height: 2.65rem;
}

@media (max-width: 640px) {
  .first-match-coach {
    left: 50%;
    top: 4.7rem;
    transform: translateX(-50%);
    width: calc(100vw - 1.2rem);
  }

  .first-match-coach ol {
    grid-template-columns: 1fr;
  }
}

.board-legend {
  font-size: 0.68rem;
  gap: 0.45rem 1rem;
  max-width: 27rem;
  padding: 1rem 1.1rem;
}

.board-legend i {
  height: 0.7rem;
  width: 0.7rem;
}

.turn-controls,
.turn-controls[data-layout="property"] {
  background: transparent;
  border: 0;
  box-shadow: none;
  display: grid;
  grid-template-areas:
    "property actions"
    "status status";
  grid-template-columns: auto auto;
  padding: 0;
  width: auto;
}

.turn-controls .local-player-readout,
.turn-controls .action-separator {
  display: none;
}

.turn-controls .dice-readout {
  display: grid;
}

.turn-controls .property-offer {
  backdrop-filter: blur(16px);
  background: rgba(31,29,49,.94);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 0.8rem;
  color: #fff7e6;
  padding: 0.65rem 0.8rem;
}

.turn-controls .turn-actions button {
  min-height: 3.2rem;
}

.turn-controls .turn-action-status {
  backdrop-filter: blur(12px);
  background: rgba(31,29,49,.82);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  color: #c3bfcc;
  justify-self: center;
  margin-top: 0.35rem;
  max-width: min(32rem, calc(100vw - 2rem));
  padding: 0.42rem 0.8rem;
}

@media (max-width: 820px) {
  .header-player {
    margin-left: 0.5rem;
    padding-left: 0.5rem;
  }

  .header-player small,
  .header-player strong {
    display: none;
  }

  .header-actions .weather-pill,
  .header-actions #connection-pill {
    display: none;
  }

  .board-legend {
    display: none;
  }
}

/* Stable in-game composition: every HUD mode owns an explicit grid. */
.game-header-inner,
.hud-layout,
.hud-top-row,
.hud-card,
.turn-card,
.turn-controls,
.turn-controls > * {
  box-sizing: border-box;
  min-width: 0;
}

.hud-card,
.turn-card {
  overflow: hidden;
}

.players-card {
  flex: 0 1 20rem;
}

.turn-card {
  flex: 0 1 19rem;
}

.board-legend {
  border-radius: 1rem;
  display: grid;
  gap: 0.32rem 0.8rem;
  grid-template-columns: repeat(2, minmax(0, auto));
  margin-bottom: 6.5rem;
  max-width: 21rem;
  padding: 0.7rem 0.85rem;
}

.board-legend .camera-hint {
  border-left: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  grid-column: 1 / -1;
  margin: 0.25rem 0 0;
  padding: 0.45rem 0 0;
}

.turn-controls {
  grid-template-areas:
    "player separator dice actions"
    "status status status status";
  grid-template-columns: minmax(10rem, 1fr) 1px minmax(14rem, 1.25fr) auto;
  max-height: min(13rem, calc(100vh - 1rem));
  overflow: hidden;
  width: min(48rem, calc(100vw - 2rem));
}

.turn-controls[data-layout="spectator"] {
  grid-template-areas:
    "player separator dice"
    "status status status";
  grid-template-columns: minmax(10rem, 1fr) 1px minmax(15rem, 1.2fr);
  width: min(40rem, calc(100vw - 2rem));
}

.turn-controls[data-layout="property"] {
  grid-template-areas:
    "player separator dice property actions"
    "status status status status status";
  grid-template-columns:
    minmax(9rem, 1fr) 1px minmax(13rem, 1.1fr)
    minmax(9rem, 0.9fr) auto;
  width: min(62rem, calc(100vw - 2rem));
}

.local-player-readout {
  grid-area: player;
}

.action-separator {
  grid-area: separator;
}

.dice-readout {
  grid-area: dice;
}

.property-offer {
  grid-area: property;
}

.turn-actions {
  grid-area: actions;
}

.turn-actions:not(:has(button:not([hidden]))) {
  display: none;
}

.turn-action-status {
  grid-area: status;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.turn-controls .dice-readout {
  grid-template-columns: repeat(2, 2.25rem);
  justify-content: center;
  min-width: 13rem;
}

#movement-breakdown {
  color: #675e70;
  display: block;
  font: 600 0.5rem/1.35 "DM Mono", monospace;
  grid-column: 1 / -1;
  max-width: 13rem;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 13rem;
}

.route-header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.route-header > div {
  min-width: 0;
}

.route-close {
  align-items: center;
  background: #292942;
  border: 0;
  border-radius: 50%;
  color: #fff7e6;
  cursor: pointer;
  display: flex;
  flex: 0 0 auto;
  font-size: 1.2rem;
  height: 2.35rem;
  justify-content: center;
  width: 2.35rem;
}

.route-close:hover {
  background: #ef684d;
}

.route-close:disabled,
.route-options button:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

@media (max-width: 900px) {
  .game-header {
    padding-inline: 0.8rem;
  }

  .header-actions {
    gap: 0.3rem;
  }

  .header-actions .social-toggle:not(.camera-mode-toggle) span:last-child,
  .weather-pill #weather-label {
    display: none;
  }

  .social-toggle {
    padding-inline: 0.7rem;
  }

  .game-hud {
    padding-inline: 0.8rem;
  }

  .players-card,
  .turn-card {
    width: min(17rem, calc(50vw - 1.2rem));
  }

  .turn-controls[data-layout],
  .turn-controls[data-layout="property"] {
    grid-template-areas:
      "dice actions"
      "property property"
      "status status";
    grid-template-columns: minmax(12rem, 1fr) auto;
    max-height: none;
    width: min(38rem, calc(100vw - 1.2rem));
  }

  .turn-controls[data-layout="spectator"] {
    grid-template-areas:
      "dice"
      "status";
    grid-template-columns: minmax(12rem, 1fr);
  }

  .action-separator {
    display: none;
  }

  .turn-actions {
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .turn-controls[data-layout],
  .turn-controls[data-layout="property"] {
    grid-template-areas:
      "dice actions"
      "property property"
      "status status";
    grid-template-columns: minmax(9rem, 1fr) auto;
  }

  .turn-controls .dice-readout {
    min-width: 9rem;
  }

  #movement-breakdown {
    max-width: 10rem;
    width: 10rem;
  }

  .route-shell {
    max-height: calc(100vh - 2rem);
    overflow: auto;
  }

  .route-options {
    grid-template-columns: 1fr;
  }

  .route-options button {
    min-height: 7.5rem;
  }
}

.legend-market {
  background: #25d7a5;
  box-shadow: 0 0 0.7rem #25d7a5;
}

.legend-special {
  background: #a99cff;
  box-shadow: 0 0 0.7rem rgba(169, 156, 255, 0.8);
}

.legend-duel {
  background: #ff5c48;
  box-shadow: 0 0 0.7rem #ff5c48;
}

.legend-fork {
  background: #ffad32;
  box-shadow: 0 0 0.7rem #ffad32;
}

.legend-premium {
  background: #ff784e;
  box-shadow: 0 0 0.7rem #ff784e;
}

.legend-value {
  background: #68d4c5;
  box-shadow: 0 0 0.7rem #68d4c5;
}

.legend-high-rent {
  background: #f6c453;
  box-shadow: 0 0 0.7rem #f6c453;
}

.market-toggle[data-available="true"] {
  animation: market-call 1.5s ease-in-out infinite;
  background: #25d7a5;
  border-color: #8affde;
  color: #172d29;
}

@keyframes market-call {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(37, 215, 165, 0);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 0 1.4rem rgba(37, 215, 165, 0.58);
    transform: translateY(-0.12rem);
  }
}

.market-dialog,
.route-dialog {
  background: transparent;
  border: 0;
  color: #fff7e6;
  max-height: 100vh;
  max-width: 100vw;
  margin: auto;
  padding: 1rem;
}

.market-dialog::backdrop,
.route-dialog::backdrop {
  background: rgba(14, 14, 25, 0.82);
  backdrop-filter: blur(9px);
}

.special-card-dialog {
  background: transparent;
  border: 0;
  color: #fff7e6;
  margin: auto;
  max-height: 100dvh;
  max-width: 100vw;
  padding: 0.75rem;
  width: 100%;
}

.special-card-dialog::backdrop {
  backdrop-filter: blur(12px) saturate(0.75);
  background:
    radial-gradient(circle at 50% 30%, rgba(111, 101, 199, 0.24), transparent 45%),
    rgba(10, 10, 22, 0.88);
}

.special-card-shell {
  background:
    linear-gradient(135deg, rgba(111, 101, 199, 0.2), transparent 42%),
    #1e1d33;
  border: 1px solid rgba(221, 216, 255, 0.36);
  border-radius: 1.2rem;
  box-shadow:
    0.65rem 0.65rem 0 #332d68,
    0 2rem 7rem rgba(0, 0, 0, 0.58);
  margin: auto;
  max-width: 118rem;
  overflow: hidden;
  width: 100%;
}

.special-card-header {
  align-items: center;
  border-bottom: 1px solid rgba(221, 216, 255, 0.18);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1rem 1.15rem 0.85rem;
}

.special-card-header h2 {
  color: #f4f0ff;
  font: 800 clamp(1.25rem, 2.4vw, 2.25rem) "Bricolage Grotesque", sans-serif;
  letter-spacing: -0.04em;
  margin: 0.12rem 0;
}

.special-card-header p:last-child {
  color: #b9b4cc;
  font-size: 0.64rem;
  margin: 0;
}

.special-card-counter {
  align-items: center;
  background: #f6c453;
  border-radius: 0.8rem;
  box-shadow: 0.25rem 0.25rem 0 #7c5721;
  color: #292038;
  display: flex;
  flex: 0 0 auto;
  font: 900 1.4rem "DM Mono", monospace;
  height: 3.2rem;
  justify-content: center;
  transform: rotate(3deg);
  width: 3.2rem;
}

.special-card-grid {
  display: grid;
  gap: 0.6rem;
  grid-auto-columns: minmax(8.7rem, 1fr);
  grid-auto-flow: column;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 1rem 1rem 1.2rem;
  scroll-padding: 1rem;
  scroll-snap-type: x mandatory;
  scrollbar-color: #6f65c7 #27253c;
}

.special-card {
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.1), transparent 38%),
    #322f53;
  border: 1px solid rgba(221, 216, 255, 0.28);
  border-radius: 0.85rem;
  color: #fff;
  cursor: pointer;
  display: grid;
  gap: 0.45rem;
  grid-template-rows: auto auto auto 1fr auto;
  min-height: 15.5rem;
  padding: 0.75rem;
  position: relative;
  scroll-snap-align: center;
  text-align: left;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.special-card[data-kind="penalty"] {
  background:
    linear-gradient(155deg, rgba(255, 122, 91, 0.16), transparent 42%),
    #3a2939;
  border-color: rgba(255, 122, 91, 0.32);
}

.special-card:hover,
.special-card:focus-visible {
  border-color: #f6c453;
  box-shadow: 0 0 0 3px rgba(246, 196, 83, 0.2);
  outline: none;
  transform: translateY(-0.3rem) rotate(-0.5deg);
}

.special-card:disabled {
  cursor: wait;
  opacity: 0.5;
}

.special-card-number {
  color: #f6c453;
  font: 900 1rem "DM Mono", monospace;
}

.special-card small {
  color: #aaa4c6;
  font: 700 0.46rem "DM Mono", monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.special-card strong {
  color: #fff7e6;
  font: 800 0.84rem/1.12 "Bricolage Grotesque", sans-serif;
}

.special-card p {
  color: #c7c2d4;
  font-size: 0.58rem;
  line-height: 1.42;
  margin: 0;
}

.special-card b {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #8ff0dc;
  font: 800 0.58rem "DM Mono", monospace;
  padding-top: 0.55rem;
}

.special-card[data-kind="penalty"] b {
  color: #ff9b84;
}

.special-card-footer {
  align-items: center;
  background: rgba(8, 8, 18, 0.24);
  border-top: 1px solid rgba(221, 216, 255, 0.12);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.7rem 1.1rem;
}

.special-card-footer p,
.special-card-footer small {
  font: 600 0.55rem "DM Mono", monospace;
  margin: 0;
}

.special-card-footer p {
  color: #ddd8ff;
}

.special-card-footer small {
  color: #8f899f;
}

.special-result-toast {
  background: #272342;
  border: 1px solid #8ff0dc;
  border-radius: 999px;
  bottom: 1rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.48);
  color: #f7f2ff;
  font: 700 0.65rem "DM Mono", monospace;
  left: 50%;
  max-width: calc(100vw - 2rem);
  opacity: 0;
  padding: 0.7rem 1rem;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 1rem);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 90;
}

.special-result-toast[data-kind="penalty"] {
  border-color: #ff856d;
}

.special-result-toast[data-active="true"] {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 700px) {
  .special-card-dialog {
    padding: 0.4rem;
  }

  .special-card-shell {
    border-radius: 0.85rem;
  }

  .special-card-header {
    padding: 0.7rem;
  }

  .special-card-header p:last-child,
  .special-card-footer small {
    display: none;
  }

  .special-card-grid {
    grid-auto-columns: minmax(8.4rem, 44vw);
    padding: 0.7rem;
  }

  .special-card {
    min-height: 13rem;
  }

  .special-card-footer {
    padding: 0.6rem 0.75rem;
  }
}

/* A casa selecionada precisa funcionar como uma ficha de leitura, não como
   uma tooltip. Mantemos o painel amplo no tabuleiro e compacto no telefone. */
@media (min-width: 761px) {
  .space-inspector {
    border-width: 3px;
    max-height: min(78vh, 40rem);
    max-width: min(36rem, calc(100vw - 2.5rem));
    padding: 1.35rem;
    width: 34rem;
  }

  .space-inspector-header {
    gap: 1.15rem;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    padding-right: 2rem;
  }

  .space-number {
    border-radius: 1rem;
    font-size: 1.8rem;
    height: 5.5rem;
  }

  .space-inspector h2 {
    font-size: 1.55rem;
    line-height: 1.08;
    margin-bottom: 0.5rem;
  }

  .space-inspector-body {
    margin-top: 1.1rem;
  }

  .space-inspector-body > p {
    font-size: 0.78rem;
    line-height: 1.55;
    padding: 0.85rem 0.9rem;
  }

  .space-metrics {
    gap: 0.6rem;
    margin-top: 1rem;
  }

  .space-metrics div {
    min-height: 4.1rem;
    padding: 0.72rem;
  }

  .space-metrics dt {
    font-size: 0.58rem;
  }

  .space-metrics dd {
    font-size: 0.82rem;
    margin-top: 0.3rem;
  }
}

.market-shell {
  background:
    linear-gradient(135deg, rgba(37, 215, 165, 0.12), transparent 45%),
    #1f2035;
  border: 2px solid #68d4c5;
  border-radius: 1.3rem;
  box-shadow: 0.8rem 0.8rem 0 #0b5547, 0 2rem 6rem rgba(0, 0, 0, 0.45);
  max-width: 55rem;
  overflow: hidden;
  width: calc(100vw - 2rem);
}

.market-header {
  align-items: flex-start;
  border-bottom: 1px solid rgba(104, 212, 197, 0.23);
  display: flex;
  justify-content: space-between;
  padding: 1.2rem;
}

.market-header h2 {
  color: #68d4c5;
  font-size: clamp(1.8rem, 5vw, 3.6rem);
  letter-spacing: -0.06em;
  margin: 0.15rem 0 0.3rem;
}

.market-header > div > p:last-child {
  color: #b6b3c4;
  font-size: 0.68rem;
  margin: 0;
}

.market-items {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(3, 1fr);
  padding: 1rem;
}

.market-item {
  background: #2b2c45;
  border: 1px solid rgba(104, 212, 197, 0.18);
  border-radius: 1rem;
  display: grid;
  gap: 0.7rem;
  grid-template-rows: auto 1fr auto;
  min-height: 17rem;
  padding: 1rem;
  transition: transform 160ms ease, border-color 160ms ease;
}

.market-item:hover {
  border-color: #68d4c5;
  transform: translateY(-0.25rem);
}

.market-item-symbol {
  align-items: center;
  background: #68d4c5;
  border-radius: 0.7rem;
  color: #172d29;
  display: flex;
  font-size: 1.4rem;
  height: 2.8rem;
  justify-content: center;
  width: 2.8rem;
}

.market-item h3 {
  font-size: 1.05rem;
  margin: 0.3rem 0;
}

.market-item p:not(.eyebrow) {
  color: #b6b3c4;
  font-size: 0.65rem;
  line-height: 1.45;
  margin: 0;
}

.market-item-actions {
  display: grid;
  gap: 0.45rem;
}

.market-item-actions button {
  background: #68d4c5;
  border: 0;
  border-radius: 0.55rem;
  color: #172d29;
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 900;
  padding: 0.65rem;
}

.market-item-actions button + button {
  background: transparent;
  border: 1px solid rgba(104, 212, 197, 0.4);
  color: #fff7e6;
}

.market-item-actions button:disabled {
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: 0.34;
}

.market-footer {
  align-items: center;
  background: #17182a;
  display: grid;
  gap: 0.25rem 0.8rem;
  grid-template-columns: auto auto 1fr;
  padding: 0.85rem 1.2rem;
}

.market-footer span,
.market-footer small {
  color: #b6b3c4;
  font: 0.55rem "DM Mono", monospace;
}

.market-footer strong {
  color: #68d4c5;
}

.market-footer small {
  text-align: right;
}

.route-shell {
  background: #fff7e6;
  border: 2px solid #292942;
  border-radius: 1.35rem;
  box-shadow: 0.8rem 0.8rem 0 #ffad32;
  color: #292942;
  max-width: 42rem;
  padding: 1.3rem;
  width: calc(100vw - 2rem);
}

.route-shell h2 {
  font-size: clamp(1.6rem, 5vw, 2.8rem);
  letter-spacing: -0.055em;
  line-height: 0.98;
  margin: 0.3rem 0 1.1rem;
}

.route-options {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, 1fr);
}

.route-options button {
  background: #ebe2d0;
  border: 2px solid transparent;
  border-radius: 0.9rem;
  color: #292942;
  cursor: pointer;
  min-height: 10rem;
  padding: 1rem;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease;
}

.route-options button:last-child {
  background: #292942;
  color: #fff7e6;
}

.route-options button:hover {
  border-color: #ffad32;
  transform: rotate(-1deg) translateY(-0.2rem);
}

.route-options span,
.route-options strong,
.route-options small {
  display: block;
}

.route-options span {
  color: #ef684d;
  font: 800 0.55rem "DM Mono", monospace;
  text-transform: uppercase;
}

.route-options strong {
  font-size: 1rem;
  margin: 0.75rem 0 0.45rem;
}

.route-options small {
  font-size: 0.64rem;
  line-height: 1.45;
}

#route-status {
  color: #756d78;
  font: 0.55rem "DM Mono", monospace;
  margin: 0.9rem 0 0;
  text-align: center;
}

@media (max-width: 700px) {
  .market-items,
  .route-options {
    grid-template-columns: 1fr;
  }

  .market-items {
    max-height: 66vh;
    overflow: auto;
  }

  .market-item {
    min-height: auto;
  }

  .market-footer {
    grid-template-columns: auto auto;
  }

  .market-footer small {
    grid-column: 1 / -1;
    text-align: left;
  }
}

.board-dice-hint {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(38, 35, 59, 0.96), rgba(28, 27, 45, 0.94));
  border: 1px solid rgba(246, 196, 83, 0.58);
  border-radius: 1rem;
  bottom: 7.8rem;
  box-shadow:
    0 0.55rem 0 #171625,
    0 1.4rem 4rem rgba(6, 5, 16, 0.42);
  display: grid;
  gap: 0.9rem;
  grid-template-columns: minmax(11rem, 1fr) 6rem;
  left: 50%;
  min-width: min(28rem, calc(100vw - 2rem));
  opacity: 0;
  padding: 0.78rem 0.95rem;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 1.2rem) scale(0.96);
  transition:
    opacity 180ms ease,
    transform 240ms cubic-bezier(.2,.8,.2,1);
  visibility: hidden;
  z-index: 48;
}

.board-dice-hint[data-active="true"] {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  visibility: visible;
}

.board-dice-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.board-dice-copy > span {
  color: #68d4c5;
  font: 800 0.48rem "DM Mono", monospace;
  letter-spacing: 0.12em;
}

.board-dice-copy strong {
  color: #fff7e6;
  font: 800 0.96rem "Bricolage Grotesque", sans-serif;
  margin-top: 0.1rem;
}

.board-dice-copy small {
  color: #b6b3c4;
  font: 500 0.52rem/1.35 "DM Mono", monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-dice-hint progress {
  accent-color: #f6c453;
  height: 0.7rem;
  width: 100%;
}

body[data-dice-active="true"] #game-canvas {
  cursor: grab !important;
  touch-action: none;
}

body[data-dice-active="true"] #game-canvas:active {
  cursor: grabbing !important;
}

@media (max-width: 700px) {
  .board-dice-hint {
    bottom: 6.8rem;
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }
}

.dice-cup-dialog {
  background: transparent;
  border: 0;
  color: #fff7e6;
  margin: auto;
  max-height: 100vh;
  max-width: 100vw;
  padding: 1rem;
}

.dice-cup-dialog::backdrop {
  background: rgba(16, 15, 28, 0.82);
  backdrop-filter: blur(10px);
}

.dice-cup-shell {
  background: #24243c;
  border: 2px solid #f6c453;
  border-radius: 1.3rem;
  box-shadow: 0.8rem 0.8rem 0 #ef684d, 0 2rem 6rem rgba(0, 0, 0, 0.5);
  padding: 1rem;
  width: min(34rem, calc(100vw - 2rem));
}

.dice-cup-shell > header {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
}

.dice-cup-shell h2 {
  font-size: clamp(1.45rem, 4vw, 2.25rem);
  letter-spacing: -0.05em;
  margin: 0.2rem 0 0.8rem;
}

.dice-shake-zone {
  background:
    radial-gradient(circle at 50% 75%, rgba(246, 196, 83, 0.18), transparent 36%),
    linear-gradient(#33324f, #1a1a2d);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1rem;
  cursor: grab;
  height: 18rem;
  overflow: hidden;
  position: relative;
  touch-action: none;
  user-select: none;
}

.dice-shake-zone:active {
  cursor: grabbing;
}

.dice-table-shadow {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 50%;
  bottom: 2rem;
  filter: blur(8px);
  height: 1.5rem;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  width: 10rem;
}

.dice-cup {
  --shake-x: 0px;
  --shake-y: 0px;
  --shake-rotation: 0deg;
  background: linear-gradient(90deg, #602f25, #b95c43 45%, #6e3428);
  border: 0.38rem solid #e7ad6c;
  border-radius: 1rem 1rem 3rem 3rem;
  bottom: 2.4rem;
  box-shadow: inset 0.7rem 0 1rem rgba(255, 255, 255, 0.13), 0 1rem 1.5rem rgba(0, 0, 0, 0.35);
  height: 10rem;
  left: 50%;
  position: absolute;
  transform: translate(calc(-50% + var(--shake-x)), var(--shake-y)) rotate(var(--shake-rotation));
  transition: transform 70ms linear;
  width: 8rem;
  z-index: 3;
}

.dice-cup span {
  background: #2a1715;
  border: 0.35rem solid #e7ad6c;
  border-radius: 50%;
  height: 2.1rem;
  left: 50%;
  position: absolute;
  top: -1.15rem;
  transform: translateX(-50%);
  width: 8.2rem;
}

.cup-dice {
  align-items: center;
  background: #fff7e6;
  border: 2px solid #292942;
  border-radius: 0.7rem;
  color: #292942;
  display: flex;
  font: 900 1.2rem "DM Mono", monospace;
  height: 3.2rem;
  justify-content: center;
  left: calc(50% - 3.8rem);
  position: absolute;
  top: 2.2rem;
  transform: rotate(-12deg);
  width: 3.2rem;
  z-index: 2;
}

.cup-die-two {
  left: calc(50% + 0.8rem);
  transform: rotate(16deg);
}

.dice-shake-zone[data-phase="loading"] .cup-dice {
  animation: dice-load 700ms cubic-bezier(.2,.8,.2,1) forwards;
}

.dice-shake-zone[data-phase="shaking"] .cup-dice {
  opacity: 0;
}

.dice-shake-zone[data-phase="throwing"] .dice-cup {
  animation: cup-throw 650ms cubic-bezier(.3,.8,.2,1) forwards;
}

.dice-shake-zone[data-phase="throwing"] .cup-dice {
  animation: dice-flight 850ms cubic-bezier(.15,.75,.25,1) infinite;
}

.dice-shake-zone[data-phase="result"] .dice-cup {
  opacity: 0;
  transform: translate(-180%, -1rem) rotate(-55deg);
}

.dice-shake-zone[data-phase="result"] .cup-dice {
  animation: dice-land 650ms cubic-bezier(.2,.9,.25,1) forwards;
  bottom: 3.2rem;
  opacity: 1;
  top: auto;
}

@keyframes dice-load {
  from { opacity: 0; transform: translateY(-7rem) rotate(-90deg); }
  to { opacity: 1; transform: translateY(4.5rem) rotate(18deg); }
}

@keyframes cup-throw {
  45% { transform: translate(-25%, -3.5rem) rotate(38deg); }
  100% { transform: translate(-190%, -1rem) rotate(-65deg); opacity: 0.4; }
}

@keyframes dice-flight {
  from { transform: translate(0, 5rem) rotate(0); }
  to { transform: translate(5rem, 10rem) rotate(720deg); }
}

@keyframes dice-land {
  0% { transform: translateY(-10rem) rotate(540deg); }
  70% { transform: translateY(0.5rem) rotate(20deg); }
  100% { transform: translateY(0) rotate(-5deg); }
}

.throw-lines {
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.throw-lines i {
  background: rgba(246, 196, 83, 0.65);
  height: 0.15rem;
  opacity: 0;
  position: absolute;
  right: 18%;
  top: 35%;
  transform: rotate(-25deg);
  width: 5rem;
}

.dice-shake-zone[data-phase="throwing"] .throw-lines i {
  animation: throw-line 550ms ease-out infinite;
}

.throw-lines i:nth-child(2) { top: 48%; animation-delay: 90ms !important; }
.throw-lines i:nth-child(3) { top: 60%; animation-delay: 180ms !important; }

@keyframes throw-line {
  0% { opacity: 0; transform: translateX(-2rem) rotate(-25deg) scaleX(.3); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translateX(3rem) rotate(-25deg) scaleX(1); }
}

.shake-readout {
  margin: 0.85rem 0;
}

.shake-readout > div {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.shake-readout span,
.shake-readout small {
  color: #b6b3c4;
  font: 0.55rem "DM Mono", monospace;
}

.shake-readout strong {
  color: #f6c453;
  font: 800 0.7rem "DM Mono", monospace;
}

.shake-readout progress {
  accent-color: #f6c453;
  display: block;
  height: 0.65rem;
  margin: 0.4rem 0;
  width: 100%;
}

.dice-cup-shell > .primary-action {
  width: 100%;
}

.weather-pill {
  align-items: center;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  display: flex;
  font: 600 0.54rem "DM Mono", monospace;
  gap: 0.35rem;
  padding: 0.58rem 0.72rem;
  text-transform: uppercase;
}

.weather-pill > span:first-child {
  color: #f6c453;
  font-size: 0.8rem;
}

.weather-pill > span:last-child {
  display: grid;
  gap: 0.08rem;
}

.weather-pill strong {
  font: inherit;
}

.weather-pill small {
  color: rgba(255, 255, 255, 0.58);
  font: 500 0.42rem "DM Mono", monospace;
  text-transform: none;
}

.weather-pill[data-weather="rain"],
.weather-pill[data-weather="storm"] {
  border-color: rgba(142, 190, 255, 0.45);
}

.weather-pill[data-weather="rain"] > span:first-child,
.weather-pill[data-weather="storm"] > span:first-child {
  color: #9fc8ff;
}

.talent-choices {
  align-items: center;
  background: rgba(111, 101, 199, 0.13);
  border: 1px solid rgba(173, 162, 255, 0.3);
  border-radius: 0.8rem;
  display: flex;
  gap: 0.6rem;
  padding: 0.5rem;
  position: absolute;
  bottom: calc(100% + 0.55rem);
  left: 50%;
  max-width: min(42rem, calc(100vw - 2rem));
  transform: translateX(-50%);
  width: max-content;
}

.talent-choices[hidden] {
  display: none;
}

.talent-choices > span {
  color: #d9d2ff;
  font: 700 0.52rem "DM Mono", monospace;
  text-transform: uppercase;
}

#talent-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.talent-option {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.65rem;
  color: #fff;
  cursor: pointer;
  display: grid;
  gap: 0.14rem;
  padding: 0.45rem 0.6rem;
  text-align: left;
}

.talent-option strong {
  font: 700 0.58rem "DM Mono", monospace;
}

.talent-option small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.5rem;
}

#liars-dialog {
  width: min(58rem, calc(100vw - 2rem));
}

#liars-dialog .modal-shell {
  background:
    radial-gradient(circle at 50% 48%, rgba(202, 75, 59, 0.13), transparent 32%),
    linear-gradient(145deg, #24223b, #121322);
  border-color: rgba(246, 196, 83, 0.35);
}

.liars-content {
  padding: 0.75rem 1rem 1rem;
}

.liars-stage {
  height: min(31rem, 62vh);
  min-height: 25rem;
  perspective: 900px;
  position: relative;
}

.liars-table {
  background:
    radial-gradient(circle, transparent 0 46%, rgba(255,255,255,.04) 47% 48%, transparent 49%),
    #24564b;
  border: 0.8rem solid #7a4834;
  border-radius: 50%;
  box-shadow:
    inset 0 0 3rem rgba(0, 0, 0, 0.5),
    0 1.1rem 0 #4e2b24,
    0 2rem 3rem rgba(0, 0, 0, 0.38);
  height: 19rem;
  left: 50%;
  position: absolute;
  top: 5rem;
  transform: translateX(-50%) rotateX(57deg);
  transform-style: preserve-3d;
  width: min(42rem, 86%);
}

.table-felt-detail {
  border: 1px dashed rgba(246, 196, 83, 0.3);
  border-radius: 50%;
  inset: 1.4rem;
  position: absolute;
}

.liars-trump-card {
  align-items: center;
  animation: trump-reveal 700ms cubic-bezier(.2,.9,.3,1) both;
  background: #fff7e6;
  border: 0.25rem solid #f6c453;
  border-radius: 0.7rem;
  box-shadow: 0.35rem 0.45rem 0 rgba(41, 41, 66, 0.5);
  color: #292942;
  display: flex;
  flex-direction: column;
  height: 6.8rem;
  justify-content: center;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) rotateX(-57deg) translateZ(1.5rem);
  width: 4.8rem;
}

.liars-trump-card span {
  color: #ef684d;
  font: 800 0.48rem "DM Mono", monospace;
  text-transform: uppercase;
}

.liars-trump-card strong {
  align-items: center;
  display: flex;
  flex-direction: column;
  font: 900 1.25rem "DM Mono", monospace;
  line-height: 1;
}

.liars-trump-card strong b {
  font-size: 2rem;
}

.liars-trump-card strong em {
  font-size: 0.55rem;
  font-style: normal;
  margin-top: 0.2rem;
  text-transform: uppercase;
}

.liars-trump-card small {
  color: #6b5a45;
  font: 700 0.33rem/1.2 "DM Mono", monospace;
  margin-top: 0.35rem;
  max-width: 4rem;
  text-align: center;
  text-transform: uppercase;
}

@keyframes trump-reveal {
  from { opacity: 0; transform: translate(-50%, -50%) rotateX(-57deg) translateZ(1.5rem) rotateY(180deg) scale(.55); }
  to { opacity: 1; transform: translate(-50%, -50%) rotateX(-57deg) translateZ(1.5rem) rotateY(0) scale(1); }
}

.liars-players {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 3;
}

.liars-player-seat {
  align-items: center;
  display: flex;
  flex-direction: column;
  left: 10%;
  position: absolute;
  top: 3.5rem;
  transition: filter 180ms ease, transform 180ms ease;
}

.liars-player-seat[data-seat="1"] {
  left: auto;
  right: 10%;
}

.liars-player-seat[data-seat="2"] {
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

.liars-player-seat[data-active="true"] {
  filter: drop-shadow(0 0 1rem rgba(246, 196, 83, 0.65));
}

.liars-player-avatar {
  align-items: center;
  background: #ef684d;
  border: 0.3rem solid #fff7e6;
  border-radius: 48% 48% 42% 42%;
  display: flex;
  font-size: 0.62rem;
  font-weight: 900;
  height: 3.4rem;
  justify-content: center;
  width: 3.4rem;
}

.liars-player-seat[data-active="true"] .liars-player-avatar {
  animation: player-thinking 1.2s ease-in-out infinite;
}

@keyframes player-thinking {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-.25rem) rotate(2deg); }
}

.liars-player-seat > strong {
  background: rgba(20, 20, 34, 0.85);
  border-radius: 999px;
  font-size: 0.58rem;
  margin-top: -0.2rem;
  padding: 0.25rem 0.5rem;
}

.opponent-hand {
  height: 3.4rem;
  margin-top: 0.15rem;
  position: relative;
  width: 5.5rem;
}

.opponent-hand i,
.liars-pot i {
  background:
    repeating-linear-gradient(45deg, #ef684d 0 .25rem, #292942 .25rem .5rem);
  border: 2px solid #fff7e6;
  border-radius: 0.32rem;
  height: 2.8rem;
  left: 50%;
  position: absolute;
  transform:
    translateX(-50%)
    rotate(calc((var(--card-index) - 2) * 9deg))
    translateY(0);
  transform-origin: 50% 110%;
  width: 1.9rem;
}

.liars-pot {
  left: 61%;
  position: absolute;
  top: 43%;
  transform: rotateX(-57deg);
}

.liars-pot i {
  --card-index: 2;
  animation: card-to-table 480ms cubic-bezier(.15,.8,.3,1) both;
  transform: translate(-50%, -50%) rotate(calc(var(--pot-index) * 8deg));
}

@keyframes card-to-table {
  from { opacity: 0; transform: translate(10rem, 8rem) rotate(150deg) scale(1.4); }
  to { opacity: 1; transform: translate(-50%, -50%) rotate(calc(var(--pot-index) * 8deg)); }
}

.liars-local-seat {
  bottom: 0;
  left: 50%;
  position: absolute;
  text-align: center;
  transform: translateX(-50%);
  width: 75%;
  z-index: 5;
}

.liars-local-seat > span {
  color: #b6b3c4;
  font: 0.5rem "DM Mono", monospace;
  text-transform: uppercase;
}

.liars-local-seat .liars-hand {
  align-items: flex-end;
  flex-wrap: nowrap;
  gap: 0;
  justify-content: center;
  margin-top: 0.2rem;
}

.liars-local-seat .liars-card {
  box-shadow: -0.25rem 0.35rem 0.7rem rgba(0,0,0,.25);
  height: 6.4rem;
  margin-left: -0.5rem;
  min-width: 4.3rem;
  transform: rotate(calc((var(--hand-index, 2) - 2) * 4deg));
  transform-origin: 50% 120%;
  align-content: center;
  background:
    radial-gradient(circle at 50% 34%, rgba(246, 196, 83, 0.15), transparent 32%),
    linear-gradient(155deg, #292942, #171724);
  border: 2px solid rgba(255, 247, 230, 0.8);
  color: #fff7e6;
  display: grid;
  justify-items: center;
  padding: 0.4rem;
}

.liars-card-glyph {
  color: #f6c453;
  font-size: 2rem;
  line-height: 1;
}

.liars-card strong {
  font: 900 0.55rem "DM Mono", monospace;
  margin-top: 0.35rem;
  text-transform: uppercase;
}

.liars-card small {
  color: rgba(255, 255, 255, 0.58);
  font: 0.34rem/1.2 "DM Mono", monospace;
  margin-top: 0.2rem;
  text-align: center;
}

.liars-card[data-card-kind="curinga"] {
  background:
    radial-gradient(circle, rgba(246, 196, 83, 0.28), transparent 54%),
    #342849;
  border-color: #f6c453;
}

.liars-rules {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 0.65rem 1rem 0;
  padding-top: 0.55rem;
}

#hot-potato-charge {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.liars-local-seat .liars-card:hover:not(:disabled),
.liars-local-seat .liars-card[data-selected="true"] {
  transform: translateY(-0.8rem) rotate(0);
}

@media (max-width: 700px) {
  .liars-stage {
    min-height: 22rem;
  }

  .liars-table {
    height: 15rem;
    top: 5rem;
  }

  .liars-player-seat {
    left: 2%;
  }

  .liars-player-seat[data-seat="1"] {
    right: 2%;
  }

  .liars-local-seat .liars-card {
    height: 5rem;
    min-width: 3.3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Distrito 40 — experience layer */

body {
  background: #17182a;
  color: var(--ink);
  font-family: "Nunito Sans", sans-serif;
}

button,
input,
select {
  font-family: inherit;
}

#game-canvas {
  background: #23233b;
}

.scene-vignette {
  background:
    linear-gradient(180deg, rgba(20, 20, 38, 0.62), transparent 22%),
    radial-gradient(circle at 50% 46%, transparent 40%, rgba(19, 18, 34, 0.42) 100%);
}

.entry-flow {
  align-items: stretch;
  background:
    radial-gradient(circle at 15% 18%, rgba(240, 100, 73, 0.24), transparent 28%),
    radial-gradient(circle at 78% 88%, rgba(104, 212, 197, 0.18), transparent 30%),
    #23233d;
  color: var(--ink);
  isolation: isolate;
  overflow: hidden;
  padding: clamp(1rem, 3vw, 2.5rem);
}

.entry-flow::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
  content: "";
  inset: 0;
  mask-image: linear-gradient(90deg, black, transparent 68%);
  pointer-events: none;
  position: absolute;
  z-index: -2;
}

.entry-flow::after {
  background: #f6c453;
  border-radius: 50%;
  content: "";
  filter: blur(1px);
  height: 34rem;
  left: -21rem;
  opacity: 0.1;
  position: absolute;
  top: calc(50% - 17rem);
  width: 34rem;
  z-index: -1;
}

.entry-backdrop-art {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: -1;
}

.floating-tile,
.floating-coin {
  align-items: center;
  display: flex;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  justify-content: center;
  position: absolute;
}

.floating-tile {
  background: var(--paper);
  border: 0.35rem solid #262034;
  border-radius: 1.2rem;
  box-shadow: 0.55rem 0.6rem 0 rgba(12, 11, 24, 0.35);
  color: #262034;
  height: 6rem;
  transform: rotate(-12deg);
  width: 6rem;
}

.tile-one {
  bottom: -1.5rem;
  left: 32%;
}

.tile-two {
  right: 38%;
  top: -2rem;
  transform: rotate(15deg);
}

.floating-coin {
  background: #f6c453;
  border: 0.3rem solid #2d2944;
  border-radius: 50%;
  box-shadow: inset 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
  color: #342c20;
  height: 4.2rem;
  width: 4.2rem;
}

.coin-one {
  left: 3%;
  top: 12%;
  transform: rotate(10deg);
}

.coin-two {
  bottom: 7%;
  left: 43%;
  transform: rotate(-8deg);
}

.entry-layout {
  align-items: center;
  display: grid;
  gap: clamp(2rem, 5vw, 6rem);
  grid-template-columns: minmax(22rem, 0.72fr) minmax(38rem, 1.28fr);
  margin: auto;
  max-width: 1440px;
  min-height: 100%;
  position: relative;
  width: 100%;
  z-index: 1;
}

.entry-pitch {
  max-width: 31rem;
  padding-left: clamp(0rem, 3vw, 3rem);
}

.district-seal {
  align-items: stretch;
  background: #f06449;
  border: 0.24rem solid #181729;
  border-radius: 1rem;
  box-shadow: 0.45rem 0.5rem 0 #151424;
  color: #fff7e6;
  display: inline-flex;
  font-family: "Bricolage Grotesque", sans-serif;
  margin-bottom: 2rem;
  overflow: hidden;
  transform: rotate(-3deg);
}

.district-seal span,
.district-seal strong {
  align-items: center;
  display: flex;
  height: 3.8rem;
  justify-content: center;
}

.district-seal span {
  font-size: 1.55rem;
  font-weight: 800;
  width: 3.2rem;
}

.district-seal strong {
  background: #f6c453;
  color: #252035;
  font-size: 1.65rem;
  width: 3.8rem;
}

.entry-kicker,
.entry-tagline {
  font-family: "DM Mono", monospace;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.entry-kicker {
  color: #8ee4d5;
  font-size: 0.7rem;
  margin: 0;
}

.entry-pitch h1 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(4rem, 7.2vw, 7.3rem);
  font-weight: 800;
  letter-spacing: -0.085em;
  line-height: 0.76;
  margin: 1rem 0 1.35rem;
  max-width: 7ch;
  text-transform: uppercase;
}

.entry-pitch h1 span {
  color: #f6c453;
  display: block;
  letter-spacing: -0.04em;
  margin-left: 1.8ch;
  text-shadow: 0.08em 0.08em 0 #f06449;
}

.entry-tagline {
  color: #f6c453;
  font-size: 0.76rem;
  font-weight: 700;
  margin: 0 0 1.2rem;
}

.entry-manifesto {
  color: #d2cfdd;
  font-size: 1rem;
  line-height: 1.65;
  margin: 0;
  max-width: 31rem;
}

.entry-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.7rem;
}

.entry-features span {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #c9c6d5;
  font-size: 0.67rem;
  padding: 0.52rem 0.75rem;
}

.entry-features b {
  color: #fff7e6;
  font-family: "DM Mono", monospace;
}

.entry-shell {
  backdrop-filter: none;
  background: var(--paper);
  border: 0;
  border-radius: 1.65rem;
  box-shadow:
    0 0 0 0.3rem #302c49,
    0 2.2rem 5rem rgba(10, 9, 22, 0.38);
  color: var(--paper-ink);
  max-height: calc(100vh - clamp(2rem, 6vw, 5rem));
  max-width: none;
  overflow: auto;
  padding: clamp(1.2rem, 2.4vw, 2rem);
  position: relative;
  width: 100%;
}

.entry-shell::before {
  background: repeating-linear-gradient(
    90deg,
    #f06449 0 1.4rem,
    #f6c453 1.4rem 2.8rem,
    #68d4c5 2.8rem 4.2rem,
    #6b65c8 4.2rem 5.6rem
  );
  border-radius: 1.65rem 1.65rem 0 0;
  content: "";
  height: 0.42rem;
  inset: 0 0 auto;
  position: absolute;
}

.entry-heading,
.field-heading,
.lobby-title-row {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
}

.entry-shell .eyebrow {
  color: #776f89;
}

.entry-shell h2 {
  color: #262034;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(1.75rem, 3vw, 2.45rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.03;
  margin: 0.35rem 0 0;
}

.step-badge {
  background: #302c49;
  border-radius: 999px;
  color: #fff7e6;
  font: 500 0.58rem "DM Mono", monospace;
  padding: 0.55rem 0.7rem;
}

.entry-form {
  gap: 0.72rem;
  margin-top: 1.3rem;
}

.entry-form > label,
.field-heading label,
.field-heading h3 {
  color: #544d62;
  font: 800 0.66rem "Nunito Sans", sans-serif;
  letter-spacing: 0.055em;
  margin: 0;
  text-transform: uppercase;
}

.field-heading {
  align-items: baseline;
  margin-top: 0.25rem;
}

.field-heading > span {
  color: #8c8496;
  font-size: 0.62rem;
}

.entry-form input {
  background: #fffdf8;
  border: 2px solid #ded4c5;
  border-radius: 0.82rem;
  color: #262034;
  font: 700 0.9rem "Nunito Sans", sans-serif;
  min-height: 3.2rem;
  padding: 0.75rem 0.9rem;
}

.entry-form input::placeholder {
  color: #a39aa5;
}

.entry-form input:focus {
  border-color: #6b65c8;
  box-shadow: 0 0 0 4px rgba(107, 101, 200, 0.12);
  outline: none;
}

.class-picker {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(4, 1fr);
}

.class-choice,
.class-chip {
  align-items: center;
  background: #f4ebdc;
  border: 2px solid transparent;
  color: #393144;
  cursor: pointer;
  display: flex;
  text-align: left;
}

.class-choice {
  border-radius: 0.8rem;
  gap: 0.5rem;
  min-height: 3.4rem;
  padding: 0.45rem;
}

.class-choice:hover,
.class-choice:focus-visible,
.class-choice[data-selected="true"],
.class-chip:hover,
.class-chip:focus-visible,
.class-chip[data-selected="true"] {
  background: color-mix(in srgb, var(--class-color) 13%, #fffaf0);
  border-color: var(--class-color);
  outline: none;
}

.class-choice-symbol {
  align-items: center;
  background: var(--class-color);
  border-radius: 0.62rem;
  color: #fff;
  display: flex;
  flex: 0 0 auto;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1rem;
  height: 2.25rem;
  justify-content: center;
  width: 2.25rem;
}

.class-choice > span:last-child,
.class-choice strong,
.class-choice small,
.class-chip > span:last-child,
.class-chip strong,
.class-chip small {
  display: block;
  min-width: 0;
}

.class-choice strong {
  font-size: 0.68rem;
  line-height: 1.1;
}

.class-choice small {
  color: #83798a;
  font-size: 0.52rem;
  margin-top: 0.16rem;
}

.class-preview {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--class-color) 18%, #302c49), #302c49);
  border-radius: 1rem;
  color: #fff7e6;
  display: grid;
  gap: 1rem;
  grid-template-columns: 7.2rem 1fr;
  min-height: 14.4rem;
  overflow: hidden;
  padding: 1rem;
  position: relative;
}

.class-preview::after {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  content: "";
  height: 10rem;
  left: -3.2rem;
  position: absolute;
  top: -4rem;
  width: 10rem;
}

.class-portrait {
  align-items: center;
  align-self: stretch;
  display: flex;
  justify-content: center;
  min-height: 9rem;
  position: relative;
}

.class-portrait span {
  align-items: center;
  background: var(--class-color);
  border: 0.35rem solid #fff7e6;
  border-radius: 46% 46% 42% 42%;
  box-shadow:
    0 0.8rem 0 -0.15rem color-mix(in srgb, var(--class-color) 70%, #17182a),
    0 1.1rem 1.8rem rgba(0, 0, 0, 0.28);
  display: flex;
  font-size: 2.1rem;
  height: 5.5rem;
  justify-content: center;
  position: relative;
  transform: rotate(-2deg);
  width: 5.5rem;
  z-index: 1;
}

.class-portrait i {
  background: var(--class-color);
  border: 0.35rem solid #fff7e6;
  border-radius: 45% 45% 0.7rem 0.7rem;
  bottom: -1.1rem;
  height: 4rem;
  position: absolute;
  width: 6.5rem;
}

.class-preview-copy {
  position: relative;
  z-index: 1;
}

.class-preview-copy > p {
  color: var(--class-soft);
  font-size: 0.7rem;
  font-weight: 800;
  margin: 0;
  text-transform: uppercase;
}

.class-preview-copy > p small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.58rem;
  margin-left: 0.35rem;
}

.class-preview-copy h3 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.45rem;
  letter-spacing: -0.04em;
  margin: 0.1rem 0;
}

.class-preview blockquote {
  color: #ded9e5;
  font-size: 0.7rem;
  font-style: italic;
  margin: 0.12rem 0 0.65rem;
}

.class-preview-voice {
  align-items: center;
  background: color-mix(in srgb, var(--class-color) 24%, transparent);
  border: 1px solid color-mix(in srgb, var(--class-color) 68%, #fff);
  border-radius: 999px;
  color: #fff7e6;
  display: inline-flex;
  font: 800 0.56rem "DM Mono", monospace;
  gap: 0.35rem;
  margin: 0 0 0.62rem;
  padding: 0.4rem 0.7rem;
  text-transform: uppercase;
}

.class-preview-voice:hover,
.class-preview-voice:focus-visible {
  background: color-mix(in srgb, var(--class-color) 48%, transparent);
  transform: translateY(-1px);
}

@keyframes character-speech-arrive {
  from {
    opacity: 0;
    transform: translate(-0.25rem, 0.2rem) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

.skill-card {
  background: rgba(10, 9, 22, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.72rem;
  padding: 0.65rem 0.75rem;
}

.skill-card > span {
  color: var(--class-soft);
  display: block;
  font: 500 0.54rem "DM Mono", monospace;
  text-transform: uppercase;
}

.skill-card > strong {
  display: block;
  font-size: 0.72rem;
  margin-top: 0.22rem;
}

.class-dossier {
  display: grid;
  gap: 0.35rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0.55rem 0 0;
}

.class-dossier div {
  border-left: 2px solid color-mix(in srgb, var(--class-color) 65%, transparent);
  padding-left: 0.45rem;
}

.class-dossier dt {
  color: var(--class-soft);
  font: 700 0.46rem "DM Mono", monospace;
  text-transform: uppercase;
}

.class-dossier dd {
  color: #d7d1df;
  font-size: 0.52rem;
  line-height: 1.32;
  margin: 0.12rem 0 0;
}

.player-row[data-class] {
  border-left: 0.24rem solid var(--class-color);
}

.player-row[data-class] .player-monogram {
  box-shadow:
    inset 0 0 0 0.14rem var(--class-color),
    0 0 0 0.08rem rgba(255, 255, 255, 0.12);
}

.header-player[data-class] {
  border-bottom: 2px solid var(--class-color);
}

@media (max-width: 700px) {
  .narrative-stack {
    left: 0.75rem;
    max-width: none;
    right: 0.75rem;
    top: 4.7rem;
    width: auto;
  }

  .narrative-card p {
    font-size: 0.62rem;
  }

  .class-dossier {
    grid-template-columns: 1fr;
  }

  .contract-seals {
    grid-template-columns: 1fr;
  }

  .game-over-stats {
    grid-template-columns: 1fr;
  }
}

.skill-card p {
  color: #cbc6d5;
  font-size: 0.6rem;
  line-height: 1.35;
  margin: 0.2rem 0 0;
}

.entry-actions {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 1.1fr 1fr;
}

.entry-main-action {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding-inline: 1rem;
}

.entry-main-action b {
  font-size: 1.2rem;
}

.join-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

#room-code {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  min-width: 0;
}

.primary-action,
.secondary-action,
.danger-action,
.quiet-action {
  border-radius: 0.75rem;
  font: 800 0.73rem "Nunito Sans", sans-serif;
  min-height: 3rem;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease;
}

.primary-action {
  background: #f06449;
  border-color: #f06449;
  box-shadow: 0 0.28rem 0 #a63d31;
  color: #fff;
}

.primary-action:hover:not(:disabled),
.primary-action:focus-visible:not(:disabled) {
  box-shadow: 0 0.38rem 0 #a63d31;
  outline: none;
  transform: translateY(-0.08rem);
}

.secondary-action {
  background: #302c49;
  border-color: #302c49;
  color: #fff7e6;
}

.secondary-action:hover:not(:disabled),
.secondary-action:focus-visible:not(:disabled) {
  background: #464064;
  outline: none;
}

.quiet-action {
  background: transparent;
  border: 1px solid #cfc4b5;
  color: #706778;
  cursor: pointer;
  padding: 0.65rem 0.75rem;
}

.entry-error {
  color: #b43e32;
  font-size: 0.7rem;
  font-weight: 800;
  margin: 0.8rem 0 0;
}

.entry-copy {
  color: #766d7e;
  font-size: 0.74rem;
  margin: 0.65rem 0 1rem;
}

.room-code-button {
  background: #f6c453;
  border: 2px solid #302c49;
  box-shadow: 0.22rem 0.25rem 0 #302c49;
  color: #302c49;
}

.room-code-button span {
  color: #6d5730;
}

.room-code-button strong {
  font-size: 1rem;
}

.lobby-roster,
.lobby-map-switcher,
.lobby-class-switcher {
  border-top: 1px solid #ddd3c5;
  padding-top: 0.85rem;
}

.lobby-class-switcher {
  margin-top: 1rem;
}

.lobby-map-switcher {
  margin-top: 1rem;
}

.lobby-map-picker {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.6rem;
}

.map-choice {
  background: #fffdf8;
  border: 2px solid #d8ccbc;
  border-radius: 0.8rem;
  color: #332b3a;
  display: grid;
  gap: 0.55rem;
  overflow: hidden;
  padding: 0.35rem;
  text-align: left;
}

.map-choice[data-selected="true"] {
  border-color: #f06449;
  box-shadow: 0 0 0 2px #ffd0c5;
}

.map-choice:disabled {
  cursor: default;
  opacity: 0.78;
}

.map-choice-art {
  background-position: center;
  background-size: cover;
  border-radius: 0.55rem;
  display: block;
  min-height: 4.5rem;
}

.map-choice-art-district {
  background:
    radial-gradient(circle at 48% 48%, #f6c453 0 9%, transparent 10%),
    repeating-radial-gradient(circle at center, #34364b 0 12%, #68d4c5 13% 17%, #252638 18% 28%);
}

.map-choice-art-village {
  background-image:
    linear-gradient(180deg, transparent 45%, rgb(18 25 40 / 45%)),
    url("/assets/maps/bairro-da-vila-concept.png");
}

.map-choice-copy {
  display: grid;
  gap: 0.12rem;
  padding: 0.12rem 0.25rem 0.3rem;
}

.map-choice-copy strong {
  font-size: 0.72rem;
}

.map-choice-copy small {
  color: #7d7485;
  font-size: 0.54rem;
}

.lobby-players {
  gap: 0.48rem;
  margin-top: 0.6rem;
  max-height: 14rem;
}

.lobby-players li {
  background: #fffdf8;
  border: 1px solid #dfd6c8;
  border-left: 0.35rem solid var(--class-color);
  border-radius: 0.75rem;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: auto 1fr auto;
  padding: 0.62rem;
}

.lobby-player-avatar {
  align-items: center;
  background: var(--class-color);
  border-radius: 0.58rem;
  color: #fff;
  display: flex !important;
  font-size: 0.86rem;
  height: 2.15rem;
  justify-content: center;
  width: 2.15rem;
}

.lobby-players li strong {
  color: #332b3a;
  font-size: 0.74rem;
}

.lobby-players li div span {
  color: #817787;
  font-size: 0.52rem;
}

.lobby-ready {
  align-self: center;
  color: #a65632;
}

.lobby-ready.is-ready {
  color: #21836f;
}

.lobby-class-picker {
  display: grid;
  gap: 0.42rem;
  grid-template-columns: repeat(2, 1fr);
  margin-top: 0.6rem;
}

.class-chip {
  border-radius: 0.7rem;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.38rem;
}

.class-chip .class-choice-symbol {
  height: 2rem;
  width: 2rem;
}

.class-chip strong {
  font-size: 0.65rem;
}

.class-chip small {
  color: #7d7485;
  font-size: 0.5rem;
  line-height: 1.2;
  margin-top: 0.08rem;
}

.lobby-actions {
  align-items: center;
  display: flex;
  margin-top: 1rem;
}

.lobby-actions .quiet-action {
  margin-right: auto;
}

.lobby-actions .primary-action,
.lobby-actions .secondary-action {
  min-width: 9.5rem;
}

.lobby-actions .bot-action {
  min-width: 8.5rem;
}

.game-header {
  inset: 0 0 auto;
  padding: 1rem 1.2rem;
  position: absolute;
  z-index: 20;
}

.game-header-inner {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: auto;
  max-width: 1600px;
}

.brand-lockup {
  align-items: center;
  display: flex;
  filter: none;
  gap: 0.65rem;
}

.mini-seal {
  align-items: center;
  background: #f6c453;
  border: 2px solid #262034;
  border-radius: 0.65rem;
  box-shadow: 0.18rem 0.2rem 0 #f06449;
  color: #262034;
  display: flex;
  font: 800 0.82rem "Bricolage Grotesque", sans-serif;
  height: 2.45rem;
  justify-content: center;
  transform: rotate(-3deg);
  width: 2.45rem;
}

.brand-kicker {
  color: #f6c453;
  font-size: 0.5rem;
}

.brand-lockup h1 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1rem;
  letter-spacing: -0.025em;
  margin: 0.08rem 0 0;
}

.table-whisper {
  align-items: center;
  background: rgba(31, 29, 49, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #bcb8c8;
  display: flex;
  font: 500 0.56rem "DM Mono", monospace;
  gap: 0.45rem;
  left: 50%;
  margin: 0;
  padding: 0.5rem 0.75rem;
  position: absolute;
  transform: translateX(-50%);
  text-transform: uppercase;
}

.table-whisper span {
  color: #68d4c5;
}

.header-actions {
  display: flex;
  gap: 0.45rem;
}

.social-toggle,
.icon-button,
.status-pill {
  backdrop-filter: blur(12px);
  background: rgba(31, 29, 49, 0.9);
  border-color: rgba(255, 248, 233, 0.16);
}

.social-toggle {
  font: 800 0.62rem "Nunito Sans", sans-serif;
  min-height: 2.55rem;
  padding-inline: 0.8rem;
  text-transform: none;
}

.status-pill {
  font-size: 0.55rem;
  min-height: 2.55rem;
}

.game-hud {
  inset: 0;
  padding: 5.2rem 1.2rem 1.2rem;
  position: absolute;
  z-index: 10;
}

.hud-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
  margin: auto;
  max-width: 1600px;
}

.hud-top-row {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.hud-card,
.turn-card,
.board-legend {
  backdrop-filter: blur(15px);
  background: rgba(31, 29, 49, 0.9);
  border-color: rgba(255, 248, 233, 0.14);
  box-shadow: 0 1rem 2.5rem rgba(12, 11, 25, 0.22);
}

.players-card {
  border-left: 0.24rem solid #f6c453;
  max-width: 20rem;
  padding: 0.85rem;
  width: min(20rem, 88vw);
}

.hud-card .eyebrow,
.turn-card .eyebrow {
  color: #f6c453;
}

.hud-card h2,
.turn-card h2 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 0.92rem;
}

.count-badge {
  background: #f6c453;
  border-color: #f6c453;
  color: #2c2636;
}

.players-list {
  gap: 0.35rem;
  margin-top: 0.6rem;
  max-height: min(34vh, 18rem);
}

.player-row {
  border-left: 0.2rem solid var(--player-color, #f6c453);
  padding: 0.52rem;
}

.player-row.is-current {
  background: rgba(246, 196, 83, 0.12);
  border-color: #f6c453;
}

.player-monogram,
.turn-content > span {
  color: #fff;
}

.turn-card {
  border-right: 0.24rem solid #68d4c5;
  min-width: min(19rem, 86vw);
}

.turn-content {
  margin-top: 0.4rem;
}

.board-legend {
  align-self: flex-start;
  font-size: 0.5rem;
  margin-bottom: 6.3rem;
}

.legend-property {
  background: #f6c453;
}

.legend-event {
  background: #f06449;
}

.legend-player {
  background: #68d4c5;
}

.turn-controls,
.turn-controls[data-layout] {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: #fff7e6;
  gap: 0.45rem;
  grid-template-areas:
    "actions"
    "status";
  grid-template-columns: auto;
  max-width: calc(100vw - 2rem);
  overflow: visible;
  padding: 0;
  transition:
    opacity 160ms ease,
    transform 180ms ease,
    visibility 0s linear 180ms;
  width: auto;
}

.turn-controls[data-layout="spectator"] {
  grid-template-areas: "status";
  grid-template-columns: auto;
  width: auto;
}

.turn-controls[data-layout="property"] {
  grid-template-areas:
    "property actions"
    "status status";
  grid-template-columns: minmax(13rem, 22rem) auto;
  max-width: min(48rem, calc(100vw - 2rem));
  width: auto;
}

.turn-controls .dice-readout,
.turn-controls .local-player-readout,
.turn-controls .action-separator {
  display: none;
}

.turn-actions {
  grid-area: actions;
  justify-content: center;
}

.turn-controls .turn-actions button {
  box-shadow: 0 0.28rem 0 #a33d2f;
  min-height: 3.05rem;
  white-space: nowrap;
}

.turn-controls .property-offer {
  backdrop-filter: blur(16px);
  background: rgba(31, 29, 49, 0.96);
  border: 1px solid rgba(246, 196, 83, 0.5);
  border-radius: 0.85rem;
  box-shadow: 0 0.45rem 0 #171625;
  color: #fff7e6;
  min-height: 3.05rem;
  padding: 0.55rem 0.75rem;
}

.property-offer span,
.property-offer small {
  color: #bcb8c8;
}

.property-offer strong {
  color: #fff7e6;
  font-size: 0.78rem;
}

.backlot-offer {
  border-color: rgba(104, 212, 197, 0.62) !important;
  box-shadow: 0 0.45rem 0 #163d37 !important;
}

.backlot-offer > span {
  color: #8fe6d7;
}

.development-offer label {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.development-offer select {
  width: 100%;
  border: 1px solid rgba(246, 196, 83, 0.32);
  border-radius: 0.55rem;
  background: rgba(12, 15, 23, 0.92);
  color: #fff1cf;
  padding: 0.45rem 0.6rem;
}

#development-requirement {
  color: #f6c453;
}

body[data-dice-feedback="true"] .turn-controls {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0.8rem);
  visibility: hidden;
}

.turn-controls .secondary-action {
  background: #302c49;
  border-color: #302c49;
}

.turn-action-status {
  backdrop-filter: blur(12px);
  background: rgba(31, 29, 49, 0.9);
  border: 1px solid rgba(255, 248, 233, 0.14);
  border-radius: 999px;
  color: #d1ced8;
  justify-self: center;
  margin: 0;
  max-width: min(34rem, calc(100vw - 2rem));
  padding: 0.42rem 0.8rem;
}

.social-panel,
.async-panel {
  background: rgba(31, 29, 49, 0.98);
  border-color: rgba(255, 248, 233, 0.16);
}

.social-panel {
  top: 5.3rem;
}

.async-panel {
  top: 5.3rem;
}

.modal-shell {
  background: #302c49;
  border-color: rgba(246, 196, 83, 0.4);
}

.minigame-dialog::backdrop {
  background: rgba(16, 14, 28, 0.78);
}

.fatal-error,
.noscript-message {
  border-radius: 1rem;
}

@media (max-width: 1050px) {
  .entry-layout {
    grid-template-columns: minmax(16rem, 0.55fr) minmax(34rem, 1.45fr);
  }

  .entry-pitch h1 {
    font-size: clamp(3.5rem, 7vw, 5rem);
  }

  .entry-manifesto {
    font-size: 0.86rem;
  }

  .class-choice {
    padding: 0.35rem;
  }

  .class-choice-symbol {
    height: 2rem;
    width: 2rem;
  }
}

@media (max-width: 820px) {
  .entry-flow {
    overflow-y: auto;
  }

  .entry-layout {
    display: block;
    margin: auto;
    min-height: auto;
    width: min(100%, 44rem);
  }

  .entry-pitch {
    max-width: none;
    padding: 1rem 0 2rem;
    text-align: center;
  }

  .district-seal {
    margin-bottom: 1rem;
  }

  .entry-pitch h1 {
    font-size: clamp(3.5rem, 16vw, 5.5rem);
    margin-inline: auto;
    max-width: 9ch;
  }

  .entry-pitch h1 span {
    display: inline;
    margin-left: 0.08em;
  }

  .entry-manifesto {
    margin-inline: auto;
  }

  .entry-features {
    justify-content: center;
  }

  .entry-shell {
    max-height: none;
  }

  .table-whisper {
    display: none;
  }
}

@media (max-width: 640px) {
  .entry-flow {
    padding: 0.75rem;
  }

  .entry-pitch {
    padding-top: 0.5rem;
  }

  .district-seal {
    transform: scale(0.82) rotate(-3deg);
  }

  .entry-pitch h1 {
    font-size: 3.6rem;
    line-height: 0.9;
  }

  .entry-tagline {
    font-size: 0.65rem;
  }

  .entry-manifesto {
    font-size: 0.78rem;
  }

  .entry-features {
    margin-top: 1rem;
  }

  .entry-shell {
    border-radius: 1.2rem;
    padding: 1.15rem;
  }

  .class-picker {
    grid-template-columns: repeat(2, 1fr);
  }

  .class-preview {
    grid-template-columns: 4.4rem 1fr;
    padding: 0.8rem;
  }

  .class-portrait span {
    border-width: 0.25rem;
    font-size: 1.4rem;
    height: 3.7rem;
    width: 3.7rem;
  }

  .class-portrait i {
    border-width: 0.25rem;
    height: 3rem;
    width: 4.3rem;
  }

  .entry-actions {
    grid-template-columns: 1fr;
  }

  .lobby-actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .lobby-actions .quiet-action {
    grid-column: 1 / -1;
    margin-right: 0;
    order: 3;
  }

  .game-header {
    padding: 0.7rem;
  }

  .brand-lockup > div {
    display: none;
  }

  .status-pill #connection-label {
    display: none;
  }

  .status-pill {
    padding-inline: 0.7rem;
  }

  .game-hud {
    padding: 4.6rem 0.7rem 0.7rem;
  }

  .players-card {
    max-width: 11.5rem;
    padding: 0.65rem;
  }

  .players-card .hud-heading h2,
  .players-card .empty-state p,
  .player-balance {
    display: none;
  }

  .players-list {
    max-height: 24vh;
  }

  .player-row {
    grid-template-columns: auto 1fr;
  }

  .turn-card {
    min-width: 10.5rem;
    padding: 0.65rem;
  }

  .turn-content > span {
    height: 2rem;
    width: 2rem;
  }

  .turn-card h2 {
    max-width: 7rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .board-legend {
    display: none;
  }

  .turn-controls[data-layout] {
    bottom: max(0.55rem, env(safe-area-inset-bottom));
    gap: 0.45rem;
    grid-template-areas:
      "actions"
      "status";
    grid-template-columns: auto;
    padding: 0;
    width: auto;
  }

  .turn-controls[data-layout="spectator"] {
    grid-template-areas: "status";
    grid-template-columns: auto;
    width: max-content;
  }

  .turn-controls[data-layout="property"] {
    grid-template-areas:
      "property actions"
      "status status";
    grid-template-columns: minmax(12rem, 1fr) auto;
    max-width: calc(100vw - 1.1rem);
  }

  .turn-action-status {
    grid-column: 1 / -1;
  }

  .turn-actions > button {
    flex: 1;
  }
}

@media (max-width: 560px) {
  .turn-controls[data-layout="property"] {
    grid-template-areas:
      "property"
      "actions"
      "status";
    grid-template-columns: minmax(0, 1fr);
    width: calc(100vw - 1.1rem);
  }

  .turn-controls[data-layout="property"] .turn-actions {
    width: 100%;
  }

  .turn-controls[data-layout="property"] .turn-actions > button {
    min-width: 0;
  }
}

@media (max-height: 560px) {
  .board-dice-hint {
    bottom: 1rem;
    min-width: min(28rem, calc(100vw - 1.25rem));
    padding: 0.62rem 0.75rem;
    transition: none;
  }

  .turn-controls,
  .turn-controls[data-layout] {
    bottom: 0.65rem;
    transition: none;
  }

  .turn-controls .turn-actions button,
  .turn-controls .property-offer {
    min-height: 2.7rem;
  }

  .turn-action-status {
    padding-block: 0.32rem;
  }
}
