:root {
  color-scheme: light;
  --ink: #080719;
  --muted: #686176;
  --paper: #fbf7fb;
  --panel: #ffffff;
  --line: #e6d8e6;
  --night: #070819;
  --accent: #f0378c;
  --lip: #c91563;
  --orchid: #7d36c4;
  --blush: #fff0f7;
  --gold: #d4a33d;
  --teal: #159aa0;
  --green: #3b8b67;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, #fff4fa 0, var(--blush) 21rem, var(--paper) 100%),
    var(--blush);
  color: var(--ink);
}

main {
  flex: 1 0 auto;
}

.app-footer {
  flex-shrink: 0;
  border-top: 1px solid rgba(201, 21, 99, 0.18);
  color: rgba(8, 7, 25, 0.6);
  font-size: 0.72rem;
  padding: 0.45rem 0;
}

.app-footer .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.app-footer a {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.app-footer a:hover,
.app-footer a:focus {
  color: var(--lip);
}

.lobby-screen {
  min-height: calc(100vh - 5.5rem);
}

.brand-lockup {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.brand-logo {
  display: block;
  width: min(100%, 24rem);
  height: auto;
}

.lobby-copy {
  max-width: 42rem;
}

.lobby-copy .small {
  color: var(--lip);
}

.status-panel,
.rules-strip,
.panel {
  border-color: var(--line) !important;
  box-shadow: 0 1px 2px rgba(25, 24, 23, 0.05);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
}

.lobby-form {
  background:
    linear-gradient(180deg, #fff 0, #fff 58%, var(--blush) 100%);
}

.lobby-form h2 {
  color: var(--night);
}

.lobby-form .btn-dark {
  --bs-btn-bg: var(--night);
  --bs-btn-border-color: var(--night);
  --bs-btn-hover-bg: var(--lip);
  --bs-btn-hover-border-color: var(--lip);
}

.lobby-form .btn-outline-dark {
  --bs-btn-color: var(--night);
  --bs-btn-border-color: var(--night);
  --bs-btn-hover-bg: var(--night);
  --bs-btn-hover-border-color: var(--night);
}

.lobby-player-fields {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.lobby-player-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(7rem, 0.42fr);
  gap: 0.65rem;
  align-items: end;
}

.lobby-primary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.lobby-primary-actions .btn {
  min-height: 2.35rem;
}

.room-code-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.room-code-row .form-control {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
}

.room-code-row .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.saved-room-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  padding: 0.65rem 0.75rem;
}

.rules-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  border: 0 !important;
  box-shadow: none;
}

.rule-pill {
  min-height: 5.5rem;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--panel);
  padding: 0.9rem;
}

.rule-pill:nth-child(2) {
  border-top-color: var(--teal);
}

.rule-pill:nth-child(3) {
  border-top-color: var(--gold);
}

.rule-pill strong,
.rule-pill span {
  display: block;
}

.rule-pill span {
  color: var(--muted);
  font-size: 0.82rem;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.game-shell {
  min-height: 18rem;
}

.game-main {
  padding-top: 0 !important;
  padding-bottom: 0.5rem;
}

.game-screen {
  padding-top: 0;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
  min-width: 0;
}

.game-header-info,
.game-header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.game-header-info {
  flex: 1 1 auto;
  overflow: hidden;
}

.game-room-meta {
  font-size: 0.72rem;
  line-height: 1.1;
  white-space: nowrap;
}

.game-room-meta {
  color: var(--muted);
}

.game-header #game-message {
  display: none !important;
}

.game-header-actions {
  flex: 0 0 auto;
}

.game-header-actions .btn-sm {
  --bs-btn-padding-y: 0.16rem;
  --bs-btn-padding-x: 0.42rem;
  --bs-btn-font-size: 0.72rem;
  --bs-btn-border-radius: 0.35rem;
  line-height: 1.1;
  white-space: nowrap;
}

.side-panel-stack {
  display: grid;
  gap: 0.75rem;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.board-panel {
  position: relative;
  padding: 0.35rem;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  grid-template-rows: repeat(11, minmax(3.75rem, 1fr));
  gap: 0.25rem;
  aspect-ratio: 1;
  min-height: 42rem;
}

.board-grid::before {
  content: "";
  grid-area: 3 / 3 / 10 / 10;
  border: 1px dashed var(--line);
  border-radius: 8px;
  pointer-events: none;
  position: relative;
  z-index: 0;
}

.board-center-logo {
  grid-area: 3 / 3 / 10 / 10;
  display: grid;
  place-items: center;
  padding: clamp(2.5rem, 7vw, 5.5rem);
  pointer-events: none;
  position: relative;
  transform: translateY(-1.6rem);
  z-index: 1;
}

.board-center-logo img {
  display: block;
  max-width: min(100%, 28rem);
  max-height: 18rem;
  object-fit: contain;
  opacity: 0.24;
}

.board-deck-tray {
  grid-area: 3 / 3 / 10 / 10;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  pointer-events: none;
  position: relative;
  z-index: 2;
}

.board-deck-card {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.45rem;
  min-height: 6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 18px rgba(25, 24, 23, 0.12);
  color: var(--night);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.board-deck-card img {
  width: 2.4rem;
  height: auto;
}

.deck-community {
  grid-area: 3 / 2 / 4 / 4;
  align-self: end;
  justify-self: center;
  transform: translateY(0.15rem);
  width: min(10rem, 100%);
  border-top: 5px solid var(--teal);
}

.deck-boys {
  grid-area: 4 / 1 / 5 / 3;
  align-self: end;
  justify-self: center;
  transform: translateY(1.4rem);
  width: min(10rem, 100%);
  border-top: 5px solid var(--gold);
}

.deck-girls {
  grid-area: 4 / 3 / 5 / 5;
  align-self: end;
  justify-self: center;
  transform: translateY(1.4rem);
  width: min(10rem, 100%);
  border-top: 5px solid var(--accent);
}

.decision-modal-layer,
.chance-modal-layer,
.community-modal-layer {
  grid-area: 3 / 3 / 10 / 10;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 2vw, 1.5rem);
  pointer-events: auto;
  position: relative;
  z-index: 4;
}

.decision-modal-card,
.chance-modal-card,
.community-modal-card {
  width: min(100%, 30rem);
  border: 2px solid rgba(8, 7, 25, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 46px rgba(8, 7, 25, 0.28);
  color: var(--night);
  overflow: hidden;
  transform-origin: 50% 8%;
  animation: chance-card-draw 240ms ease-out;
}

.rent-choice-card {
  width: min(100%, 28rem);
}

.community-modal-card {
  width: min(calc(100vw - 2rem), 24rem);
}

.chance-modal-from-boys .chance-modal-card {
  transform-origin: 24% 86%;
}

.chance-modal-from-girls .chance-modal-card {
  transform-origin: 76% 86%;
}

.decision-modal-kicker,
.chance-modal-kicker,
.community-modal-kicker {
  background: var(--night);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.45rem 0.8rem;
  text-align: center;
  text-transform: uppercase;
}

.decision-modal-card h3,
.chance-modal-card h3,
.community-modal-card h3 {
  margin: 0;
  padding: 0.8rem 1rem 0.35rem;
  color: var(--lip);
  font-size: 1rem;
  font-weight: 900;
  text-align: center;
}

.decision-modal-copy,
.community-modal-copy {
  margin: 0;
  color: var(--night);
  font-size: 0.86rem;
  line-height: 1.35;
  padding: 0.1rem 1rem 0.35rem;
  text-align: center;
}

.decision-modal-actions,
.chance-modal-options,
.community-modal-actions {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem;
}

.community-modal-actions {
  justify-content: center;
}

.community-modal-ok {
  min-width: 7rem;
}

.tax-paid-toast-layer {
  grid-area: 3 / 3 / 10 / 10;
  display: grid;
  place-items: center;
  pointer-events: none;
  position: relative;
  z-index: 5;
}

.tax-paid-toast-card {
  display: grid;
  gap: 0.3rem;
  min-width: 10rem;
  padding: 0.9rem 1.25rem;
  border: 1px solid rgba(143, 79, 44, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 34px rgba(25, 24, 23, 0.16);
  color: var(--night);
  text-align: center;
  animation: tax-paid-toast 1500ms ease forwards;
}

.tax-paid-toast-card span {
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tax-paid-toast-card strong {
  font-size: 1.45rem;
  line-height: 1;
}

.finish-game-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(8, 7, 25, 0.42);
}

.finish-game-modal-card {
  width: min(100%, 28rem);
  overflow: hidden;
  border: 2px solid rgba(8, 7, 25, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 46px rgba(8, 7, 25, 0.3);
  color: var(--night);
}

.finish-game-modal-kicker {
  background: var(--night);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.45rem 0.8rem;
  text-align: center;
  text-transform: uppercase;
}

.finish-game-modal-card h2 {
  margin: 0;
  padding: 0.9rem 1rem 0.35rem;
  color: var(--lip);
  font-size: 1.05rem;
  font-weight: 900;
  text-align: center;
}

.finish-game-modal-card p {
  margin: 0;
  color: var(--night);
  font-size: 0.88rem;
  line-height: 1.35;
  padding: 0.1rem 1rem 0.35rem;
  text-align: center;
}

.finish-game-modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  padding: 0.8rem;
}

.decision-option,
.chance-option {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  min-height: 4rem;
  border: 1px solid var(--night);
  border-radius: 8px;
  background: #fff;
  color: var(--night);
  padding: 0.65rem 0.8rem;
  text-align: left;
  transition: background-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.decision-option:hover:not(:disabled),
.decision-option:focus-visible,
.chance-option:hover:not(:disabled),
.chance-option:focus-visible {
  background: #fff0f7;
  transform: translateY(-1px);
}

.decision-option:disabled,
.chance-option:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.decision-option span,
.chance-option span {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 999px;
  background: var(--night);
  color: #fff;
  font-weight: 900;
}

.decision-option strong,
.chance-option strong {
  display: block;
  font-size: 0.9rem;
  line-height: 1.35;
}

.decision-option-primary,
.chance-option-primary {
  background: #34393b;
  color: #fff;
}

.decision-option-primary span,
.chance-option-primary span {
  background: #fff;
  color: var(--night);
}

.decision-option-primary:hover:not(:disabled),
.decision-option-primary:focus-visible,
.chance-option-primary:hover:not(:disabled),
.chance-option-primary:focus-visible {
  background: #202426;
  color: #fff;
}

.decision-modal-waiting,
.chance-modal-waiting,
.community-modal-waiting {
  margin: 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  padding: 0 0.85rem 0.75rem;
  text-align: center;
}

@keyframes chance-card-draw {
  from {
    opacity: 0;
    transform: scale(0.28) translateY(1.2rem);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes tax-paid-toast {
  0% {
    opacity: 0;
    transform: translateY(0.35rem) scale(0.97);
  }

  12%,
  68% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-0.45rem) scale(0.98);
  }
}

.board-square {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdf8;
  padding: 0.3rem;
  overflow: hidden;
}

.square-name {
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.05;
}

.property-card-content {
  display: grid;
  grid-template-rows: minmax(1.5rem, auto) 1fr auto;
  align-items: center;
  min-height: 100%;
  text-align: center;
}

.property-name {
  display: -webkit-box;
  min-height: 1.5rem;
  overflow: hidden;
  text-align: center;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.square-type,
.square-money,
.square-owner,
.square-rent-active {
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.1;
}

.square-owner {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.square-money {
  color: var(--ink);
  text-align: center;
}

.square-price {
  align-self: center;
  font-weight: 800;
}

.square-rent {
  align-self: end;
  font-weight: 400;
}

.square-rent-active {
  display: inline-block;
  margin-top: 0.12rem;
  border-radius: 999px;
  background: #191817;
  color: #fffdf8;
  padding: 0.08rem 0.28rem;
  font-weight: 700;
}

.board-square.rent-active {
  box-shadow: inset 0 0 0 2px rgba(25, 24, 23, 0.22);
}

.property-group-1 {
  border-top: 5px solid #8b4513;
}

.property-group-2 {
  border-top: 5px solid #aae0fa;
}

.property-group-3 {
  border-top: 5px solid #d93a96;
}

.property-group-4 {
  border-top: 5px solid #f7941d;
}

.property-group-5 {
  border-top: 5px solid #ed1b24;
}

.property-group-6 {
  border-top: 5px solid #fef200;
}

.property-group-7 {
  border-top: 5px solid #1fb25a;
}

.property-group-8 {
  border-top: 5px solid #0072bc;
}

.square-chance {
  border-top: 5px solid var(--gold);
}

.square-chance .square-name {
  text-align: center;
}

.square-chance-mark {
  display: grid;
  min-height: 2.2rem;
  place-items: center;
  color: var(--gold);
  font-size: 2.35rem;
  font-weight: 900;
  line-height: 1;
}

.square-community {
  display: grid;
  border-top: 5px solid var(--teal);
  place-items: center;
}

.square-community-name {
  font-weight: 400;
  text-align: center;
}

.square-tax {
  display: grid;
  border-top: 5px solid #8f4f2c;
  place-items: center;
}

.square-tax-name {
  font-weight: 400;
  text-align: center;
}

.square-go-to-jail {
  border-top: 5px solid #8f4f2c;
}

.square-go-dungeon-name {
  font-weight: 700;
  text-align: center;
}

.square-go-dungeon-note {
  margin-top: 0.15rem;
  text-align: center;
}

.square-dungeon-name {
  font-weight: 700;
  text-align: center;
}

.square-dungeon-icon {
  display: block;
  width: min(2.7rem, 72%);
  height: auto;
  margin: 0.12rem auto 0;
  object-fit: contain;
}

.square-voyeur-name {
  font-weight: 700;
  text-align: center;
}

.square-voyeur-icon {
  display: block;
  width: min(2.7rem, 72%);
  height: auto;
  margin: 0.12rem auto 0;
  object-fit: contain;
}

.square-go-name {
  font-size: 0.9rem;
  font-weight: 900;
  text-align: center;
}

.square-go-note {
  margin-top: 0.15rem;
  color: var(--green);
  font-size: 0.62rem;
  font-weight: 800;
  text-align: center;
}

.square-start,
.square-jail,
.square-free {
  border-top: 5px solid var(--green);
}

.owned-by-player-1 {
  background: #f0378c;
  color: #fff;
}

.owned-by-player-2 {
  background: #159aa0;
  color: #fff;
}

.owned-by-player-3 {
  background: #d4a33d;
  color: var(--ink);
}

.owned-by-player-4 {
  background: #7d36c4;
  color: #fff;
}

.owned-by-player-5 {
  background: #3b8b67;
  color: #fff;
}

.owned-by-player-6 {
  background: #f06543;
  color: #fff;
}

.owned-by-player {
  background: #191817;
  color: #fff;
}

.owned-by-player .square-money,
.owned-by-player .square-name,
.owned-by-player-1 .square-money,
.owned-by-player-1 .square-name,
.owned-by-player-2 .square-money,
.owned-by-player-2 .square-name,
.owned-by-player-4 .square-money,
.owned-by-player-4 .square-name,
.owned-by-player-5 .square-money,
.owned-by-player-5 .square-name,
.owned-by-player-6 .square-money,
.owned-by-player-6 .square-name {
  color: #fff;
}

.owned-by-player-3 .square-money,
.owned-by-player-3 .square-name {
  color: var(--ink);
}

.token-row {
  position: absolute;
  left: 0.25rem;
  right: 0.25rem;
  bottom: 0.25rem;
  display: flex;
  gap: 0.15rem;
  flex-wrap: wrap;
}

.player-token,
.score-token {
  display: inline-grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background: var(--panel);
  box-shadow: 0 1px 3px rgba(8, 7, 25, 0.18);
  overflow: hidden;
}

.player-token img,
.score-token img {
  display: block;
  width: 100%;
  height: 100%;
}

.player-token.is-current-turn {
  width: 2.3rem;
  height: 2.3rem;
  z-index: 2;
}

.token-player-1 {
  background: var(--accent);
}

.token-player-2 {
  background: var(--teal);
}

.token-player-3 {
  background: var(--gold);
}

.token-player-4 {
  background: var(--orchid);
}

.token-player-5 {
  background: var(--green);
}

.token-player-6 {
  background: #f06543;
}

.score-token {
  width: 1.3rem;
  height: 1.3rem;
}

.asset-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, auto));
  align-items: center;
  justify-content: start;
  gap: 0.6rem;
  margin-top: 1rem;
}

.asset-token,
.asset-die {
  width: 2.2rem;
  height: 2.2rem;
}

.asset-note {
  width: 5.25rem;
  height: auto;
}

.asset-card {
  width: 2.35rem;
  height: auto;
}

.dice-faces {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 1.6rem;
}

.dice-face {
  display: block;
  width: 1.45rem;
  height: 1.45rem;
}

.video-camera-layout {
  display: grid;
  gap: 0.5rem;
}

.video-panel-header {
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.video-title-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.video-stack {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}

.video-frame {
  position: relative;
  min-height: 10rem;
  overflow: hidden;
  border-radius: 8px;
  background: #181715;
}

.video-frame video {
  width: 100%;
  height: 100%;
  min-height: 10rem;
  object-fit: cover;
}

.video-frame span {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
}

.video-controls {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  min-width: 0;
}

.video-panel-header .video-controls {
  margin-left: auto;
}

.video-control-btn {
  display: inline-grid;
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border: 1px solid #a8a1ad;
  border-radius: 8px;
  background: #fff;
  color: #181715;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, opacity 140ms ease;
}

.video-control-btn:hover:not(:disabled) {
  border-color: #181715;
  background: #f6f3f7;
}

.video-control-btn:focus-visible {
  outline: 3px solid rgba(255, 47, 126, 0.28);
  outline-offset: 2px;
}

.video-control-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.video-control-btn svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.video-control-primary {
  border-color: #181715;
  background: #181715;
  color: #fff;
}

.video-control-primary:hover:not(:disabled) {
  background: #2a2825;
  color: #fff;
}

.video-control-primary.is-active {
  border-color: #0f9d70;
  background: #0f9d70;
}

.video-control-danger {
  color: #9f1d3f;
}

.video-control-danger:hover:not(:disabled) {
  border-color: #9f1d3f;
  background: #fff0f4;
}

.video-control-icon-off,
.video-control-btn.is-off .video-control-icon-on {
  display: none;
}

.video-control-btn.is-off .video-control-icon-off {
  display: block;
}

@media (max-width: 420px) {
  .video-panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .video-panel-header .video-controls {
    width: 100%;
  }

  .video-controls {
    justify-content: space-between;
    gap: 0.25rem;
  }

  .video-control-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 7px;
  }

  .video-control-btn svg {
    width: 0.95rem;
    height: 0.95rem;
  }
}

.scoreboard-list {
  display: grid;
  gap: 0.28rem;
}

.board-scoreboard {
  position: absolute;
  top: 14%;
  left: 14%;
  z-index: 3;
  width: min(20rem, 46%);
  padding: 0.55rem;
  background: rgba(255, 255, 255, 0.92);
}

.board-dice-roll {
  position: absolute;
  top: 14%;
  left: min(calc(14% + 20rem + 0.55rem), calc(60% + 0.55rem));
  z-index: 3;
  display: grid;
  width: min(5.4rem, 14%);
  min-height: 1.55rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  padding: 0.2rem 0.35rem;
  box-shadow: var(--shadow);
}

.board-dice-roll.can-roll {
  cursor: pointer;
}

.board-dice-roll:disabled {
  cursor: default;
  opacity: 0.92;
}

.board-dice-roll:focus-visible {
  outline: 3px solid rgba(255, 47, 126, 0.28);
  outline-offset: 2px;
}

.board-dice-roll #board-dice-label {
  width: 100%;
}

.board-dice-roll #board-dice-label.dice-faces {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  min-height: 0;
}

.board-dice-roll .dice-face {
  width: 1.45rem;
  height: 1.45rem;
}

.board-dice-roll .dice-placeholder .dice-face {
  opacity: 0.5;
}

.board-scoreboard .panel-header {
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}

.board-scoreboard h2 {
  font-size: 0.9rem;
  line-height: 1.1;
}

.board-scoreboard #turn-label {
  font-size: 0.62rem;
}

.scoreboard-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.35rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.32rem 0.38rem;
}

.scoreboard-row.is-current {
  border-color: var(--accent);
  background: #fff8f5;
}

.scoreboard-row.is-disconnected {
  opacity: 0.86;
}

.score-player-name {
  min-width: 0;
}

.score-player-name strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.7rem;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-player-name span {
  display: block;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.05;
}

.score-meta {
  display: block;
  justify-items: end;
  color: var(--muted);
  font-size: 0.7rem;
}

.score-meta strong {
  color: var(--ink);
  font-size: 0.72rem;
  line-height: 1.05;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.action-panel {
  padding: 0.6rem 1rem;
}

.action-panel-header {
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0;
}

.action-panel-header .action-buttons {
  flex: 1 1 auto;
  margin-left: 0.15rem;
  min-width: 0;
}

.action-panel.is-finished #action-title {
  display: none;
}

.action-panel.is-finished .action-buttons {
  margin-left: 0;
}

.action-button-end-turn,
.action-button-decline-property {
  margin-left: auto;
}

.event-log-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.event-log-panel .panel-header {
  margin-bottom: 0.45rem;
}

.event-log {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-left: 1.25rem;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.event-log li {
  margin-bottom: 0.18rem;
}

.event-log .event-rent,
.event-log .event-chance,
.event-log .event-community,
.event-log .event-tax,
.event-log .event-jail {
  color: #191817;
  font-weight: 700;
}

.event-log .event-rent::marker {
  color: #8f4f2c;
}

.event-log .event-chance::marker {
  color: var(--gold);
}

.event-log .event-community::marker {
  color: var(--teal);
}

.event-log .event-tax::marker {
  color: #8f4f2c;
}

.event-log .event-jail::marker {
  color: #191817;
}

.post-game-chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 24rem;
  overflow: hidden;
}

.is-social-mode .side-panel-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem);
  grid-template-rows: minmax(0, 1fr);
  gap: 0.75rem;
  min-height: calc(100vh - 4rem);
}

.social-video-panel {
  min-height: calc(100vh - 4rem);
}

.social-video-panel .video-camera-layout,
.social-video-panel .video-stack {
  min-height: calc(100vh - 9rem);
}

.social-video-panel .video-stack {
  position: relative;
  display: block;
}

.social-video-panel .video-frame:first-child {
  height: calc(100vh - 9rem);
  min-height: 28rem;
}

.social-video-panel .video-frame:first-child video {
  min-height: 100%;
}

.social-video-panel .video-frame:last-child {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  width: min(15rem, 34%);
  min-height: 8rem;
  border: 2px solid #fff;
  box-shadow: 0 14px 34px rgba(8, 7, 25, 0.28);
}

.social-video-panel .video-frame:last-child video {
  min-height: 8rem;
}

.is-social-mode .post-game-chat-panel {
  height: calc(100vh - 9rem);
  min-height: 28rem;
  align-self: start;
}

.chat-messages {
  display: grid;
  align-content: start;
  gap: 0.45rem;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.35rem;
  scrollbar-gutter: stable;
}

.chat-message {
  max-width: 88%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0.5rem 0.6rem;
}

.chat-message.is-local {
  justify-self: end;
  background: var(--blush);
}

.chat-message strong,
.chat-message span {
  display: block;
}

.chat-message strong {
  font-size: 0.58rem;
  line-height: 1;
}

.chat-message span {
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.chat-message.is-emoji-only span {
  font-size: 2.58rem;
  line-height: 1.05;
}

.chat-form {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.45rem;
  margin-top: 0.6rem;
}

.chat-emoji-toggle {
  min-width: 2.65rem;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

.emoji-picker {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.45rem);
  display: grid;
  grid-template-columns: repeat(7, 2.45rem);
  gap: 0.35rem;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(8, 7, 25, 0.18);
  padding: 0.45rem;
  z-index: 4;
}

.emoji-option {
  display: grid;
  width: 2.45rem;
  height: 2.45rem;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #fff;
  font-size: 1.32rem;
  line-height: 1;
}

.emoji-option:hover,
.emoji-option:focus-visible {
  border-color: var(--line);
  background: var(--blush);
}

@media (max-width: 991.98px) {
  .game-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .game-header-info,
  .game-header-actions {
    flex-wrap: wrap;
  }

  .rules-strip {
    grid-template-columns: 1fr;
  }

  .post-game-chat-panel.is-collapsed {
    display: none;
  }

  .is-social-mode .side-panel-stack {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .social-video-panel,
  .is-social-mode .post-game-chat-panel {
    min-height: auto;
  }

  .is-social-mode .post-game-chat-panel {
    height: min(32rem, 78vh);
  }

  .social-video-panel .video-camera-layout,
  .social-video-panel .video-stack {
    min-height: 70vh;
  }

  .social-video-panel .video-frame:first-child {
    height: 70vh;
    min-height: 24rem;
  }

  .social-video-panel .video-frame:last-child {
    width: min(10rem, 42%);
    min-height: 6rem;
  }

  .social-video-panel .video-frame:last-child video {
    min-height: 6rem;
  }

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

  .chat-form .btn-dark {
    grid-column: 1 / -1;
  }

  .board-grid {
    min-height: auto;
    grid-template-rows: repeat(11, minmax(2.9rem, 1fr));
  }

  .board-deck-tray {
    gap: 0.75rem;
  }

  .board-center-logo {
    padding: 2.4rem;
  }

  .board-center-logo img {
    max-height: 10rem;
  }

  .board-deck-card {
    min-height: 4.25rem;
    font-size: 0.55rem;
  }

  .board-deck-card img {
    width: 1.55rem;
  }

  .decision-modal-card,
  .chance-modal-card,
  .community-modal-card {
    width: min(100%, 23rem);
  }

  .decision-modal-card h3,
  .chance-modal-card h3,
  .community-modal-card h3 {
    font-size: 0.88rem;
  }

  .decision-option,
  .chance-option {
    min-height: 3.45rem;
    padding: 0.55rem 0.65rem;
  }

  .decision-option strong,
  .chance-option strong {
    font-size: 0.78rem;
  }

  .square-name {
    font-size: 0.58rem;
  }

  .square-type,
  .square-money,
  .square-owner {
    display: none;
  }
}

@media (max-width: 575.98px) {
  main.container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .room-code-row {
    flex-direction: column;
  }

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

  .room-code-row .btn {
    width: 100%;
  }

  .lobby-player-row {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 0.75rem;
  }

  .board-grid {
    gap: 0.15rem;
    grid-template-rows: repeat(11, minmax(2.35rem, 1fr));
  }

  .board-deck-tray {
    gap: 0.65rem;
  }

  .board-center-logo {
    padding: 1.4rem;
  }

  .board-center-logo img {
    max-height: 7rem;
  }

  .board-deck-card {
    min-height: 3.5rem;
    font-size: 0.48rem;
  }

  .board-deck-card img {
    width: 1.25rem;
  }

  .decision-modal-layer,
  .chance-modal-layer,
  .community-modal-layer {
    grid-area: 2 / 2 / 11 / 11;
    padding: 0.45rem;
  }

  .decision-modal-kicker,
  .chance-modal-kicker,
  .community-modal-kicker {
    font-size: 0.58rem;
    padding: 0.35rem 0.55rem;
  }

  .decision-modal-card h3,
  .chance-modal-card h3,
  .community-modal-card h3 {
    padding: 0.55rem 0.65rem 0.2rem;
  }

  .decision-modal-copy,
  .community-modal-copy {
    font-size: 0.72rem;
    padding: 0.05rem 0.65rem 0.2rem;
  }

  .decision-modal-actions,
  .chance-modal-options,
  .community-modal-actions {
    gap: 0.4rem;
    padding: 0.5rem;
  }

  .decision-option,
  .chance-option {
    grid-template-columns: 1.55rem minmax(0, 1fr);
    gap: 0.45rem;
    min-height: 3.1rem;
    padding: 0.45rem 0.5rem;
  }

  .decision-option span,
  .chance-option span {
    width: 1.55rem;
    height: 1.55rem;
  }

  .decision-option strong,
  .chance-option strong {
    font-size: 0.68rem;
  }
}
/* Raised tile faces retain the existing grid and movement coordinates. */
.board-panel {
  perspective: 1400px;
}

.board-grid {
  gap: 0.35rem;
  padding-bottom: 0.4rem;
}

.board-square {
  border-bottom: 3px solid #aaa59b;
  border-right-color: #bbb5aa;
  box-shadow: 0 3px 0 #8d897f, 2px 6px 5px rgba(25, 24, 23, 0.18),
    inset 1px 1px 0 rgba(255, 255, 255, 0.85);
  background-image: linear-gradient(145deg, rgba(255, 255, 255, 0.5), rgba(0, 0, 0, 0.04));
}

.board-square.rent-active {
  box-shadow: 0 3px 0 #8d897f, 2px 6px 5px rgba(25, 24, 23, 0.18),
    inset 0 0 0 2px rgba(25, 24, 23, 0.22);
}

.board-square .player-token {
  filter: drop-shadow(1px 3px 1px rgba(25, 24, 23, 0.3));
}

/* Keep landing dialogs level and readable while a decision is pending. */
.is-angled-board .board-grid:not(:has([role="dialog"])) {
  transform: rotateX(24deg) rotateZ(-8deg) scale(0.84);
}

.is-angled-board .board-scoreboard {
  top: 26%;
  left: 24%;
  width: min(20rem, 40%);
}

.is-angled-board .board-dice-roll {
  left: min(calc(24% + 20rem + 0.55rem), calc(64% + 0.55rem));
}

.is-game-finished .board-grid,
.is-game-finished .board-dice-roll {
  display: none;
}

.is-game-finished .board-panel {
  height: auto !important;
  perspective: none;
}

.is-game-finished .board-scoreboard {
  position: static;
  width: 100%;
}

.is-game-finished .score-player-name strong {
  white-space: normal;
  font-size: 0.95rem;
}

.is-game-finished .scoreboard-row {
  padding: 0.75rem;
}

.is-game-finished .score-player-name span {
  line-height: 1.4;
  font-size: 0.8rem;
}

.is-game-finished .side-panel-stack {
  grid-template-rows: auto auto;
  align-content: start;
}

.is-social-mode > .row > .col-xl-8 {
  width: 100%;
}

.is-social-mode .side-panel-stack {
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
}

.is-social-mode {
  --social-camera-height: max(20rem, calc(100dvh - 23rem));
}

.social-video-panel {
  min-height: 0;
}

.social-video-panel .video-camera-layout,
.social-video-panel .video-stack {
  min-height: var(--social-camera-height);
}

.social-video-panel .video-frame:first-child {
  height: var(--social-camera-height);
  min-height: 0;
}

.is-social-mode .post-game-chat-panel {
  height: calc(var(--social-camera-height) + 5rem);
  min-height: 0;
}

@media (max-width: 991.98px) {
  .is-social-mode .post-game-chat-panel.is-collapsed {
    display: none;
  }

  .is-social-mode .post-game-chat-panel:not(.is-collapsed) {
    position: fixed;
    right: 0.5rem;
    bottom: 0.5rem;
    width: min(24rem, calc(100vw - 1rem));
    height: min(32rem, 65dvh);
    z-index: 10;
    box-shadow: var(--shadow);
  }
}
