:root {
  /* Gold theme palette */
  --gold-border: rgba(201, 168, 76, 0.2);
  --gold-border-light: rgba(201, 168, 76, 0.15);
  --gold-border-medium: rgba(201, 168, 76, 0.25);
  --gold-border-strong: rgba(201, 168, 76, 0.3);
  --gold-glow: rgba(201, 168, 76, 0.1);
  --gold-bg: rgba(201, 168, 76, 0.03);
  --gold-bg-hover: rgba(201, 168, 76, 0.08);
  --gold-bg-light: rgba(201, 168, 76, 0.06);
  --gold-text: #c9a84c;
  --gold-text-light: #e8d5a0;
  /* Panel backgrounds */
  --panel-bg: linear-gradient(180deg, rgba(30, 26, 18, 0.92) 0%, rgba(18, 15, 10, 0.95) 100%);
  /* Glass-bevel inset highlights + strong outer drop shadow. Used by every
   * main dialog panel so they all share the trade-dialog treatment: no hard
   * outline, warm brass top edge, dark bottom edge, lifted off the scene. */
  --panel-shadow: inset 0 1px 0 rgba(255, 225, 160, 0.15), inset 0 -1px 0 rgba(0, 0, 0, 0.4), 0 12px 40px rgba(0, 0, 0, 0.6);
  /* Shadows */
  --shadow-medium: rgba(0, 0, 0, 0.5);
  --shadow-light: rgba(0, 0, 0, 0.3);
  /* Two-layer drop-shadow used on HUD text/icons — angled down-left for a
   * consistent "light from upper right" look. Apply with filter: var(...). */
  --ui-text-drop: drop-shadow(-1px 2px 2px rgba(0, 0, 0, 0.5)) drop-shadow(-1px 1px 1px rgba(0, 0, 0, 0.35));
  /* Same two-layer look as --ui-text-drop but as text-shadow so it inherits
   * to every text descendant — set on dialog root containers. */
  --ui-text-shadow: -1px 2px 2px rgba(0, 0, 0, 0.5), -1px 1px 1px rgba(0, 0, 0, 0.35);
  /* Button palette */
  --btn-positive-bg: linear-gradient(180deg, rgba(46, 90, 46, 0.85), rgba(30, 65, 30, 0.92));
  --btn-positive-border: rgba(70, 130, 70, 0.55);
  --btn-positive-color: #c0dcc0;
  --btn-positive-hover-bg: linear-gradient(180deg, rgba(56, 105, 56, 0.92), rgba(40, 80, 40, 0.95));
  --btn-positive-hover-border: rgba(90, 150, 90, 0.65);
  --btn-positive-hover-color: #e0ffe0;
  --btn-primary-bg: linear-gradient(180deg, rgba(100, 80, 30, 0.85), rgba(70, 55, 20, 0.92));
  --btn-primary-border: rgba(160, 130, 50, 0.55);
  --btn-primary-color: #d4c090;
  --btn-primary-hover-bg: linear-gradient(180deg, rgba(115, 95, 40, 0.92), rgba(85, 68, 28, 0.95));
  --btn-primary-hover-border: rgba(180, 150, 60, 0.65);
  --btn-primary-hover-color: #e8d5a0;
  --btn-negative-bg: linear-gradient(180deg, rgba(140, 45, 45, 0.95) 0%, rgba(95, 28, 28, 0.98) 100%);
  --btn-negative-border: transparent;
  --btn-negative-color: #ffd0d0;
  --btn-negative-hover-bg: linear-gradient(180deg, rgba(165, 55, 55, 0.97) 0%, rgba(115, 35, 35, 1) 100%);
  --btn-negative-hover-border: transparent;
  --btn-negative-hover-color: #fff;
  --btn-neutral-bg: linear-gradient(180deg, rgba(50, 44, 30, 0.95), rgba(28, 24, 16, 0.97));
  --btn-neutral-border: rgba(201, 168, 76, 0.25);
  --btn-neutral-color: #b8a880;
  --btn-neutral-hover-bg: linear-gradient(180deg, rgba(70, 66, 56, 0.95), rgba(40, 38, 32, 0.97));
  --btn-neutral-hover-color: #fff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  overflow: hidden;
  font-family: 'Nunito', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #0a0806;
  color: #eee;
  display: flex;
  height: 100vh;
}

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

#game-container {
  flex: 1;
  height: 100vh;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  min-width: 0; /* allow flex shrink below content size */
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
}

/* Overlays. The lobby sits on top of the live 3D scene — a soft radial
 * vignette dims the edges for panel legibility while letting the board
 * read through the center. */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.25) 80%, rgba(0, 0, 0, 0.68) 100%);
  z-index: 100;
  overflow-y: auto;
  padding: 20px 0;
}

/* Lobby exit animation */
.lobby-exit {
  animation: lobby-farewell 0.7s ease-in forwards;
  pointer-events: none;
}

.lobby-exit .lobby-panel {
  animation: lobby-panel-exit 0.6s ease-in forwards;
}

@keyframes lobby-farewell {
  0% { opacity: 1; }
  60% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes lobby-panel-exit {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.97); }
}

/* Menu section transitions */
.lobby-section-exit {
  animation: section-fade-out 0.25s ease-in forwards;
}

.lobby-section-enter {
  animation: section-fade-in 0.3s ease-out;
}

@keyframes section-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes section-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lobby-panel {
  /* Two-layer background: a darker tint at the top forms an
   * implicit "header band" around the lang/auth controls, then the
   * regular warm panel gradient below. Band is sized so top-bar
   * buttons (42px tall, 14px top) have equal 14px bottom padding. */
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0.28) 70px, transparent 70px, transparent 100%),
    linear-gradient(180deg, rgba(30, 26, 18, 0.97) 0%, rgba(18, 15, 10, 0.98) 100%);
  border: 2px solid #5a4a2a;
  border-radius: 4px;
  padding: 20px 14px;
  text-align: center;
  min-width: 360px;
  max-width: 520px;
  width: 90%;
  user-select: none;
  margin: auto;
  position: relative;
  transition: max-width 0.3s ease;
}

/* Menu view uses the wide hero + 3-card layout. Top padding clears the
 * absolutely-positioned lang flag (top-left) and auth bar (top-right) so
 * the hero starts below them instead of overlapping. */
.lobby-panel:has(#lobby-menu:not(.hidden)) {
  max-width: 880px;
  padding: 88px 32px 22px;
}
/* Prod menu view (local-game card hidden): narrower panel so the frame
 * hugs the 2-card + Join-bar content instead of leaving empty side rails.
 * 540px cards + 2×32px padding = 604px content box; small 16px margin. */
.lobby-panel:has(#lobby-menu:not(.hidden)):has(#local-game-wrap.hidden) {
  max-width: 620px;
}

/* ── Art Deco corner brackets ───────────────────────────────── */
/* Decorative framing for the landing/menu view only — other views (browse,
 * waiting room) have variable-height content that makes the bottom
 * brackets look unanchored. */
.lobby-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  pointer-events: none;
  z-index: 1;
  display: none;
  filter: drop-shadow(0 0 4px rgba(212, 165, 38, 0.25));
}
.lobby-panel:has(#lobby-menu:not(.hidden)) .lobby-corner {
  display: block;
}
.lobby-corner::after {
  content: '';
  position: absolute;
  width: 3px;
  height: 3px;
  background: #e8c44a;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(232, 196, 74, 0.6);
}
/* Top brackets sit BELOW the lang flag / auth bar utility row so they
 * frame the content area instead of colliding with the controls. */
.lobby-corner-tl {
  top: 76px;
  left: 10px;
  border-top: 1.5px solid rgba(201, 168, 76, 0.7);
  border-left: 1.5px solid rgba(201, 168, 76, 0.7);
}
.lobby-corner-tl::after { top: -2px; left: -2px; }
.lobby-corner-tr {
  top: 76px;
  right: 10px;
  border-top: 1.5px solid rgba(201, 168, 76, 0.7);
  border-right: 1.5px solid rgba(201, 168, 76, 0.7);
}
.lobby-corner-tr::after { top: -2px; right: -2px; }
.lobby-corner-bl {
  bottom: 10px;
  left: 10px;
  border-bottom: 1.5px solid rgba(201, 168, 76, 0.7);
  border-left: 1.5px solid rgba(201, 168, 76, 0.7);
}
.lobby-corner-bl::after { bottom: -2px; left: -2px; }
.lobby-corner-br {
  bottom: 10px;
  right: 10px;
  border-bottom: 1.5px solid rgba(201, 168, 76, 0.7);
  border-right: 1.5px solid rgba(201, 168, 76, 0.7);
}
.lobby-corner-br::after { bottom: -2px; right: -2px; }
.lobby-panel:has(#lobby-menu:not(.hidden)) .lobby-title-area {
  margin: 0 0 18px;
}

.lobby-panel.lobby-panel-wide {
  max-width: 580px;
  box-shadow:
    0 0 0 1px rgba(212, 165, 38, 0.15),
    0 0 60px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(212, 165, 38, 0.1);
}

.lobby-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: 1px solid rgba(229, 115, 115, 0.3);
  border-radius: 4px;
  color: #e57373;
  font-size: 22px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  z-index: 5;
}

.lobby-close-btn:hover {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.5);
  background: rgba(255, 100, 100, 0.1);
}

/* Language dropdown — flag button + themed popover menu */
.lang-selector {
  position: absolute;
  top: 14px;
  left: 12px;
  z-index: 6;
}
.lang-flag-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  /* Same silver-brass as the in-game HUD .btn-action. */
  background: linear-gradient(180deg, rgba(78, 80, 84, 0.9) 0%, rgba(52, 54, 58, 0.92) 100%);
  border: none;
  border-radius: 4px;
  height: 42px;
  padding: 0 6px 0 12px;
  cursor: pointer;
  box-shadow:
    inset 0 2px 4px -2px rgba(255, 225, 160, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 3px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.15s ease;
}
.lang-flag-btn img {
  width: 30px;
  height: 22px;
  border-radius: 2px;
  object-fit: contain;
}
.lang-chevron {
  color: #f0e8d8;
  font-size: 10px;
  line-height: 1;
  transition: transform 0.2s;
}
.lang-flag-btn:hover {
  background: linear-gradient(180deg, rgb(110, 85, 35) 0%, rgb(75, 58, 24) 100%);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 225, 160, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}
.lang-flag-btn[aria-expanded="true"] .lang-chevron {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 170px;
  /* Fully opaque brass-panel background — the semi-transparent --panel-bg
   * lets the 3D board bleed through and makes flags hard to scan. */
  background: linear-gradient(180deg, #1e1a12 0%, #120f0a 100%);
  border: 1px solid rgba(201, 168, 76, 0.35);
  border-radius: 6px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  box-shadow: var(--panel-shadow);
  z-index: 10;
}
.lang-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: none;
  border: none;
  border-radius: 4px;
  color: rgba(232, 213, 160, 0.75);
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.lang-menu-item img {
  width: 22px;
  height: 16px;
  border-radius: 2px;
  object-fit: contain;
  flex: 0 0 auto;
}
.lang-menu-item:hover {
  background: rgba(212, 165, 38, 0.12);
  color: #fff;
}
.lang-menu-item.is-active {
  background: linear-gradient(180deg, #d4a526, #9a6e12);
  color: #1a1206;
  font-weight: 700;
}

.lobby-panel:has(#lobby-waiting:not(.hidden)) {
  max-width: fit-content;
}

.lobby-waiting-layout {
  display: flex;
  gap: 24px;
  align-items: stretch;
}

.lobby-sidebar {
  flex: 0 0 240px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lobby-sidebar > .lobby-players-card:has(#player-list),
.lobby-sidebar > #local-players-card {
  flex: 1;
}

.lobby-sidebar > .lobby-players-card:last-child {
  margin-top: auto;
}

.lobby-sidebar .btn-primary {
  margin-top: 0;
}

.lobby-room-bar {
  display: none;
}

.settings-room-code {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
}

.settings-room-code:hover .room-code {
  color: #e8d5a0;
  text-shadow: 0 0 12px rgba(201, 168, 76, 0.4);
}

.room-code-label {
  font-size: 11px;
  color: #6a6050;
  letter-spacing: 2px;
}

.room-code-copied {
  font-size: 9px;
  color: var(--gold-text);
  letter-spacing: 1px;
  opacity: 0;
  transition: opacity 0.2s;
  position: absolute;
  right: 0;
  top: -14px;
}

.room-code-copied.show {
  opacity: 1;
}

.lobby-name-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(90, 80, 64, 0.3);
  border-radius: 4px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lobby-name-card .lobby-name-field {
  margin: 0;
}

.lobby-players-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(90, 80, 64, 0.3);
  border-radius: 4px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lobby-players-heading {
  color: var(--gold-text);
  font-weight: 600;
  font-size: 14px;
  padding: 0 0 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.3);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.lobby-players-card #player-list {
  margin: 0;
}

.lobby-waiting-layout > .settings-panel {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
}

@media (max-width: 700px) {
  .lobby-waiting-layout {
    flex-direction: column;
  }
  .lobby-sidebar {
    flex: none;
    width: 100%;
    position: static;
  }
  .lobby-panel {
    padding: 24px 16px;
  }
}

.lobby-title-area {
  text-align: center;
  margin: 0 0 -10px;
}

.lobby-panel:has(#lobby-menu.hidden) .lobby-title-area {
  margin: 58px 0 14px;
}

.lobby-panel:has(#lobby-menu.hidden) .lobby-logo {
  display: none;
}

.lobby-title {
  display: none;
}

.lobby-logo {
  width: 420px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.5));
  animation: logo-reveal 0.8s ease-out;
  position: relative;
}

@keyframes logo-reveal {
  from { opacity: 0; transform: scale(0.92); filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.5)) brightness(1.3); }
  to { opacity: 1; transform: scale(1); filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.5)) brightness(1); }
}


input[type="text"],
input[type="number"] {
  background: rgba(20, 18, 12, 0.8);
  border: 1px solid #4a4030;
  border-radius: 4px;
  color: #e8d5a0;
  padding: 10px 16px;
  font-size: 16px;
  font-family: 'Nunito', sans-serif;
  width: 100%;
  margin-bottom: 12px;
  box-sizing: border-box;
}

input:focus {
  outline: none;
  border-color: var(--gold-text);
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.15);
}

.lobby-menu {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  margin: 0 auto;
}

/* Hero block: kicker divider + title (welcome kicker + brand wordmark) */
.lobby-hero-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 10px 0 0;
  line-height: 1;
}

.lobby-hero-welcome {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: rgba(232, 213, 160, 0.55);
}

.lobby-hero-brand {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: 10px;
  text-transform: uppercase;
  /* Horizontal brass gradient with a bright highlight band that sweeps
   * across the wordmark — engraved-metal-catching-light feel. */
  background: linear-gradient(110deg,
    #8a6518 0%,
    #d4a526 25%,
    #fbe9ae 42%,
    #ffffff 48%,
    #fbe9ae 54%,
    #d4a526 75%,
    #8a6518 100%);
  background-size: 300% 100%;
  background-position: 200% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 2px 10px rgba(212, 165, 38, 0.25)) drop-shadow(0 4px 14px rgba(0, 0, 0, 0.55));
  padding: 0 6px;
  animation: hero-shimmer 9s linear infinite;
}

@keyframes hero-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -100% 0; }
}

/* Copyable hero (waiting-room view, "ROOM <code>"). Cursor + subtle
 * scale on hover so the whole title reads as a click target. */
.lobby-hero-copyable {
  cursor: pointer;
  transition: transform 0.15s ease-out;
}
.lobby-hero-copyable:hover {
  transform: translateY(-1px) scale(1.02);
}
.lobby-hero-copyable:active {
  transform: translateY(0) scale(1);
}

/* Staggered entry animation */
.lobby-menu .lobby-card,
.lobby-menu .lobby-deco-divider {
  animation: lobby-slide-in 0.4s ease-out both;
}
.lobby-menu .lobby-card:nth-child(1) { animation-delay: 0.1s; }
.lobby-menu .lobby-card:nth-child(2) { animation-delay: 0.18s; }
.lobby-menu .lobby-card:nth-child(3) { animation-delay: 0.26s; }
.lobby-menu .lobby-card:nth-child(4) { animation-delay: 0.34s; }

@keyframes lobby-slide-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.lobby-name-field {
  position: relative;
}

.lobby-name-field input {
  padding-left: 12px;
  margin-bottom: 0;
  letter-spacing: 1px;
}

/* ── Lobby menu cards ──────────────────────────────────────── */
/* Grid column count matches the number of action cards in row 1 so the
 * Join bar (grid-column: 1 / -1) is exactly as wide as the cards above.
 * Prod: Create + Browse → 2 cols, cards grid capped so the cards stay at
 * roughly their dev-mode size instead of stretching full panel width;
 * the Join bar below inherits that narrower width so everything aligns.
 * Dev: + Local Game → 3 cols, full panel width (no cap). */
.lobby-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
}
.lobby-cards:has(#local-game-wrap:not(.hidden)) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: none;
}

.lobby-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 22px 16px 18px;
  background: linear-gradient(180deg, rgba(42, 36, 22, 0.75) 0%, rgba(22, 18, 12, 0.85) 100%);
  border: 1px solid rgba(201, 168, 76, 0.38);
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  min-height: 140px;
  box-shadow:
    inset 0 1px 0 rgba(255, 225, 160, 0.08),
    0 4px 14px rgba(0, 0, 0, 0.45);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.lobby-card:hover {
  border-color: #e8d5a0;
  transform: translateY(-4px);
  background: linear-gradient(180deg, rgba(74, 60, 30, 0.85) 0%, rgba(38, 30, 18, 0.9) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 225, 160, 0.3),
    0 10px 28px rgba(0, 0, 0, 0.6),
    0 0 36px rgba(212, 165, 38, 0.32);
}

.lobby-card:active {
  transform: translateY(-1px);
  transition-duration: 0.08s;
}

.lobby-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-text);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin: 6px 0 0;
}

/* Reveal arrow sitting bottom-right; slides in + brightens on hover. */
.lobby-card-arrow {
  position: absolute;
  bottom: 14px;
  right: 16px;
  font-size: 18px;
  color: var(--gold-text);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  text-shadow: 0 0 10px rgba(212, 165, 38, 0.5);
}
.lobby-card:hover .lobby-card-arrow {
  opacity: 0.95;
  transform: translateX(0);
}

.lobby-card-input-row {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 0;
  flex: 1;
  min-width: 0;
}
.lobby-card-input-row input {
  flex: 1;
  min-width: 0;
  width: auto;
  margin: 0;
}
.lobby-card-input-row button {
  flex: 0 0 auto;
  width: auto;
  padding: 9px 22px;
  white-space: nowrap;
}

/* Join bar sits on its own row, capped to roughly 2 cards' worth of
 * width and centered — keeps it from sprawling when the content is just
 * an icon + title + short input + button. Consistent width regardless
 * of whether 2 or 3 cards sit in the row above. */
.lobby-card-join {
  grid-column: 1 / -1;
  width: 100%;
  /* Cap to roughly 2-cards-worth so the Join bar never spans across all
   * 3 cards in dev mode. Matches (2 × card width + gap) at 880px panel:
   * (263 × 2 + 14) ≈ 540px. In prod the cards grid itself caps at 540px,
   * so the Join bar fills the whole grid and still aligns. */
  max-width: 540px;
  justify-self: center;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 22px;
  min-height: 0;
}
.lobby-card-join .lobby-card-input-row {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}
.lobby-card-join .lobby-card-input-row input {
  width: 92px; /* sized to fit exactly 4 bold-monospace chars + padding */
  flex: 0 0 auto;
  padding: 8px 6px;
}
.lobby-card-join-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.lobby-card-join .ds-icon-frame {
  width: 40px;
  height: 40px;
}
.lobby-card-join .ds-icon-glyph {
  font-size: 20px;
}

.lobby-card-input-row input {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 5px;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 15px;
  padding: 8px 10px;
  margin: 0;
  border-style: dashed;
  color: var(--gold-text);
}

.lobby-card-input-row input::placeholder {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  letter-spacing: 1.5px;
  font-weight: 400;
  text-transform: none;
  color: #5a5040;
}

.lobby-card-input-row input:focus {
  border-style: solid;
}

/* 4-char room code entered → gold glow + solid border so the field visibly
 * "arms" before the player hits Join. */
.lobby-card-input-row input.ready {
  border-style: solid;
  border-color: var(--gold-text);
  box-shadow: 0 0 14px rgba(212, 165, 38, 0.45), inset 0 0 0 1px rgba(232, 213, 160, 0.35);
}

/* Circular gold-framed icon (ds-icon-frame) */
.ds-icon-frame {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, rgba(255, 225, 160, 0.08), rgba(20, 16, 10, 0.6));
  border: 1.5px solid rgba(201, 168, 76, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 225, 160, 0.15),
    0 2px 8px rgba(0, 0, 0, 0.4);
}
.ds-icon-glyph {
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

/* Primary lobby card button (gold brass — matches trade dialog .btn-primary) */
.btn-lobby-card {
  width: 100%;
  padding: 9px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all 0.15s ease;
}

/* Hide the inline button on cards whose entire surface is the click target
 * (Create / Browse / Local Game). The button element stays in the DOM so
 * our delegated card-click handler can still fire button.click(). The Join
 * card's button sits inside .lobby-card-input-row (not a direct child) so
 * this selector doesn't hide it. */
.lobby-card > .btn-lobby-card {
  display: none;
}

.btn-lobby-card-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-color);
  box-shadow:
    inset 0 2px 3px -1px rgba(255, 225, 160, 0.35),
    0 2px 5px rgba(0, 0, 0, 0.4);
}
.btn-lobby-card-primary:hover {
  background: var(--btn-primary-hover-bg);
  color: var(--btn-primary-hover-color);
  transform: translateY(-1px);
  box-shadow:
    inset 0 2px 3px -1px rgba(255, 225, 160, 0.45),
    0 3px 6px rgba(0, 0, 0, 0.45);
}

/* Art Deco divider */
.lobby-deco-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 6px 0 10px;
}

.lobby-deco-divider::before,
.lobby-deco-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #c9a84c 40%, #c9a84c 60%, transparent);
}

.lobby-deco-divider span {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-text);
  text-transform: uppercase;
  letter-spacing: 3px;
  white-space: nowrap;
}

.local-player-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.local-player-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.local-player-num {
  color: var(--gold-text);
  font-size: 14px;
  font-weight: 600;
  min-width: 20px;
}

.local-name-input {
  flex: 1;
  letter-spacing: 1px;
  margin-bottom: 0;
}

#local-add-player-btn {
  margin-bottom: 8px;
}

/* Footer row: studio credit on the left, version on the right, both on
 * the same baseline. Colored in the visible brand gold. */
.lobby-menu-footer {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
}
.lobby-version {
  font-size: 10px;
  color: var(--gold-text);
  font-weight: 700;
  letter-spacing: 2px;
  /* Match the studio-text's vertical offset so both baselines line up. */
  transform: translateY(12px);
}

/* Studio / production credit — brass-gold line, badger icon on the left */
.lobby-studio {
  font-size: 9px;
  color: var(--gold-text);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transform: translateX(-10px);
}
.lobby-studio-text {
  transform: translateY(12px);
}
.lobby-studio-name {
  color: var(--gold-text);
  font-weight: 700;
}
.lobby-studio-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  transform: translateY(10px);
  filter: drop-shadow(0 0 3px rgba(212, 165, 38, 0.4));
}

/* Browse Games button (still used for add-player / add-bot in waiting room) */
.btn-lobby-browse {
  width: 100%;
  padding: 9px 24px;
  font-size: 15px;
  font-weight: 600;
  color: #b8a880;
  background: linear-gradient(180deg, rgba(40, 36, 26, 0.9), rgba(25, 22, 16, 0.95));
  border: 1px solid rgba(120, 105, 75, 0.35);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: 1.5px;
}

.btn-lobby-browse:hover {
  background: linear-gradient(180deg, rgba(70, 66, 56, 0.95), rgba(40, 38, 32, 0.97));
  border-color: #8a7a5a;
  color: #fff;
}

/* Browse Games screen */
.browse-header {
  text-align: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.2);
}

.browse-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--gold-text);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.browse-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
}
.browse-tab {
  flex: 1;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #6a6050;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}
.browse-tab:hover {
  color: var(--gold-text);
}
.browse-tab.active {
  color: var(--gold-text);
  border-bottom-color: var(--gold-text);
}

.browse-room-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
  margin-bottom: 14px;
  padding-top: 2px;
}

.browse-empty {
  text-align: center;
  color: rgba(200, 190, 170, 0.6);
  padding: 32px 16px;
  font-size: 14px;
  font-style: italic;
}

.browse-room-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--gold-bg);
  border: 1px solid var(--gold-border-light);
  border-radius: 4px;
  transition: all 0.25s;
}

.browse-room-card:hover {
  background: var(--gold-bg-hover);
  border-color: var(--gold-text);
  box-shadow: 0 2px 12px rgba(201, 168, 76, 0.1);
  transform: translateY(-1px);
}

.browse-room-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 13px;
  color: rgba(200, 190, 170, 0.6);
  overflow: hidden;
  letter-spacing: 0.5px;
}

.browse-room-host {
  font-size: 13px;
  font-weight: 600;
  color: #e8d5a0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browse-room-badge {
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 2px;
  background: rgba(201, 168, 76, 0.12);
  border: 1px solid rgba(201, 168, 76, 0.25);
  color: var(--gold-text);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}

.btn-browse-join {
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 600;
  color: #1a1206;
  background: linear-gradient(180deg, #d4a526, #9a6e12);
  border: 1px solid #c9a84c;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.25s;
  flex-shrink: 0;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.btn-browse-join:hover {
  background: linear-gradient(180deg, #e8c34a, #c9981e);
  box-shadow: 0 2px 12px rgba(212, 165, 38, 0.25);
  transform: translateY(-1px);
}

/* ── Spectator Badge ─────────────────────── */
.spectator-badge {
  position: fixed;
  top: 12px;
  right: 12px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-text);
  background: rgba(20, 16, 8, 0.85);
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 4px;
  z-index: 100;
  letter-spacing: 0.5px;
}

#leave-spectate-btn { bottom: 16px; }

/* ── Live Game Cards ─────────────────────── */
.live-game-players {
  font-size: 12px;
  color: rgba(200, 190, 170, 0.7);
  margin-top: 2px;
}
/* ── Auth Bar ─────────────────────────────── */
.auth-bar {
  position: absolute;
  top: 14px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 10;
}
/* When the back-to-menu X is visible (browse/waiting views), push the
 * auth bar left so the two controls don't overlap. */
.lobby-panel:has(#back-to-menu-btn:not(.hidden)) .auth-bar {
  right: 64px;
}

/* Login — silver-brass treatment matching the in-game HUD .btn-action. */
.auth-btn-login {
  height: 42px;
  padding: 0 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(78, 80, 84, 0.9) 0%, rgba(52, 54, 58, 0.92) 100%);
  color: #f0e8d8;
  text-shadow: -1px 2px 2px rgba(0, 0, 0, 0.5), -1px 1px 1px rgba(0, 0, 0, 0.35);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  box-shadow:
    inset 0 2px 4px -2px rgba(255, 225, 160, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 3px 8px rgba(0, 0, 0, 0.4);
}
.auth-btn-login:hover {
  background: linear-gradient(180deg, rgb(110, 85, 35) 0%, rgb(75, 58, 24) 100%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 225, 160, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}

/* User dropdown trigger — silver-brass, matches .btn-action and the
 * login/flag buttons in the top bar. */
.auth-btn-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(78, 80, 84, 0.9) 0%, rgba(52, 54, 58, 0.92) 100%);
  color: #f0e8d8;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-shadow: -1px 2px 2px rgba(0, 0, 0, 0.5), -1px 1px 1px rgba(0, 0, 0, 0.35);
  box-shadow:
    inset 0 2px 4px -2px rgba(255, 225, 160, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 3px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.15s ease;
}
.auth-btn-user:hover {
  background: linear-gradient(180deg, rgb(110, 85, 35) 0%, rgb(75, 58, 24) 100%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 225, 160, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}
.auth-btn-user .auth-chevron {
  font-size: 10px;
  opacity: 0.9;
  transition: transform 0.2s;
}
.auth-btn-user[aria-expanded="true"] .auth-chevron {
  transform: rotate(180deg);
}
.auth-username {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Menu popover — same shape language as the lang dropdown. */
.auth-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 170px;
  background: var(--panel-bg);
  border: 1px solid rgba(201, 168, 76, 0.35);
  border-radius: 6px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  box-shadow: var(--panel-shadow);
  z-index: 10;
}
.auth-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: none;
  border: none;
  border-radius: 4px;
  color: rgba(232, 213, 160, 0.8);
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.auth-menu-icon {
  font-size: 14px;
  line-height: 1;
  flex: 0 0 auto;
}
.auth-menu-item:hover {
  background: rgba(212, 165, 38, 0.14);
  color: #fff;
}
.auth-menu-item-danger:hover {
  background: rgba(229, 115, 115, 0.15);
  color: #ffb0b0;
}

/* ── Auth Modal ─────────────────────────────── */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
}

.auth-modal-inner {
  position: relative;
  background: linear-gradient(180deg, rgba(30, 26, 18, 0.97) 0%, rgba(18, 15, 10, 0.98) 100%);
  border: 2px solid #5a4a2a;
  border-radius: 4px;
  padding: 36px 32px 28px;
  width: 360px;
  box-shadow: 0 0 0 1px rgba(201, 168, 76, 0.15), 0 12px 48px rgba(0, 0, 0, 0.6);
}

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: 1px solid rgba(229, 115, 115, 0.3);
  border-radius: 4px;
  color: #e57373;
  font-size: 22px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  z-index: 5;
}
.auth-modal-close:hover {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.5);
  background: rgba(255, 100, 100, 0.1);
}

.auth-title-area {
  text-align: center;
  margin-bottom: 22px;
}
.auth-title-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 4px;
}
.auth-title-text {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 4px;
  color: var(--gold-text);
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--gold-border);
  background: rgba(20, 18, 12, 0.8);
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #6a6050;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.auth-tab.active {
  background: var(--gold-bg-hover);
  color: var(--gold-text);
  border-bottom-color: var(--gold-text);
}
.auth-tab:hover:not(.active) {
  color: #b8a060;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-field {
  position: relative;
}
.auth-field-icon {
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 20px;
  font-size: 14px;
  opacity: 0.5;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.auth-form input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  border-radius: 4px;
  border: 1px solid #4a4030;
  background: rgba(20, 18, 12, 0.8);
  color: #e8d5a0;
  font-size: 14px;
  letter-spacing: 1px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-form input:focus {
  border-color: var(--gold-text);
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.15);
}
.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px rgba(20, 18, 12, 0.95) inset;
  -webkit-text-fill-color: #e8d5a0;
  border-color: #4a4030;
  caret-color: #e8d5a0;
}

.auth-error {
  color: #e85d5d;
  font-size: 12px;
  text-align: center;
  padding: 2px 0;
}

.auth-submit {
  margin-top: 4px;
  padding: 14px;
  border: 2px solid #c9a84c;
  border-radius: 4px;
  background: linear-gradient(180deg, #d4a526, #9a6e12);
  color: #1a1206;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.auth-submit:hover {
  background: linear-gradient(180deg, #e8c34a, #c9981e);
  box-shadow: 0 4px 20px rgba(212, 165, 38, 0.35), 0 0 30px rgba(212, 165, 38, 0.15);
  transform: translateY(-1px);
}

.auth-forgot-link {
  background: none;
  border: none;
  color: #8a7a5a;
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  padding: 6px 0 0;
  display: block;
  width: 100%;
}

.auth-forgot-link:hover {
  color: var(--gold-text);
}

.auth-verify-hint {
  color: #aaa;
  font-size: 13px;
  text-align: center;
  margin-bottom: 10px;
}

/* ── Profile Modal ─────────────────────────────── */
.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
}

.profile-modal-inner {
  position: relative;
  background: #1e1e1e;
  border: 2px solid #3d3526;
  border-radius: 4px;
  user-select: none;
  padding: 36px 28px 28px;
  width: 540px;
  max-width: 95vw;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
}

.profile-header {
  text-align: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #3d352680;
  background: radial-gradient(ellipse at center top, rgba(212, 165, 38, 0.06) 0%, transparent 70%);
  border-radius: 4px 4px 0 0;
  margin: -36px -28px 18px;
  padding: 32px 28px 14px;
}
.profile-avatar {
  font-size: 36px;
  display: block;
  margin-bottom: 4px;
}
.profile-username {
  color: #d4a526;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  margin: 0;
  text-shadow: 0 0 20px rgba(212, 165, 38, 0.3);
}

.profile-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Hero row — top 3 key stats */
.profile-hero-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
}
.profile-hero-row .profile-stat-hero {
  background: var(--gold-bg-light);
  border: 1px solid var(--gold-border);
  padding: 14px 8px 8px;
}
.profile-hero-row .profile-stat-value {
  font-size: 24px;
}
/* Detail list — two-column layout */
.profile-detail-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--gold-bg);
  border: 1px solid rgba(201, 168, 76, 0.12);
  border-radius: 4px;
  padding: 2px 0;
}

.profile-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.06);
}
.profile-detail-row:nth-child(2n) {
  border-left: 1px solid rgba(201, 168, 76, 0.06);
}
.profile-detail-row:nth-last-child(-n+2) {
  border-bottom: none;
}

.profile-detail-label {
  font-size: 11px;
  color: #8a8070;
}

.profile-detail-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-text);
  margin-left: 8px;
  white-space: nowrap;
}
.profile-detail-value.ps-green { color: #5ce65c; }
.profile-detail-value.ps-red { color: #e57373; }

/* Keep .profile-stat for hero boxes */
.profile-stat {
  background: #2a2a24;
  border: 1px solid #3a3530;
  border-radius: 4px;
  padding: 10px 8px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.profile-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold-text);
  flex: 1;
  display: flex;
  align-items: center;
}
.profile-stat-value.ps-green { color: #5ce65c; }
.profile-stat-value.ps-red { color: #e57373; }

.profile-stat-label {
  font-size: 10px;
  color: #8a8070;
  letter-spacing: 0.3px;
  line-height: 1.2;
  margin-top: 2px;
}

/* Profile actions */
.profile-actions {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}
.profile-action-btn {
  padding: 5px 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 4px;
  cursor: pointer;
  background: var(--gold-bg-hover);
  color: var(--gold-text);
  transition: all 0.2s;
}
.profile-action-btn:hover {
  background: rgba(201, 168, 76, 0.18);
  border-color: rgba(201, 168, 76, 0.5);
}

/* Game History */
.history-empty {
  text-align: center;
  color: #6a6050;
  padding: 20px;
  font-size: 13px;
}
.history-list {
}

.history-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 0 2px;
  margin-top: 8px;
  border-top: 1px solid var(--gold-border-light);
}

.history-page-btn {
  background: none;
  border: 1px solid var(--gold-border);
  border-radius: 4px;
  color: var(--gold-text);
  font-size: 18px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.history-page-btn:hover:not(:disabled) {
  background: var(--gold-bg-hover);
  border-color: var(--gold-text);
}

.history-page-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.history-page-info {
  font-size: 12px;
  color: #888;
  letter-spacing: 0.5px;
}
.history-game-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  border: 1px solid rgba(201, 168, 76, 0.08);
  border-radius: 4px;
  margin-bottom: 4px;
  transition: background 0.15s;
}
.history-game-row:hover {
  background: var(--gold-bg-light);
}
.history-game-row.expanded {
  background: var(--gold-bg-hover);
  border-color: rgba(201, 168, 76, 0.2);
}
.history-medal {
  font-size: 16px;
  min-width: 22px;
  text-align: center;
}
.history-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.history-date {
  font-size: 12px;
  color: #c0b8a0;
  font-weight: 600;
}
.history-meta {
  font-size: 10px;
  color: #6a6050;
}
.history-money {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-text);
  white-space: nowrap;
}
.history-detail {
  margin: 0 0 6px 30px;
  padding: 6px 0;
}
.history-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.history-winner {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-text);
  text-align: center;
  padding: 6px 8px;
  margin-top: 4px;
  background: var(--gold-bg-hover);
  border: 1px solid var(--gold-border-light);
  border-radius: 4px;
}

.token-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  justify-content: center;
}

.token-btn {
  background: #2a2a24;
  border: 2px solid #4a4538;
  border-radius: 8px;
  color: #eee;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.token-btn:hover {
  border-color: #d4a526;
}

.token-btn.selected {
  background: #b8891d;
  border-color: #d4a526;
}

.btn-primary {
  background: linear-gradient(180deg, #d4a526, #9a6e12);
  border: 2px solid #c9a84c;
  border-radius: 4px;
  color: #1a1206;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  width: 100%;
  margin: 0;
  transition: all 0.25s;
  letter-spacing: 0.5px;
}

.btn-primary:hover {
  background: linear-gradient(180deg, #e8c34a, #c9981e);
  box-shadow: 0 4px 20px rgba(212, 165, 38, 0.35), 0 0 30px rgba(212, 165, 38, 0.15);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(212, 165, 38, 0.3);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-primary:disabled:hover {
  box-shadow: none;
  transform: none;
}
.btn-ready {
  background: linear-gradient(180deg, rgba(180, 60, 60, 0.4), rgba(120, 40, 40, 0.5));
  border: 2px solid rgba(180, 60, 60, 0.5);
  border-radius: 4px;
  color: #c8a0a0;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  width: 100%;
  margin: 0;
  transition: all 0.25s;
}

.btn-ready:hover {
  background: linear-gradient(180deg, rgba(180, 60, 60, 0.5), rgba(120, 40, 40, 0.6));
  border-color: rgba(200, 70, 70, 0.7);
  color: #e0c0c0;
  transform: translateY(-1px);
}

.btn-ready:active {
  transform: translateY(0);
}

.btn-ready.is-ready {
  background: linear-gradient(180deg, #2A8C5E, #1a6b42);
  border-color: #35a870;
  color: #fff;
  box-shadow: 0 4px 20px rgba(42, 140, 94, 0.25);
}

.player-ready-badge {
  font-size: 11px;
  color: #2A8C5E;
  font-weight: 600;
}

.player-not-ready-badge {
  font-size: 11px;
  color: #8a7a5a;
}

.btn-secondary {
  background: transparent;
  border: 1px solid #5a4a2a;
  border-radius: 4px;
  color: #b8a880;
  padding: 8px 24px;
  font-size: 14px;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: #888;
  color: #ccc;
}

.room-code {
  font-family: 'Courier New', monospace;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 4px;
  color: var(--gold-text);
  text-shadow: 0 0 8px rgba(201, 168, 76, 0.2);
  transition: color 0.2s, text-shadow 0.2s;
  line-height: 1;
}
.btn-copy-link {
  background: linear-gradient(180deg, rgba(50, 44, 30, 0.95), rgba(28, 24, 16, 0.97));
  border: 1px solid #5a4a2a;
  border-radius: 4px;
  color: var(--gold-text);
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  letter-spacing: 1px;
}
.btn-copy-link:hover {
  background: linear-gradient(180deg, rgba(70, 66, 56, 0.95), rgba(40, 38, 32, 0.97));
  border-color: #8a7a5a;
  color: #fff;
}

#player-list {
  margin: 16px 0;
  text-align: left;
}

/* Empty player slot — dashed border, muted italic label, no color bar. */
.player-list-item-empty {
  background: transparent;
  border-style: dashed;
  border-color: rgba(201, 168, 76, 0.18);
  opacity: 0.65;
  font-style: italic;
  color: rgba(232, 213, 160, 0.35);
  justify-content: center;
  padding-left: 10px;
}
.player-list-item-empty > span {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Add Bot stays in layout at full capacity — just dimmed + disabled. */
#add-bot-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.player-list-item {
  --player-color: #666;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 16px;
  margin-bottom: 4px;
  /* Fixed height (not min-height) so filled and empty slots match to the
   * pixel — filled rows had a taller line-box from the 15px name font. */
  height: 36px;
  background: linear-gradient(180deg, rgba(42, 36, 22, 0.5) 0%, rgba(22, 18, 12, 0.6) 100%);
  border: 1px solid rgba(201, 168, 76, 0.18);
  border-radius: 4px;
  letter-spacing: 0.3px;
  overflow: hidden;
  box-sizing: border-box;
}

/* Vertical colored bar on the left — same pattern as mortgage/trade
 * tiles. Uses the player's token color. */
.player-slot-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--player-color);
}

.player-slot-name {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: #e8e0d0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-host-crown {
  font-size: 11px;
  line-height: 1;
  filter: drop-shadow(0 0 4px rgba(245, 215, 124, 0.5));
}

.player-bot-badge {
  font-size: 12px;
  line-height: 1;
}

.player-ready-badge {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  color: #6ee095;
  text-shadow: 0 0 6px rgba(110, 224, 149, 0.5);
}

/* Ready slot — green border color + subtle green bg tint. Border width
 * stays 1px, no shadow layer — layout is pixel-identical to unready. */
.player-list-item-ready {
  border-color: rgba(42, 140, 94, 0.7);
  background: linear-gradient(180deg, rgba(40, 110, 70, 0.18) 0%, rgba(28, 78, 50, 0.22) 100%);
}

.bot-remove-btn {
  background: none;
  border: none;
  color: #c9a84c;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 4px;
  opacity: 0.55;
  flex: 0 0 auto;
}
.bot-remove-btn:hover { opacity: 1; color: #e74c3c; }

.settings-panel {
  margin: 16px 0;
  text-align: left;
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  border-radius: 4px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-heading {
  color: var(--gold-text);
  font-weight: 600;
  font-size: 15px;
  padding: 0 0 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.3);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-heading-icon {
  font-size: 18px;
}

.settings-columns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Settings tabs */
.settings-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

/* Pill-chip toolbar buttons — Private / No Spectators / Reset. Matches
 * the brass pill language used elsewhere in the lobby. */
.btn-settings-toggle,
.btn-reset-settings {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: rgba(40, 36, 26, 0.5);
  border: 1px solid rgba(201, 168, 76, 0.22);
  border-radius: 14px;
  color: rgba(232, 213, 160, 0.55);
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-settings-toggle:hover,
.btn-reset-settings:hover {
  color: var(--gold-text);
  border-color: rgba(232, 213, 160, 0.55);
  background: rgba(70, 60, 40, 0.65);
}
.btn-settings-toggle.active {
  color: #1a1206;
  background: linear-gradient(180deg, #d4a526, #9a6e12);
  border-color: #c9a84c;
}
.btn-settings-toggle:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn-reset-settings {
  margin-left: auto;
}

/* Segmented control — one rounded brass container, equal-width segments
 * divided by thin gold lines. Only one segment lit at a time. */
.settings-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  padding: 2px;
  background: rgba(24, 20, 12, 0.55);
  border: 1px solid rgba(201, 168, 76, 0.28);
  border-radius: 10px;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.4),
    inset 0 -1px 0 rgba(255, 225, 160, 0.05);
  overflow: hidden;
}

.settings-tab {
  flex: 1;
  padding: 7px 8px;
  background: none;
  border: none;
  border-radius: 8px;
  color: rgba(232, 213, 160, 0.55);
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  cursor: pointer;
  position: relative;
  transition: color 0.15s, background 0.15s;
}

/* Vertical divider between segments (thin gold rule, skipped on the
 * segment immediately after the active one so it doesn't overlap the
 * active pill border). */
.settings-tab + .settings-tab::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 1px;
  background: rgba(201, 168, 76, 0.22);
}

.settings-tab:hover {
  color: var(--gold-text);
}

.settings-tab.active {
  color: #1a1206;
  background: linear-gradient(180deg, #d4a526, #9a6e12);
  box-shadow:
    inset 0 1px 0 rgba(255, 235, 180, 0.45),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.35);
}
.settings-tab.active::before,
.settings-tab.active + .settings-tab::before {
  opacity: 0; /* hide dividers on both sides of the active segment */
}

/* Stack every pane in the same grid cell so the container always sizes
 * to the tallest pane — switching tabs doesn't shrink/grow the panel. */
.settings-tab-content {
  display: grid;
}

.settings-tab-pane {
  grid-column: 1;
  grid-row: 1;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}
.settings-tab-pane.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
/* When a pane is outright hidden (e.g. Kards with action cards off), it
 * should drop out of layout entirely and not reserve height. */
.settings-tab-pane.hidden {
  display: none;
}

.settings-section {
  background: rgba(201, 168, 76, 0.02);
  border: 1px solid rgba(201, 168, 76, 0.12);
  border-radius: 4px;
  /* visible so the custom row tooltips can escape the card border */
  overflow: visible;
}

.settings-section-title {
  font-size: 11px;
  font-weight: 600;
  color: #b8a060;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(90, 80, 64, 0.15);
}

.settings-section-body {
  padding: 6px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}


.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 24px;
  position: relative;
}

/* Custom brass tooltip — pulls content from data-hint attribute. Triggered
 * by hovering the small ⓘ icon in the label row, NOT the whole row, so
 * scanning down the list never accidentally surfaces a tooltip. Since the
 * user targeted a small icon deliberately, the show delay can be brief. */
.setting-row[data-hint]::after {
  content: attr(data-hint);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  max-width: 280px;
  padding: 7px 11px;
  background: linear-gradient(180deg, rgba(54, 46, 30, 0.98) 0%, rgba(26, 22, 14, 0.98) 100%);
  border: 1px solid rgba(212, 165, 38, 0.55);
  border-radius: 5px;
  color: #f4e9cf;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: none;
  line-height: 1.35;
  white-space: normal;
  pointer-events: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 225, 160, 0.14),
    0 6px 20px rgba(0, 0, 0, 0.65);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.12s ease-out, transform 0.12s ease-out;
  z-index: 50;
}
.setting-row[data-hint]:has(.setting-info-icon:hover)::after {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.12s ease-out 0.1s, transform 0.12s ease-out 0.1s;
}

/* ⓘ icon — small brass glyph next to the label. Placed into the
 * label-wrap dynamically by applyHintTooltips() in lobby.ts. */
.setting-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  font-size: 13px;
  line-height: 1;
  color: rgba(212, 165, 38, 0.55);
  cursor: help;
  transition: color 0.12s ease-out, transform 0.12s ease-out;
  user-select: none;
}
.setting-info-icon:hover {
  color: rgba(240, 210, 120, 0.95);
  transform: scale(1.15);
}

/* Label-wrap layout adjusts when a ⓘ icon is present: label and icon on
 * row 1, hint (visually hidden anyway) spans row 2. */
.setting-label-wrap:has(.setting-info-icon) {
  display: grid;
  grid-template-columns: auto auto;
  grid-auto-rows: auto;
  column-gap: 6px;
  align-items: center;
}
.setting-label-wrap:has(.setting-info-icon) > .setting-label { grid-column: 1; grid-row: 1; }
.setting-label-wrap:has(.setting-info-icon) > .setting-info-icon { grid-column: 2; grid-row: 1; justify-self: start; }
.setting-label-wrap:has(.setting-info-icon) > .setting-hint { grid-column: 1 / -1; grid-row: 2; }

.settings-divider {
  border-top: 1px solid var(--gold-border-light);
  margin: 4px 0;
}

.setting-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.setting-label-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

/* Hints are surfaced via a native browser tooltip on hover (see
 * applyHintTooltips() in lobby.ts). Hidden visually to keep rows tight. */
.setting-hint {
  display: none;
}

.settings-sub {
  padding-left: 16px;
  border-left: 2px solid rgba(212, 165, 38, 0.3);
  margin: 4px 0 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-sub .setting-label {
  font-size: 12px;
  color: #aaa;
}

.setting-select {
  background: #2a2a24;
  border: 1px solid #4a4538;
  border-radius: 8px;
  color: #eee;
  padding: 7px 12px;
  font-size: 14px;
  cursor: pointer;
}

.setting-select:focus {
  outline: none;
  border-color: #d4a526;
}

/* Stepper control */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  background: #2a2a24;
  border: 1px solid #4a4538;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.stepper-btn {
  background: transparent;
  border: none;
  color: #d4a526;
  font-size: 18px;
  font-weight: bold;
  width: 32px;
  height: 34px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  user-select: none;
}

.stepper-btn:hover {
  background: rgba(212, 165, 38, 0.15);
}

.stepper-btn:active {
  background: rgba(212, 165, 38, 0.3);
}

.stepper-btn:disabled {
  color: #555;
  cursor: not-allowed;
}

.stepper-btn:disabled:hover {
  background: transparent;
}

.stepper-value {
  width: 70px !important;
  background: transparent !important;
  border: none !important;
  border-left: 1px solid #3a3530 !important;
  border-right: 1px solid #3a3530 !important;
  border-radius: 0 !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 600;
  text-align: center !important;
  padding: 6px 4px !important;
  margin: 0 !important;
  -moz-appearance: textfield;
}

.stepper-value::-webkit-outer-spin-button,
.stepper-value::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Toggle switch */
.setting-toggle-row {
  padding: 2px 0;
}

.setting-highlighted {
  background: rgba(201, 168, 76, 0.12);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 4px;
  padding: 4px 8px;
  margin: 2px -8px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #2a2520;
  border: 1px solid #4a4030;
  border-radius: 12px;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  bottom: 2px;
  background: #6a6050;
  border-radius: 50%;
  transition: transform 0.25s, background 0.25s;
}

.toggle-switch input:checked + .toggle-slider {
  background: rgba(201, 168, 76, 0.25);
  border-color: var(--gold-text);
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.15);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: #c9a84c;
}

.toggle-switch input:disabled + .toggle-slider {
  opacity: 0.4;
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

/* HUD */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  user-select: none;
}

#player-info-strip {
  display: flex;
  gap: 10px;
  padding: 10px;
  overflow-x: auto;
  pointer-events: auto;
}

.player-info-card {
  /* Shared drop-shadow for text/icons in the card (money, name, card count,
   * detail rows). Keeps the depth consistent across every element. */
  --hud-text-drop: drop-shadow(-1px 2px 2px rgba(0, 0, 0, 0.5)) drop-shadow(-1px 1px 1px rgba(0, 0, 0, 0.35));
  background: linear-gradient(180deg, rgba(78, 80, 84, 0.9) 0%, rgba(52, 54, 58, 0.92) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 4px;
  padding: 10px 15px 10px 18px;
  /* Fixed width — card doesn't re-flow when activity/shield/jail badges pop
   * in. The `.name-label` inside the name row handles overflow via ellipsis,
   * so long player names shrink rather than growing the card. */
  width: 195px;
  border: none;
  /* Subtle glass-like 3D: bright hairline on top edge catches "light",
   * dark hairline on bottom edge suggests the card curves down/away. */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35);
  transition: all 0.2s;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

/* Vertical bar on left edge — player token color identity */
.player-color-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}


.player-info-card.active {
  /* Warmer-gray gradient distinguishes the current-turn card from the cooler
   * non-active cards. No inset glow — a gold inset shadow at even 0.25 alpha
   * blends with the warm gradient to tint the edges orange, which reads as
   * an unwanted frame around the card. Keep the dark outer drop-shadow for
   * depth matching the base card. */
  background: linear-gradient(180deg, rgb(110, 85, 35) 0%, rgb(75, 58, 24) 100%);
  /* Warmer highlight/shadow for the active card so the glass feel reads
   * "polished brass" rather than the cooler gray of non-active cards. */
  box-shadow:
    inset 0 1px 0 rgba(255, 225, 160, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45);
}

.player-info-card.bankrupt {
  opacity: 0.4;
}

.player-info-card.disconnected {
  opacity: 0.55;
  border-color: rgba(255, 70, 70, 0.35);
}

.dc-badge {
  font-size: 12px;
  margin-left: 2px;
  color: #ff6666;
  animation: dc-pulse 2s ease-in-out infinite;
}

.dc-timer {
  font-size: 11px;
  font-weight: 600;
  color: #ff6666;
}

@keyframes dc-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.btn-bankrupt {
  background: rgba(140, 25, 25, 0.5) !important;
  border-color: rgba(220, 60, 60, 0.4) !important;
}

.btn-bankrupt:hover {
  background: rgba(200, 40, 40, 0.5) !important;
  border-color: rgba(220, 60, 60, 0.6) !important;
}

.player-info-card .name {
  font-weight: bold;
  font-size: 17px;
  line-height: 22px;
  min-height: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  filter: var(--hud-text-drop);
  /* Name row overflows via the .name-label inside — everything after the
   * label (shield/activity/jail/dc badges) stays at full size. */
  min-width: 0;
}
/* The label (name + bot icon + YOU) is the elastic member of the name row.
 * If the name is too long relative to badges, it ellipsis-trims rather than
 * pushing the card wider. inline-block (not flex) so text-overflow: ellipsis
 * actually applies to the trailing text content. */
.player-info-card .name-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-info-card .name-label .hud-bot-icon {
  margin-left: 4px;
}
.player-info-card .name > :not(.name-label) {
  flex: 0 0 auto;
}

.hud-bot-icon {
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.hud-jail-icon {
  display: inline-block;
  font-size: 18px;
  vertical-align: middle;
  margin-left: 4px;
  filter:
    drop-shadow(0 0 4px rgba(255, 0, 0, 1))
    drop-shadow(0 0 8px rgba(255, 30, 30, 0.9))
    drop-shadow(0 0 14px rgba(255, 60, 60, 0.6))
    hue-rotate(-20deg) saturate(1.5);
}

.player-color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
  margin-right: 4px;
  vertical-align: middle;
}

.player-info-card .money {
  color: #35c070;
  font-size: 22px;
  font-weight: bold;
  line-height: 1;
  white-space: nowrap;
  /* drop-shadow (not text-shadow) because .reel-column overflow:hidden would
   * clip a per-column text-shadow at each column's rectangular edge, making
   * the box corners faintly visible. filter:drop-shadow operates on the
   * composited silhouette so it hugs the digits instead. */
  filter: var(--hud-text-drop);
}

.player-info-card .money.negative {
  color: #ff4444;
}

/* Slot-machine digit reels. Animation state is in JS (money-reel.ts); these
 * styles only lay out the structure. DO NOT add `transition` here — CSS
 * transitions don't survive DOM rebuilds, which is why prior attempts failed.
 *
 * Everything is sized in em so it auto-scales with font-size and sub-pixel
 * drift can't accumulate between columns. 1em == one cell height == one digit. */
.money-value {
  display: inline-block;
  vertical-align: baseline;
  line-height: 1;
}

.money-prefix {
  display: inline-block;
  line-height: 1;
}

.reel-column {
  display: inline-block;
  width: 0.62em;            /* tune to digit glyph width */
  height: 1em;              /* exactly one cell */
  overflow: hidden;
  line-height: 1;
  /* An overflow:hidden inline-block's synthesized baseline is its bottom
   * margin edge, but the digit text inside sits with its baseline about
   * 0.2em above the cell bottom. Shifting the whole column down by that
   * amount makes the visible digit's text-baseline align with the '$'
   * prefix's text-baseline. Tune if another font changes the metric. */
  vertical-align: -0.2em;
}

.reel-strip {
  display: block;
  line-height: 1;
  will-change: transform;
}

.reel-cell {
  display: block;
  height: 1em;
  line-height: 1;
  text-align: center;
}

.money-suffix {
  display: inline-block;
  vertical-align: baseline;
  margin-left: 8px;
}

.hud-card-count {
  font-size: 14px;
  color: rgba(201, 168, 76, 0.7);
  margin-left: 6px;
  font-weight: 600;
  letter-spacing: 0.5px;
  position: relative;
  top: -4px;
  /* No filter here — the parent .money already applies --hud-text-drop;
   * stacking them doubles the shadow and makes this badge look darker. */
}

.player-info-card .token {
  font-size: 15px;
  color: #999;
}

.player-info-card {
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

.player-info-card.rent-flash-payer,
.player-info-card.rent-flash-payer-large,
.player-info-card.rent-flash-payer-huge {
  animation: rent-card-hit-red 0.9s ease-out;
}

.player-info-card.rent-flash-owner,
.player-info-card.rent-flash-owner-large,
.player-info-card.rent-flash-owner-huge {
  animation: rent-card-hit-gold 0.9s ease-out;
}

.player-info-card.rent-flash-payer-large,
.player-info-card.rent-flash-owner-large {
  animation-duration: 1.15s;
}

.player-info-card.rent-flash-payer-huge,
.player-info-card.rent-flash-owner-huge {
  animation-duration: 1.35s;
}

@keyframes rent-card-hit-red {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  }
  20% {
    transform: translateY(-2px) scale(1.025);
    background: linear-gradient(135deg, rgba(255, 122, 122, 0.32), rgba(150, 28, 28, 0.18));
    border-color: rgba(255, 120, 120, 0.7);
    box-shadow: 0 0 0 1px rgba(255, 120, 120, 0.22), 0 0 18px rgba(190, 40, 40, 0.22), 0 4px 16px rgba(0, 0, 0, 0.3);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes rent-card-hit-gold {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  }
  20% {
    transform: translateY(-2px) scale(1.025);
    background: linear-gradient(135deg, rgba(255, 214, 102, 0.34), rgba(201, 168, 76, 0.16));
    border-color: rgba(255, 214, 102, 0.74);
    box-shadow: 0 0 0 1px rgba(255, 214, 102, 0.2), 0 0 18px rgba(232, 196, 74, 0.24), 0 4px 16px rgba(0, 0, 0, 0.3);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.player-detail {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.player-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  color: #bba;
  padding: 2px 0;
  filter: var(--hud-text-drop);
}

.player-detail-prop {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 13px;
  color: #ccc;
  padding: 0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1px;
  filter: var(--hud-text-drop);
}
.player-detail-prop .prop-row-strip { width: 5px; align-self: stretch; }
.player-detail-prop .prop-row-name { padding: 2px 6px; font-size: 13px; }

#action-buttons {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: center;
  pointer-events: auto;
  z-index: 20;
  user-select: none;
}

#action-buttons > .btn-action {
  padding: 10px 16px 8px;
  font-size: 17.5px;
  min-width: 90px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  height: auto;
  max-height: 60px;
}

#action-buttons > .btn-action .btn-icon {
  font-size: 24px;
  line-height: 1;
}

#action-buttons > .btn-action .btn-label {
  font-size: 13px;
  line-height: 1.2;
}

#action-buttons > .btn-action.hidden {
  display: flex !important;
  visibility: hidden;
  pointer-events: none;
}

.btn-action {
  /* Match the player-info-card look: gray gradient body, no outline,
   * brass-warm inset highlight on top edge for glass 3D, text/icon drop
   * shadows. Keeps the whole HUD visually unified. */
  background: linear-gradient(180deg, rgba(78, 80, 84, 0.9) 0%, rgba(52, 54, 58, 0.92) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: none;
  border-radius: 4px;
  color: #f0e8d8;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-shadow: -1px 2px 2px rgba(0, 0, 0, 0.5), -1px 1px 1px rgba(0, 0, 0, 0.35);
  /* Softer top glow (no hard 1px edge), harder bottom inset, plus an outer
   * drop shadow so the button visibly lifts off the surface. */
  box-shadow:
    inset 0 2px 4px -2px rgba(255, 225, 160, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 3px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.15s ease;
}

.btn-action:hover {
  background: linear-gradient(180deg, rgb(110, 85, 35) 0%, rgb(75, 58, 24) 100%);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 225, 160, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5);
  transform: translateY(-1px);
}

.btn-action:active {
  transform: translateY(1px);
  background: linear-gradient(180deg, rgba(48, 44, 32, 0.95) 0%, rgba(30, 26, 18, 0.98) 100%);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.4),
    inset 0 -1px 0 rgba(255, 225, 160, 0.1);
}

.btn-action.blink {
  animation: btn-blink 1.5s ease-in-out infinite;
}
.btn-action.blink-urgent {
  animation: btn-blink-urgent 0.6s ease-in-out infinite;
}

/* Blink animations: idle state matches the new gray+brass button look;
 * peak state swaps to the dark-gold gradient (normal) or red (urgent). */
@keyframes btn-blink {
  0%, 100% {
    background: linear-gradient(180deg, rgba(78, 80, 84, 0.9) 0%, rgba(52, 54, 58, 0.92) 100%);
    box-shadow:
      inset 0 1px 0 rgba(255, 225, 160, 0.18),
      inset 0 -1px 0 rgba(0, 0, 0, 0.4);
  }
  50% {
    background: linear-gradient(180deg, rgb(110, 85, 35) 0%, rgb(75, 58, 24) 100%);
    box-shadow:
      inset 0 1px 0 rgba(255, 225, 160, 0.4),
      inset 0 -1px 0 rgba(0, 0, 0, 0.5);
  }
}
@keyframes btn-blink-urgent {
  0%, 100% {
    background: linear-gradient(180deg, rgba(78, 80, 84, 0.9) 0%, rgba(52, 54, 58, 0.92) 100%);
    box-shadow:
      inset 0 1px 0 rgba(255, 180, 180, 0.18),
      inset 0 -1px 0 rgba(0, 0, 0, 0.4);
  }
  50% {
    background: linear-gradient(180deg, rgba(180, 50, 50, 0.95) 0%, rgba(130, 30, 30, 0.98) 100%);
    box-shadow:
      inset 0 1px 0 rgba(255, 180, 180, 0.4),
      inset 0 -1px 0 rgba(0, 0, 0, 0.5);
  }
}

#game-log {
  position: fixed;
  top: 8px;
  right: 8px;
  width: 320px;
  max-height: 80px;
  overflow: hidden;
  background: rgba(30, 28, 24, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--gold-border);
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: max-height 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  z-index: 15;
}

#game-log.expanded {
  max-height: 400px;
  overflow-y: auto;
  cursor: default;
}

.log-entry {
  padding: 2px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Dialogs */
.dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: none;
  border-radius: 4px;
  box-shadow: var(--panel-shadow);
  text-shadow: var(--ui-text-shadow);
  padding: 24px;
  z-index: 50;
  min-width: 300px;
  max-width: 500px;
}

.dialog h3 {
  margin-bottom: 12px;
  color: #d4a526;
}

.dialog p {
  margin-bottom: 8px;
}

.dialog .btn-action {
  margin: 4px;
}

/* Railroad Travel Dialog */
.railroad-travel-dialog {
  width: 320px;
  max-width: 90vw;
  background: var(--panel-bg);
  border: none;
  border-radius: 4px;
  box-shadow: var(--panel-shadow);
  text-shadow: var(--ui-text-shadow);
  padding: 0;
  display: flex;
  flex-direction: column;
}



.railroad-travel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gold-border-medium);
  margin-bottom: 0;
}

.railroad-travel-header h3 {
  margin: 0;
  color: var(--gold-text);
  font-size: 18px;
  font-weight: 600;
}

.railroad-travel-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.railroad-travel-desc {
  color: #aaa;
  font-size: 13px;
  padding: 8px 18px 0;
  margin-bottom: 0;
}

.railroad-travel-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
}

.railroad-travel-dest {
  display: flex !important;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px !important;
  text-align: left;
}

.railroad-dest-arrow {
  font-size: 16px;
  color: #888;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.railroad-dest-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.railroad-dest-name {
  flex: 1;
  font-size: 14px;
}

.railroad-travel-skip {
  display: flex !important;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px !important;
  text-align: left;
  opacity: 0.7;
}

.railroad-travel-skip:hover {
  opacity: 1;
}

.railroad-travel-timer {
  padding: 8px 18px 12px;
  text-align: center;
  color: #888;
  font-size: 12px;
}

/* Wheel Spin Dialog — circular frame */
.wheel-spin-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  background: rgba(30, 28, 24, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 50%;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 600px;
  height: 600px;
  overflow: hidden;
  box-shadow:
    0 0 0 3px #b8891d,
    0 0 0 6px rgba(212, 165, 38, 0.3),
    0 0 30px rgba(212, 165, 38, 0.15),
    0 0 60px rgba(0, 0, 0, 0.5);
}
.wheel-spin-dialog canvas {
  display: block;
  will-change: transform;
  transform-origin: 50% 50%;
}
#wheel-pointer {
  position: absolute;
  top: 4px;
  left: 50%;
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 28px solid #fff;
  transform: translateX(-50%);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
  z-index: 2;
  pointer-events: none;
}
#wheel-pointer.bounce {
  animation: wheel-pointer-bounce 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes wheel-pointer-bounce {
  0%   { transform: translateX(-50%) translateY(0); }
  40%  { transform: translateX(-50%) translateY(8px); }
  100% { transform: translateX(-50%) translateY(0); }
}
#wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1e1e1e;
  border: 2px solid #d4a526;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(212, 165, 38, 0.35);
}

/* Game Over */
/* ── Game Over Dialog (Art Deco style) ── */
.game-over-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(180deg, rgba(30, 26, 18, 0.97) 0%, rgba(18, 15, 10, 0.98) 100%);
  border: 2px solid #5a4a2a;
  border-radius: 4px;
  user-select: none;
  z-index: 60;
  min-width: 360px;
  max-width: 700px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow:
    0 0 0 1px rgba(212, 165, 38, 0.15),
    0 0 60px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(212, 165, 38, 0.1);
}
.game-over-header {
  text-align: center;
  padding: 24px 24px 12px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.3);
}
.game-over-trophy {
  font-size: 48px;
  margin-bottom: 4px;
}
.game-over-header h2 {
  color: var(--gold-text);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin: 0;
}
.game-over-stats {
  padding: 14px 24px 24px;
}
.go-top-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.go-top-row > .go-section {
  flex: 1 1 200px;
  min-width: 0;
}
.go-section {
  margin-bottom: 14px;
  background: var(--gold-bg);
  border: 1px solid rgba(201, 168, 76, 0.12);
  border-radius: 4px;
  padding: 12px 14px;
}
.go-section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold-text);
  font-weight: 700;
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.2);
}
.go-standing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  margin-bottom: 2px;
}
.go-standing:first-of-type {
  background: var(--gold-bg-hover);
  border: 1px solid var(--gold-border-light);
}
.go-bankrupt {
  opacity: 0.5;
}
.go-medal {
  font-size: 16px;
  min-width: 24px;
  text-align: center;
  color: var(--gold-text);
}
.go-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.go-pname {
  font-weight: bold;
  color: #e8e0d0;
  flex-shrink: 0;
}
.go-pdetail {
  color: #9a9080;
  font-size: 12px;
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}
.go-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 8px;
  font-size: 13px;
  color: #c0b8a0;
  gap: 12px;
}
.go-row span:first-child {
  color: #9a9080;
}
.go-pos { color: #5ce65c; }
.go-neg { color: #ff6666; }
.go-player-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.go-player-card {
  flex: 1 1 0;
  min-width: 150px;
  background: var(--gold-bg);
  border: 1px solid var(--gold-border-light);
  border-radius: 4px;
  padding: 12px;
}
.go-player-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--gold-text);
  font-size: 13px;
  letter-spacing: 0.5px;
  padding: 0 0 6px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.2);
}
.game-over-footer {
  padding: 12px 20px 20px;
  text-align: center;
}
.game-over-btn {
  background: linear-gradient(180deg, #c9a84c, #a6872e);
  color: #1a1a1a;
  border: 1px solid #5a4a2a;
  border-radius: 4px;
  padding: 10px 48px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}
.game-over-btn:hover {
  background: linear-gradient(180deg, #d4b552, #c9a84c);
}

/* Wheel Ready Button */
.wheel-ready {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
}

.btn-wheel-spin {
  background: linear-gradient(180deg, #d4a526 0%, #a07516 50%, #d4a526 100%);
  border: 2px solid #e8c34a;
  border-radius: 4px;
  color: #1a1206;
  padding: 18px 44px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
  box-shadow:
    0 4px 20px rgba(212, 165, 38, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.2s ease;
  animation: wheel-btn-pulse 1.5s ease-in-out infinite;
}

.btn-wheel-spin:hover {
  background: linear-gradient(180deg, #e8c34a 0%, #c9981e 50%, #e8c34a 100%);
  border-color: #f0d060;
  box-shadow:
    0 6px 28px rgba(212, 165, 38, 0.6),
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}

.btn-wheel-spin:active {
  transform: scale(0.97);
  box-shadow:
    0 2px 10px rgba(212, 165, 38, 0.3),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes wheel-btn-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(212, 165, 38, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
  50% { box-shadow: 0 4px 28px rgba(212, 165, 38, 0.7), 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
}

/* Wheel of Fortune */
#wheel-spin-dialog {
  min-width: 360px;
  text-align: center;
}

#wheel-canvas {
  display: block;
  margin: 12px auto;
  border-radius: 50%;
}

#wheel-result-text {
  font-size: 18px;
  font-weight: bold;
  color: #d4a526;
  margin-top: 8px;
}

.wheel-choice-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  width: 380px;
  max-width: 90vw;
  max-height: 85vh;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--gold-border);
  border-radius: 4px;
  box-shadow: var(--panel-shadow);
  display: flex;
  flex-direction: column;
}

.wheel-choice-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gold-border-medium);
}

.wheel-choice-header h3 {
  margin: 0;
  color: var(--gold-text);
  font-size: 18px;
  font-weight: 600;
}

.wheel-choice-header-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.wheel-choice-list {
  padding: 12px;
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wheel-choice-list .btn-action {
  display: flex !important;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px !important;
  text-align: left;
  margin: 0;
}

.wheel-choice-timer {
  padding: 8px 18px 12px;
  text-align: center;
  color: #888;
  font-size: 12px;
}


/* Disconnect Vote Dialog */
.disconnect-vote-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: confirm-fade-in 0.15s ease-out;
}

.disconnect-vote-dialog {
  background: var(--panel-bg);
  border: 1px solid var(--gold-border);
  border-radius: 4px;
  box-shadow: var(--panel-shadow);
  padding: 20px 24px;
  min-width: 280px;
  max-width: 360px;
  text-align: center;
  user-select: none;
}

.disconnect-vote-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.disconnect-vote-header h3 {
  margin: 0;
  color: #e57373;
  font-size: 16px;
  font-weight: 600;
}

.disconnect-vote-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.disconnect-vote-text {
  color: #aaa;
  font-size: 14px;
  margin: 0 0 16px;
}

.disconnect-vote-timer {
  font-size: 28px;
  font-weight: 700;
  color: var(--gold-text);
  margin-bottom: 16px;
}

.disconnect-vote-buttons {
  display: flex;
  gap: 10px;
}

.disconnect-vote-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.disconnect-vote-wait {
  background: var(--btn-positive-bg);
  border-color: var(--btn-positive-border);
  color: var(--btn-positive-color);
}

.disconnect-vote-wait:hover:not(:disabled) {
  background: var(--btn-positive-hover-bg);
  border-color: var(--btn-positive-hover-border);
  color: var(--btn-positive-hover-color);
}

.disconnect-vote-remove {
  background: var(--btn-negative-bg);
  border-color: var(--btn-negative-border);
  color: var(--btn-negative-color);
}

.disconnect-vote-remove:hover:not(:disabled) {
  background: var(--btn-negative-hover-bg);
  border-color: var(--btn-negative-hover-border);
  color: var(--btn-negative-hover-color);
}

.disconnect-vote-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.disconnect-vote-btn.voted {
  opacity: 1;
}
/* ── Card Drawn Dialogs ── */

/* Card Drawn — realistic card look */
.card-drawn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  perspective: 1000px;
  user-select: none;
}

.card-drawn-inner {
  width: 468px;
  max-width: 90vw;
  transform-style: preserve-3d;
  animation: card-flip 0.8s ease-out forwards;
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.6),
    0 2px 8px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

@keyframes card-flip {
  0% { transform: rotateX(90deg) scale(0.8); opacity: 0; }
  40% { transform: rotateX(-8deg) scale(1.02); opacity: 1; }
  70% { transform: rotateX(3deg) scale(1); }
  100% { transform: rotateX(0deg) scale(1); }
}

.card-drawn-border {
  border: 3px solid;
  border-radius: 14px;
  overflow: hidden;
  backface-visibility: hidden;
}

/* Community Chest — blue theme */
.card-drawn[data-card-type="community"] .card-drawn-border {
  border: none;
  background: url('/chest-card-bg.webp') center / cover no-repeat;
  aspect-ratio: 3 / 2;
  display: flex;
  flex-direction: column;
}

.card-drawn[data-card-type="community"] .card-drawn-type {
  background: transparent;
  font-size: 25px;
  margin-top: 20px;
  color: #fff;
  /* 4-way outline + drop shadow so white titles stay legible on the light
   * parchment background. */
  text-shadow:
    -1px -1px 1px rgba(0, 0, 0, 0.75),
     1px -1px 1px rgba(0, 0, 0, 0.75),
    -1px  1px 1px rgba(0, 0, 0, 0.75),
     1px  1px 1px rgba(0, 0, 0, 0.75),
     0 2px 6px rgba(0, 0, 0, 0.85);
}

.card-drawn[data-card-type="community"] .card-drawn-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -40px;
}

.card-drawn[data-card-type="community"] .card-drawn-player {
  background: transparent;
  border-top: none;
  color: #555;
}

/* Chance — orange theme */
.card-drawn[data-card-type="chance"] .card-drawn-border {
  border: none;
  background: url('/chance-card-bg.webp') center / cover no-repeat;
  aspect-ratio: 3 / 2;
  display: flex;
  flex-direction: column;
}

.card-drawn[data-card-type="chance"] .card-drawn-type {
  background: transparent;
  font-size: 25px;
  margin-top: 20px;
  color: #fff;
  /* 4-way outline + drop shadow so white titles stay legible on the light
   * parchment background. */
  text-shadow:
    -1px -1px 1px rgba(0, 0, 0, 0.75),
     1px -1px 1px rgba(0, 0, 0, 0.75),
    -1px  1px 1px rgba(0, 0, 0, 0.75),
     1px  1px 1px rgba(0, 0, 0, 0.75),
     0 2px 6px rgba(0, 0, 0, 0.85);
}

.card-drawn[data-card-type="chance"] .card-drawn-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -40px;
}

.card-drawn[data-card-type="chance"] .card-drawn-text {
  font-size: 21px;
  line-height: 1.5;
}

.card-drawn[data-card-type="chance"] .card-drawn-player {
  background: transparent;
  border-top: none;
  color: #555;
}

.card-drawn-type {
  padding: 14px 20px;
  text-align: center;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  text-transform: uppercase;
}

.card-drawn-body {
  padding: 28px 24px 32px;
  text-align: center;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}


.card-drawn-text {
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 21px;
  line-height: 1.5;
  color: #1a1a1a;
  margin: 0;
  font-style: italic;
}

.card-drawn[data-card-type="community"] .card-drawn-text {
  font-size: 21px;
  line-height: 1.5;
}

.card-drawn-player {
  padding: 8px 20px;
  text-align: center;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 13px;
  color: #666;
  background: rgba(245, 240, 224, 0.95);
  letter-spacing: 0.5px;
  margin: 0 12px 12px;
  border-radius: 4px;
}
/* ── Auction Dialog ── */

.auction-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  width: 380px;
  max-width: 90vw;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: none;
  border-radius: 4px;
  box-shadow: var(--panel-shadow);
  text-shadow: var(--ui-text-shadow);
  overflow: hidden;
}

.auction-header {
  text-align: center;
  padding: 0;
}

.auction-property-color {
  height: 10px;
  width: 100%;
  border-radius: 4px 4px 0 0;
}

.auction-header h3 {
  margin: 12px 16px 2px;
  color: #f0e8d8;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.auction-property-price {
  font-size: 13px;
  color: #a09880;
  margin-bottom: 10px;
}

.auction-body {
  padding: 0 18px 16px;
}

/* Bidder list */
.auction-bidders {
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
}

.auction-bidder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.2s;
}

.auction-bidder-row:last-child {
  border-bottom: none;
}

.auction-bidder-highest {
  background: rgba(212, 165, 38, 0.15);
  box-shadow: inset 3px 0 0 #d4a526;
}

.auction-bidder-passed {
  opacity: 0.4;
}

.auction-bidder-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #e8e0d0;
}

.auction-bidder-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.auction-bidder-status {
  font-size: 13px;
  color: #888;
}

.auction-bidder-status.highest {
  color: #e8c44a;
  font-weight: 700;
  font-size: 15px;
}

.auction-bidder-status.passed {
  color: #aa5555;
  font-style: italic;
  font-size: 12px;
}

/* Current bid display */
.auction-current-bid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-bottom: 8px;
}

.auction-bid-label {
  font-size: 13px;
  color: #a09880;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.auction-bid-amount {
  font-size: 28px;
  font-weight: 900;
  color: #e8c44a;
  text-shadow: 0 0 12px rgba(232, 196, 74, 0.3);
}

/* Timer */
.auction-timer-bar-wrap {
  width: 100%;
  height: 6px;
  background: #2a2a24;
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0 4px;
}

.auction-timer-bar {
  height: 100%;
  background: #d4a526;
  border-radius: 3px;
  transition: width 0.3s linear;
}

.auction-timer-text {
  font-size: 12px;
  color: #777;
  text-align: center;
  margin-bottom: 10px;
}

/* Bid controls */
.auction-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auction-quick-row {
  display: flex;
  gap: 6px;
}

.auction-quick-row .btn-action {
  flex: 1;
  margin: 0;
}

.btn-bid-quick {
  background: var(--btn-positive-bg) !important;
  border-color: var(--btn-positive-border) !important;
  color: var(--btn-positive-color);
  font-weight: 700;
}

.btn-bid-quick:hover:not(:disabled) {
  background: var(--btn-positive-hover-bg) !important;
  border-color: var(--btn-positive-hover-border) !important;
  color: var(--btn-positive-hover-color);
}

.btn-pass {
  background: var(--btn-negative-bg) !important;
  border-color: var(--btn-negative-border) !important;
  color: var(--btn-negative-color);
}

.btn-pass:hover:not(:disabled) {
  background: var(--btn-negative-hover-bg) !important;
  border-color: var(--btn-negative-hover-border) !important;
  color: var(--btn-negative-hover-color);
}
/* ── Jail Dialog ── */

.jail-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  width: 360px;
  max-width: 90vw;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: none;
  border-radius: 4px;
  box-shadow: var(--panel-shadow);
  text-shadow: var(--ui-text-shadow);
  overflow: hidden;
  user-select: none;
}

.jail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gold-border-medium);
}

.jail-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.jail-header h3 {
  margin: 0;
  color: #e85454;
  font-size: 18px;
  font-weight: 600;
}

.jail-turns {
  margin: 0;
  font-size: 13px;
  color: #a09880;
  flex: 1;
  text-align: right;
}

.jail-body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.jail-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  border-radius: 4px;
  border: 1px solid;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s ease;
  text-align: left;
}

.jail-btn-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}

.jail-btn-label {
  flex: 1;
  color: #f0e8d8;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.jail-btn-roll {
  background: linear-gradient(180deg, rgba(50, 48, 40, 0.95) 0%, rgba(28, 26, 22, 0.97) 100%);
  border-color: #5a5040;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.jail-btn-roll:hover {
  background: linear-gradient(180deg, #c9981e 0%, #a07516 100%);
  border-color: #d4a526;
  box-shadow: 0 2px 12px rgba(212, 165, 38, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.jail-btn-pay {
  background: linear-gradient(180deg, #1a6b3c 0%, #145530 100%);
  border-color: #228833;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.jail-btn-pay:hover:not(:disabled) {
  background: linear-gradient(180deg, #228833 0%, #1a6b3c 100%);
  border-color: #33aa44;
  box-shadow: 0 2px 12px rgba(34, 136, 51, 0.35);
  transform: translateY(-1px);
}

.jail-btn-pay:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.jail-btn-card {
  background: linear-gradient(180deg, #2b5a8c 0%, #1e4570 100%);
  border-color: #3a7abf;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.jail-btn-card:hover {
  background: linear-gradient(180deg, #3a7abf 0%, #2b5a8c 100%);
  border-color: #4a90d9;
  box-shadow: 0 2px 12px rgba(58, 122, 191, 0.35);
  transform: translateY(-1px);
}
/* ── Trade Dialog ── */

.trade-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  width: 560px;
  max-width: 95vw;
  max-height: 92vh;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: none;
  border-radius: 4px;
  box-shadow: var(--panel-shadow);
  text-shadow: var(--ui-text-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.trade-header-icon {
  font-size: 22px;
}
.trade-dialog-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gold-border-medium);
}

.trade-dialog-header h3 {
  margin: 0;
  color: var(--gold-text);
  font-size: 18px;
  font-weight: 600;
}

.trade-target-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.trade-target-label {
  color: #999;
  font-size: 14px;
}

.trade-target-select {
  display: none;
}
.trade-target-dropdown {
  position: relative;
  flex: 1;
}
.trade-target-selected {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(42, 40, 34, 0.9);
  border: 1px solid #5a5040;
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.trade-target-selected:hover {
  border-color: #8a7a5a;
}
.trade-target-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.trade-target-name {
  color: #e8e0d0;
  font-size: 14px;
  font-weight: 500;
  flex: 1;
}
.trade-target-arrow {
  color: #8a7a5a;
  font-size: 12px;
  flex-shrink: 0;
}
.trade-target-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: rgba(32, 30, 24, 0.98);
  border: 1px solid #5a5040;
  border-radius: 8px;
  overflow: hidden;
  z-index: 60;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}
.trade-target-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background 0.12s;
}
.trade-target-option:hover {
  background: rgba(212, 165, 38, 0.15);
}
.trade-target-option + .trade-target-option {
  border-top: 1px solid rgba(90, 80, 64, 0.2);
}
.trade-target-opt-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.trade-target-opt-name {
  color: #e8e0d0;
  font-size: 14px;
  font-weight: 500;
  flex: 1;
}
.trade-target-opt-info {
  color: #8a7a5a;
  font-size: 11px;
  flex-shrink: 0;
}

.trade-layout {
  display: flex;
  gap: 12px;
  padding: 14px;
  overflow-y: auto;
  max-height: 75vh;
}

.trade-side {
  flex: 1;
  background: var(--gold-bg);
  border: none;
  border-radius: 4px;
  padding: 12px;
  max-height: 75vh;
  overflow-y: auto;
  /* Subtle glass bevel inside the gold-tinted sub-panel. */
  box-shadow:
    inset 0 1px 0 rgba(255, 225, 160, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.trade-player-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.trade-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #5a5040;
  flex-shrink: 0;
  padding: 0 2px;
}
.trade-row-icon {
  font-size: 14px;
  flex-shrink: 0;
}
.trade-side-title {
  margin: 0 0 10px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-text);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
}

.trade-side input[type="number"] {
  margin-bottom: 8px;
}

.trade-side label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.trade-side label input {
  margin: 0;
}

.trade-footer {
  display: flex;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid #5a5040;
  justify-content: center;
}

.btn-trade-send,
.btn-trade-cancel {
  min-width: 150px;
  text-align: center;
}

.btn-trade-send {
  background: var(--btn-primary-bg);
  border: none;
  border-radius: 4px;
  color: var(--btn-primary-color);
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  /* Warm-amber top highlight + outer drop shadow — matches the brass theme. */
  box-shadow:
    inset 0 2px 3px -1px rgba(255, 225, 160, 0.35),
    0 2px 5px rgba(0, 0, 0, 0.4);
}

.btn-trade-send:hover {
  background: var(--btn-primary-hover-bg);
  color: var(--btn-primary-hover-color);
  transform: translateY(-1px);
  box-shadow:
    inset 0 2px 3px -1px rgba(255, 225, 160, 0.45),
    0 3px 6px rgba(0, 0, 0, 0.45);
}

.btn-trade-cancel {
  background: var(--btn-negative-bg);
  border: none;
  border-radius: 4px;
  color: var(--btn-negative-color);
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  /* Red-tinted top highlight instead of neutral white (white on red reads pink). */
  box-shadow:
    inset 0 2px 3px -1px rgba(255, 200, 200, 0.35),
    0 2px 5px rgba(0, 0, 0, 0.4);
}

.btn-trade-cancel:hover {
  background: var(--btn-negative-hover-bg);
  color: var(--btn-negative-hover-color);
  transform: translateY(-1px);
  box-shadow:
    inset 0 2px 3px -1px rgba(255, 210, 210, 0.42),
    0 3px 6px rgba(0, 0, 0, 0.45);
}

/* Property mini cards (trade items) */
.prop-mini-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 10px 3px 12px;
  margin: 0;
  border: none;
  border-left: 3px solid var(--row-color, #666);
  border-radius: 0;
  cursor: pointer;
  background: transparent;
  transition: background 0.15s;
  min-width: 0;
}

.prop-mini-card + .prop-mini-card {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.prop-mini-card:hover {
  background: rgba(255, 255, 255, 0.05);
}

.prop-mini-selectable {
  cursor: pointer;
}

.prop-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.prop-toggle-slider {
  position: relative;
  width: 30px;
  height: 16px;
  background: #3a3530;
  border-radius: 8px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.prop-toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: #888;
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}

.prop-toggle-input:checked + .prop-toggle-slider {
  background: #b8891d;
}

.prop-toggle-input:checked + .prop-toggle-slider::after {
  transform: translateX(14px);
  background: #fff;
}

.prop-mini-name {
  flex: 1;
  font-size: 15px;
  color: #e8e0d0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prop-mini-mortgaged {
  color: #cc4444;
  font-size: 10px;
  font-weight: bold;
  margin-left: 4px;
}
.prop-mini-price {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
  margin-right: 2px;
}

/* Trade property cluster tiles — each color group framed as one card with a
 * full-color header bar that doubles as a toggle-all control. Matches the
 * mortgage/build dialog's .prop-group color treatment: whole card tinted
 * with the group color, header bar slightly darker/brighter. */
.trade-prop-cluster {
  --cluster-color: #666;
  margin-bottom: 4px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--cluster-color) 66%, transparent);
  background: color-mix(in srgb, var(--cluster-color) 66%, transparent);
  transition: box-shadow 0.2s;
}

.trade-prop-cluster-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 22px;
  padding: 3px 10px;
  background: var(--cluster-color);
  border: none;
  color: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  transition: filter 0.15s;
}

.trade-prop-cluster-header:hover {
  filter: brightness(1.1);
}

.trade-prop-cluster-count {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
}

.trade-prop-set-badge {
  font-size: 12px;
  color: #fff;
  line-height: 1;
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

.trade-prop-cluster-flag {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff;
}

.trade-prop-cluster-body {
  padding: 2px 0;
}

/* Inside a cluster the group color is applied to the whole cluster body
 * already, so skip the per-row left strip. */
.trade-prop-cluster-body .prop-mini-card {
  border-left: none;
  padding-left: 15px;
}

.trade-prop-cluster-body .prop-mini-card + .prop-mini-card {
  border-top-color: rgba(0, 0, 0, 0.12);
}

.trade-prop-cluster-body .prop-mini-card:hover {
  background: rgba(255, 255, 255, 0.12);
}

.trade-prop-cluster-body .prop-mini-name {
  color: #fff;
}

.trade-prop-cluster-body .prop-mini-price {
  color: rgba(255, 255, 255, 0.85);
}

/* Trade completes the player's set — warm amber glow around the cluster */
.trade-prop-cluster.cluster-gain {
  box-shadow:
    0 0 0 1px rgba(212, 165, 38, 0.55),
    0 0 12px rgba(212, 165, 38, 0.35);
}
.trade-prop-cluster.cluster-gain .trade-prop-cluster-flag {
  color: #fff4c8;
  text-shadow: 0 0 6px rgba(245, 215, 124, 0.8), 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Trade breaks the player's existing monopoly — red glow */
.trade-prop-cluster.cluster-break {
  box-shadow:
    0 0 0 1px rgba(196, 90, 90, 0.6),
    0 0 12px rgba(196, 90, 90, 0.35);
}
.trade-prop-cluster.cluster-break .trade-prop-cluster-flag {
  color: #ffe0e0;
  text-shadow: 0 0 6px rgba(255, 176, 176, 0.7), 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Combined bidirectional money stepper — single control under the header.
 * Negative = you give, positive = you receive. Direction highlighted via
 * labels on either side of the stepper. */
.trade-money-combined {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px 4px;
  flex-wrap: wrap;
}

.trade-money-combined input[type="number"] {
  width: 72px;
  text-align: center;
  margin: 0;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 600;
  background: rgba(30, 26, 18, 0.85);
  border: none;
  color: #f0e8d8;
  border-radius: 4px;
  padding: 6px 4px;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.5),
    inset 0 -1px 0 rgba(255, 225, 160, 0.08);
  -moz-appearance: textfield;
  appearance: textfield;
}
.trade-money-combined input[type="number"]::-webkit-inner-spin-button,
.trade-money-combined input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.trade-money-label {
  flex: 1;
  min-width: 80px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #8a7e68;
  padding: 0 4px;
  transition: color 0.15s, text-shadow 0.15s;
}

.trade-money-label.trade-money-receive {
  text-align: right;
}
.trade-money-label.trade-money-give {
  text-align: left;
}

.trade-money-combined.trade-money-giving .trade-money-give {
  color: #ffb0b0;
  text-shadow: 0 0 6px rgba(255, 140, 140, 0.5);
}
.trade-money-combined.trade-money-receiving .trade-money-receive {
  color: #b0ffb0;
  text-shadow: 0 0 6px rgba(120, 255, 140, 0.5);
}
.trade-money-combined.trade-money-giving input[type="number"] {
  color: #ffc8c8;
}
.trade-money-combined.trade-money-receiving input[type="number"] {
  color: #c8ffc8;
}

/* Step buttons share the HUD .btn-action design language: silver gradient
 * body, warm-brass inset top highlight, outer drop shadow, brass hover. */
.trade-step-btn {
  background: linear-gradient(180deg, rgba(78, 80, 84, 0.9) 0%, rgba(52, 54, 58, 0.92) 100%);
  border: none;
  border-radius: 4px;
  color: #f0e8d8;
  padding: 5px 9px;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  white-space: nowrap;
  text-shadow: -1px 1px 2px rgba(0, 0, 0, 0.5);
  box-shadow:
    inset 0 2px 3px -1px rgba(255, 225, 160, 0.25),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 2px 4px rgba(0, 0, 0, 0.35);
  transition: all 0.15s ease;
}

.trade-step-btn:hover {
  background: linear-gradient(180deg, rgb(110, 85, 35) 0%, rgb(75, 58, 24) 100%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow:
    inset 0 2px 3px -1px rgba(255, 225, 160, 0.38),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 3px 6px rgba(0, 0, 0, 0.4);
}

.trade-step-btn:active {
  transform: translateY(0);
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, 0.5),
    0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Trade GOOJF toggle */
.trade-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #d4cbb8;
  cursor: pointer;
  margin-top: 8px;
}

.trade-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.trade-toggle-slider {
  position: relative;
  width: 34px;
  height: 18px;
  background: #3a3530;
  border-radius: 9px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.trade-toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: #888;
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}

.trade-toggle input:checked + .trade-toggle-slider {
  background: #b8891d;
}

.trade-toggle input:checked + .trade-toggle-slider::after {
  transform: translateX(16px);
  background: #fff;
}

.trade-toggle input:disabled + .trade-toggle-slider {
  background: #333;
  opacity: 0.4;
  cursor: not-allowed;
}

.trade-toggle:has(input:disabled) {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Incoming Trade Dialog */
.trade-incoming-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 55;
  width: 480px;
  max-height: 80vh;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--gold-border);
  border-radius: 4px;
  box-shadow: var(--panel-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.trade-incoming-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gold-border-medium);
}
.trade-incoming-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.trade-incoming-header h3 {
  margin: 0;
  color: var(--gold-text);
  font-size: 18px;
  font-weight: 600;
}
.trade-incoming-from {
  margin: 0;
  color: #9a9080;
  font-size: 14px;
  flex: 1;
}
.trade-from-highlight {
  color: #e8d5a0;
  font-size: 18px;
  font-weight: 600;
  margin-left: 8px;
}
.trade-incoming-details {
  padding: 14px 16px;
  overflow-y: auto;
  max-height: 50vh;
}
.ti-layout {
  display: flex;
  gap: 8px;
}
.ti-side {
  flex: 1;
  background: var(--gold-bg);
  border: 1px solid var(--gold-border-light);
  border-radius: 4px;
  padding: 10px;
  min-width: 0;
}

/* Read-only cluster: header is not a button, so drop the cursor + hover */
.trade-prop-cluster-readonly .trade-prop-cluster-header {
  cursor: default;
}
.trade-prop-cluster-readonly .trade-prop-cluster-header:hover {
  filter: none;
}
.ti-side-title {
  font-size: 13px;
  font-weight: 600;
  color: #d4a526;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}
.ti-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  margin: 3px 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(90, 80, 64, 0.2);
  border-radius: 4px;
  font-size: 13px;
  color: #e8e0d0;
}
.ti-icon {
  font-size: 14px;
  flex-shrink: 0;
}
.ti-empty {
  color: #6a6050;
  font-style: italic;
  font-size: 13px;
  padding: 8px;
  text-align: center;
}
.trade-incoming-footer {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--gold-border-medium);
  justify-content: center;
}
.trade-incoming-btn {
  flex: 1;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  /* Shared outer drop shadow; per-color top highlight set in the variant rules. */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}
.trade-incoming-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.45);
}
.trade-btn-accept {
  background: var(--btn-positive-bg);
  color: var(--btn-positive-color);
  box-shadow:
    inset 0 2px 3px -1px rgba(255, 255, 255, 0.14),
    0 2px 5px rgba(0, 0, 0, 0.4);
}
.trade-btn-accept:hover {
  background: var(--btn-positive-hover-bg);
  color: var(--btn-positive-hover-color);
  transform: translateY(-1px);
  box-shadow:
    inset 0 2px 3px -1px rgba(255, 255, 255, 0.22),
    0 3px 6px rgba(0, 0, 0, 0.45);
}
.trade-btn-counter {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-color);
  box-shadow:
    inset 0 2px 3px -1px rgba(255, 225, 160, 0.35),
    0 2px 5px rgba(0, 0, 0, 0.4);
}
.trade-btn-counter:hover {
  background: var(--btn-primary-hover-bg);
  color: var(--btn-primary-hover-color);
  transform: translateY(-1px);
  box-shadow:
    inset 0 2px 3px -1px rgba(255, 225, 160, 0.45),
    0 3px 6px rgba(0, 0, 0, 0.45);
}
.trade-btn-reject {
  background: var(--btn-negative-bg);
  color: var(--btn-negative-color);
  box-shadow:
    inset 0 2px 3px -1px rgba(255, 200, 200, 0.35),
    0 2px 5px rgba(0, 0, 0, 0.4);
}
.trade-btn-reject:hover {
  background: var(--btn-negative-hover-bg);
  color: var(--btn-negative-hover-color);
  transform: translateY(-1px);
  box-shadow:
    inset 0 2px 3px -1px rgba(255, 210, 210, 0.42),
    0 3px 6px rgba(0, 0, 0, 0.45);
}
/* ── Property Card (Title Deed) ── */

#property-card {
  /* Anchored top-right, just below the player-info-strip and game-log
   * (game-log collapsed sits at top:8 with max-height 80px, so 100px clears
   * both). left:auto cancels .dialog's left:50% so the card right-aligns. */
  left: auto;
  right: 24px;
  top: 100px;
  /* Fixed slight clockwise tilt — the top of the card leans toward the
   * right, like a deed pinned to a board askew. Same value used in every
   * keyframe of the flip-in animation so it stays put. */
  --card-tilt: 0.9deg;
  transform: rotate(var(--card-tilt, 0deg));
  /* Same flip-in feel as the card-drawn dialog (see dialog-cards.css
   * .card-drawn-inner). Inline `perspective(1000px)` per keyframe sets the
   * 3D context locally — no wrapper element needed. The tilt rotation is
   * baked into every keyframe so it doesn't drop mid-flight. */
  animation: title-deed-flip 0.55s ease-out;
}

@keyframes title-deed-flip {
  0%   { transform: rotate(var(--card-tilt, 0deg)) perspective(1000px) rotateX(90deg) scale(0.85); opacity: 0; }
  45%  { transform: rotate(var(--card-tilt, 0deg)) perspective(1000px) rotateX(-6deg) scale(1.02); opacity: 1; }
  75%  { transform: rotate(var(--card-tilt, 0deg)) perspective(1000px) rotateX(2deg) scale(1); }
  100% { transform: rotate(var(--card-tilt, 0deg)) perspective(1000px) rotateX(0deg) scale(1); }
}

.property-card {
  /* Scale with viewport — gentler slope than before, starts shrinking
   * earlier on large screens so 1440p+ users aren't sitting at the max
   * cap. Override .dialog's min-width:300 so the lower clamp can take
   * effect. */
  width: clamp(260px, 25vmin, 380px);
  min-width: 0;
  /* font-size tracks the same vmin axis (4.5% of card width). Bounds match
   * the 260/380 width edges so internal em-based sizes grow/shrink in
   * lockstep with the card. */
  font-size: clamp(11.7px, 1.125vmin, 17.1px);
  padding: 0;
  border: none;
  border-radius: 0;
  /* .dialog already sets position: absolute — that's the positioning context
   * the ::after overlay anchors to. Don't override it here or the card
   * collapses into static flow. */
  /* Override .dialog's gold-glass plate + blur — the title deed should float
   * with only the parchment image visible, no rectangular backdrop behind.
   * The source image has transparent corners outside its rounded parchment,
   * so the dialog's element corners are see-through. drop-shadow follows
   * that alpha shape (box-shadow would trace the element's rectangle). */
  background: url('/title-deeds/td-grey.webp') no-repeat center / 100% 100%;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.6));
  color: #222;
  user-select: none;
  /* Cancel .dialog's inherited dark text-shadow — it smears under dark text on
   * light parchment. The band title re-enables it explicitly below. */
  text-shadow: none;
  display: flex;
  flex-direction: column;
  /* Lock to the trimmed source image's 341:547 aspect so the medallion never clips. */
  aspect-ratio: 341 / 547;
}

/* Mortgaged state: VOID rubber-stamp overlay reusing the same /void-stamp.webp
 * the board tiles use. Positioned over the parchment center, slightly tilted
 * and slightly translucent so the deed details remain readable underneath.
 * pointer-events:none so the close button and dblclick still work through it. */
.property-card.mortgaged::before {
  content: '';
  position: absolute;
  /* Larger footprint than before so the stamp reads as a real rubber stamp
   * rather than a small badge. --void-x/y/rot are set by JS on a fresh open
   * for a slightly different placement each time (kept stable across same-
   * property refreshes). */
  left: 4%;
  right: 4%;
  top: 20%;
  bottom: 16%;
  background: url('/void-stamp.webp') no-repeat center / contain;
  opacity: 0.8;
  transform: translate(var(--void-x, 0), var(--void-y, 0)) rotate(var(--void-rot, -10deg));
  pointer-events: none;
  z-index: 5;
}

/* "Slightly used" texture overlay: paper-fiber grain via SVG turbulence noise
 * + a subtle vignette darkening the edges + a warm yellow-brown wash that
 * matches the board's tone (cream parchment alone reads too cool). Mask-image
 * clips all three effects to the parchment alpha shape (set per-card by JS
 * via --td-mask) so transparent corners stay transparent. */
.property-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/></svg>"),
    radial-gradient(ellipse at center, transparent 55%, rgba(60, 35, 5, 0.28) 100%),
    linear-gradient(rgba(190, 140, 55, 0.20), rgba(190, 140, 55, 0.20));
  background-size: 220px 220px, 100% 100%, 100% 100%;
  background-repeat: repeat, no-repeat, no-repeat;
  mix-blend-mode: multiply;
  opacity: 0.7;
  -webkit-mask-image: var(--td-mask);
  mask-image: var(--td-mask);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.property-card-band {
  /* % of card height — aspect-ratio is locked so this stays a consistent
   * visual proportion regardless of card scale. Source band runs 3.2%-15.8%,
   * visual center at ~9.5%; height: 19% with align-items: center lands the
   * flex-centered text at exactly that spot. */
  height: 19%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.4em;
  flex-shrink: 0;
}

.property-card-band h3 {
  margin: 0;
  color: #fff;
  font-size: 1.78em;
  letter-spacing: 1px;
  text-align: center;
  text-transform: uppercase;
  font-weight: 700;
  text-shadow: var(--ui-text-shadow);
  line-height: 1.1;
}

.property-card-body {
  /* Signature now anchors the bottom and clears the medallion via its own
   * margin-bottom, so body padding only needs a small breathing gap. */
  padding: 0 2.1em 0.35em;
  flex: 1 1 auto;
}

/* Same visual language as the Action Card hold-to-discard button (see
 * action-cards.css .card-discard-btn), minus the hold ring — closing the
 * title deed is a single click, not a destructive hold action. */
.property-card-close {
  position: absolute;
  top: 0.5em;
  right: 0.5em;
  /* width/height use the button's OWN font-size as the em base, so 2em ×
   * 1.3em-font ≈ 35px on a 300px-wide card. */
  width: 2em;
  height: 2em;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  color: #ccc;
  font-size: 1.3em;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.property-card-close:hover {
  background: rgba(100, 40, 40, 0.85);
  color: var(--btn-negative-color);
}

.property-card-close span {
  pointer-events: none;
}

/* Owner signature at the bottom of the parchment, above the baked-in
 * medallion. Italic name only, left-aligned. Sits as a flex item *after*
 * the body so it anchors at the parchment floor; fixed margin-bottom keeps
 * it the right distance from the medallion regardless of card stretch. */
.property-card-signature {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6em;
  padding: 0 2.1em;
  /* em-based so it scales with the card root. ~2em ≈ 27px @ 300px card,
   * matching the previous fixed 28px. (margin-bottom in % resolves against
   * the parent WIDTH, not height — would have given the wrong distance.) */
  margin-bottom: 2em;
  font-size: 1.12em;
  color: #4a3320;
  /* Single line — wrapping would push the signature into the medallion zone.
   * JS scales the font for long names; ellipsis is a final safeguard. */
  flex-wrap: nowrap;
  overflow: hidden;
}

.pc-sig-name {
  /* Caveat — self-hosted handwritten font (variable weight 400-700).
   * See @font-face in index.html and /fonts/caveat-latin.woff2.
   * Font size set inline by JS based on name length (see property-card.ts). */
  font-family: 'Caveat', 'Cambria', 'Georgia', cursive;
  font-weight: 400;
  line-height: 1.15;
  /* Caveat's cursive letters have tails/flourishes that extend past the
   * glyph box; without a small inline-end pad the parent's overflow:hidden
   * can shave off the last letter's curl. */
  padding-inline-end: 0.18em;
  /* Parchment-cream halo (4 directional offsets + a soft glow) erases the
   * globe lines underneath the text, keeping it readable when the signature
   * overruns into the medallion area. Final dark layer adds depth. */
  text-shadow:
    -1px -1px 0 #f5ecd6, 1px -1px 0 #f5ecd6,
    -1px 1px 0 #f5ecd6, 1px 1px 0 #f5ecd6,
    0 0 4px rgba(245, 236, 214, 0.95),
    0 0 8px rgba(245, 236, 214, 0.7),
    0 1px 2px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Wipe-in "being drawn" animation — fires only when the owner CHANGES
 * while the dialog is open (purchase / trade). Subsequent same-owner
 * renders skip the class so refreshes don't re-animate. See
 * seenOwnerByProperty in property-card.ts. */
.pc-sig-name.pc-sig-fresh {
  animation: pc-sig-draw 1.1s cubic-bezier(0.42, 0, 0.2, 1) both;
}

@keyframes pc-sig-draw {
  0%   { clip-path: inset(0 100% 0 0); opacity: 0; }
  15%  { opacity: 1; }
  100% { clip-path: inset(0 0 0 0); opacity: 1; }
}



#property-card-details {
  font-size: 1.04em;
}

.pc-price {
  text-align: center;
  font-size: 1.4em;
  font-weight: 700;
  color: #1a6b1a;
  padding: 0.4em 0;
  border-top: 1px dashed #bbb;
  border-bottom: 1px dashed #bbb;
}

/* Active card-effects shown as a row of compact pills above the rent table.
 * Bronze/silver/gold colors match action-cards.css .tier-bronze etc. so the
 * visual identity is consistent with the action-card UI. Modifier-only text
 * (no name) keeps three pills on one row; full name is in the title attr. */
.pc-effects-inline {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3em;
  padding: 0.35em 0;
}

.pc-effects-inline > span {
  display: inline-block;
  font-size: 0.9em;
  font-weight: 700;
  padding: 0.15em 0.65em;
  border-radius: 999px;
  border: none;
  line-height: 1.3;
  white-space: nowrap;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 2px rgba(0, 0, 0, 0.25);
}

.pc-effect-tier-bronze {
  background: linear-gradient(180deg, #d8a778, #b07a40);
  color: #3a1a05;
}
.pc-effect-tier-silver {
  background: linear-gradient(180deg, #d8d8d8, #9ea0a8);
  color: #1a1a25;
}
.pc-effect-tier-gold {
  background: linear-gradient(180deg, #ffe26b, #d4a526);
  color: #3a2806;
}

.pc-rent-section {
  padding: 0.25em 0 0.1em;
}

#property-card-details .rent-line {
  display: flex;
  justify-content: space-between;
  padding: 0.25em 0.3em;
  border-bottom: 1px dotted #d5d0c0;
  font-size: 0.98em;
  color: #444;
}

#property-card-details .rent-line:last-child {
  border-bottom: none;
}

#property-card-details .rent-line.active {
  font-weight: bold;
  color: #000;
  background: rgba(0, 100, 0, 0.08);
  border-radius: 4px;
  border-bottom-color: transparent;
}

#property-card-details .rent-line.harbour-boost {
  font-weight: bold;
  color: #000;
  background: rgba(0, 100, 0, 0.25);
  border-radius: 4px;
  border-bottom-color: transparent;
}

.pc-rent-icon {
  font-size: 0.9em;
}

.pc-build-cost {
  display: flex;
  justify-content: space-between;
  padding: 0.35em 0.3em;
  font-size: 0.98em;
  color: #555;
  border-top: 1px dashed #bbb;
}

.pc-mortgage {
  display: flex;
  justify-content: space-between;
  padding: 0.35em 0.3em;
  font-size: 0.98em;
  color: #555;
  border-top: 1px dashed #bbb;
}

.pc-income-gold {
  background: rgba(212, 165, 38, 0.35);
  color: #5a4008;
  font-weight: 700;
}

.pc-income-silver {
  background: rgba(170, 170, 185, 0.3);
  color: #333;
  font-weight: 600;
}

.pc-income-bronze {
  background: rgba(180, 110, 50, 0.28);
  color: #5a3518;
  font-weight: 600;
}

/* ── Shared Property Row & Group Card ── */

.prop-row {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 8px;
  transition: background 0.15s;
  overflow: hidden;
}
.prop-row:hover { background: rgba(201, 168, 76, 0.1); }

.prop-row-strip {
  width: 6px;
  align-self: stretch;
  flex-shrink: 0;
}

.prop-row-name {
  flex: 1;
  min-width: 0;
  padding: 2px 6px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: #e8e0d0;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prop-row-buildings {
  padding: 0 6px;
  font-size: 12px;
  letter-spacing: -1px;
  flex-shrink: 0;
}
.prop-row-building { font-size: 12px; }
.prop-row-hotel { font-size: 13px; }

.prop-row-value {
  padding: 0 10px 0 4px;
  color: rgba(201, 168, 76, 0.8);
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
}

.prop-row-mortgaged {
  background: rgba(0, 0, 0, 0.2);
}
.prop-row-mortgaged .prop-row-name {
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.8);
  text-decoration-thickness: 2px;
  opacity: 0.45;
}
.prop-row-mortgaged .prop-row-value,
.prop-row-mortgaged .prop-row-buildings {
  opacity: 0.45;
}

.prop-group {
  border: none;
  border-radius: 4px;
  overflow: hidden;
}
.prop-group-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 6px;
  border-radius: 4px 4px 0 0;
}
.prop-group-label {
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
}
.prop-group-disabled {
  opacity: 0.45;
  pointer-events: none;
}
.prop-group-dimmed {
  opacity: 0.6;
}

/* ── Mortgage & Build Dialogs ── */

/* Mortgage Dialog */
.mortgage-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  width: 740px;
  max-width: 90vw;
  max-height: 85vh;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: none;
  border-radius: 4px;
  box-shadow: var(--panel-shadow);
  text-shadow: var(--ui-text-shadow);
  display: flex;
  flex-direction: column;
}

.mortgage-header-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.mortgage-header-text {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}
.mortgage-cash {
  font-size: 13px;
  color: #9a9080;
  font-weight: 500;
}
.mortgage-cash-negative {
  color: #ff4444;
}
.mortgage-dialog-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gold-border-medium);
}

.mortgage-dialog-header h3 {
  margin: 0;
  color: var(--gold-text);
  font-size: 18px;
  font-weight: 600;
}

.mortgage-close-x {
  background: none;
  border: none;
  color: #5a4a2a;
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}

.mortgage-close-x:hover {
  color: var(--gold-text);
}

.mortgage-list {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-content: flex-start;
}

.mortgage-row {
  gap: 6px;
  padding: 5px 6px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.1);
  flex-wrap: wrap;
}
.mortgage-row .prop-row-name { font-size: 13px; padding: 1px 4px; }
.mortgage-row .prop-row-value { font-size: 11px; padding: 0 6px 0 3px; }

.mortgage-row:last-child {
  border-bottom: none;
}

.mortgage-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.mortgage-row.mortgaged {
  opacity: 0.45;
  background: rgba(0, 0, 0, 0.2);
}
.mortgage-row.mortgaged .mortgage-prop-name {
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.3);
}

.mortgage-color-bar {
  display: none;
}

.mortgage-prop-name {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  color: #e8e0d0;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mortgage-prop-value {
  font-size: 13px;
  color: #8a7a5a;
  flex-shrink: 0;
  margin-right: 4px;
  min-width: 45px;
  text-align: right;
}
.mortgage-status {
  font-size: 11px;
  color: #e55;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mortgage-group {
  border: none;
  border-radius: 4px;
  overflow: hidden;
}
.mortgage-group .prop-group-bar { min-height: 4px; }
.mortgage-group .prop-group-label { padding: 1px 6px; font-size: 9px; }

.mortgage-group-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  min-height: 8px;
  border-radius: 4px 4px 0 0;
}

.mortgage-group-name {
  font-size: 12px;
  font-weight: 600;
  color: #d4cbb8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mortgage-group-disabled {
  opacity: 0.45;
  pointer-events: none;
}
.mortgage-group-all-mortgaged {
  opacity: 0.6;
}

.mortgage-group-built {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 8px;
  border-radius: 3px;
}

.mortgage-empty {
  padding: 20px;
  text-align: center;
  color: #888;
  font-style: italic;
}
.mortgage-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-top: 1px solid #5a5040;
  font-size: 12px;
  color: #9a9080;
}
.mortgage-summary:empty {
  display: none;
}
.mortgage-summary-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.mortgage-summary-pos { color: #5ce65c; font-weight: 600; }
.mortgage-summary-neg { color: #ff6666; font-weight: 600; }
.mortgage-summary-sep { color: #5a5040; }
.btn-mortgage:disabled,
.btn-unmortgage:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.btn-mortgage, .btn-unmortgage {
  flex-shrink: 0;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  text-align: center;
  box-sizing: border-box;
  transition: all 0.15s ease;
  min-width: 80px;
  /* No inset bottom line — it stacks with the outer drop shadow and reads
   * as a double border. Just top highlight + outer drop shadow for clean lift. */
  box-shadow:
    inset 0 2px 3px -1px rgba(255, 255, 255, 0.14),
    0 2px 5px rgba(0, 0, 0, 0.4);
}

.btn-mortgage {
  background: var(--btn-negative-bg);
  border-color: var(--btn-negative-border);
  color: var(--btn-negative-color);
  /* Warm-red top highlight instead of neutral white — pure white on red
   * reads as washed-out pink and makes the button look pressed rather than
   * raised. The tinted rim harmonizes with the red body. */
  box-shadow:
    inset 0 2px 3px -1px rgba(255, 200, 200, 0.35),
    0 2px 5px rgba(0, 0, 0, 0.4);
}

.btn-mortgage:hover {
  background: var(--btn-negative-hover-bg);
  border-color: var(--btn-negative-hover-border);
  color: var(--btn-negative-hover-color);
  transform: translateY(-1px);
  box-shadow:
    inset 0 2px 3px -1px rgba(255, 210, 210, 0.42),
    0 3px 6px rgba(0, 0, 0, 0.45);
}

.btn-unmortgage {
  background: var(--btn-positive-bg);
  border-color: var(--btn-positive-border);
  color: var(--btn-positive-color);
}

/* Unmortgage button sits on a mortgaged row (which dims siblings to 0.45)
 * — force it to full opacity and brighter text so the action call reads
 * clearly against the otherwise-grayed row. Uses !important to defeat any
 * stacking specificity from the generic :disabled or other overrides. */
.prop-row-mortgaged .btn-unmortgage,
.prop-row-mortgaged .btn-unmortgage:disabled {
  color: #fff !important;
  opacity: 1 !important;
}

.btn-unmortgage:hover {
  background: var(--btn-positive-hover-bg);
  border-color: var(--btn-positive-hover-border);
  color: var(--btn-positive-hover-color);
}

/* Build Dialog */
.build-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  width: 740px;
  max-width: 90vw;
  user-select: none;
  max-height: 85vh;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: none;
  border-radius: 4px;
  box-shadow: var(--panel-shadow);
  text-shadow: var(--ui-text-shadow);
  display: flex;
  flex-direction: column;
}

.build-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gold-border-medium);
}

.build-dialog-header h3 {
  margin: 0;
  color: var(--gold-text);
  font-size: 18px;
  font-weight: 600;
}

.build-close-x {
  background: none;
  border: none;
  color: #5a4a2a;
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}

.build-close-x:hover {
  color: var(--gold-text);
}

.build-list {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-content: flex-start;
}

.build-group {
  border: 1px solid var(--gold-border-light);
  border-radius: 4px;
  overflow: hidden;
}

.build-group-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.build-group-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  min-height: 8px;
  border-radius: 4px 4px 0 0;
}

.build-group-name {
  font-size: 12px;
  font-weight: 600;
  color: #d4cbb8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.build-group-mortgaged {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  color: #e55;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.build-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 6px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.1);
  transition: background 0.15s;
  flex-wrap: wrap;
}
.build-row .prop-row-name { font-size: 13px; padding: 1px 4px; }
.build-row .prop-row-value { font-size: 11px; padding: 0 6px 0 3px; }
.build-group .prop-group-bar { min-height: 4px; }
.build-group .prop-group-label { padding: 1px 6px; font-size: 9px; }

.build-row:last-child {
  border-bottom: none;
}

.build-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.build-prop-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.build-prop-name {
  font-size: 15px;
  color: #e8e0d0;
  font-weight: 500;
}

.build-level {
  display: block;
}

.build-house-icons {
  font-size: 14px;
  letter-spacing: 2px;
}
.build-hotel-icon {
  font-size: 14px;
}
.build-empty-lot {
  font-size: 11px;
  color: #6a6050;
  font-style: italic;
}
.build-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.btn-build-action {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: all 0.2s;
  background: var(--btn-positive-bg);
  color: var(--btn-positive-color);
  min-width: 90px;
  text-align: center;
  box-shadow:
    inset 0 2px 3px -1px rgba(255, 255, 255, 0.14),
    0 2px 5px rgba(0, 0, 0, 0.4);
}

.btn-build-action:hover:not(:disabled) {
  background: var(--btn-positive-hover-bg);
  border-color: var(--btn-positive-hover-border);
  color: var(--btn-positive-hover-color);
  transform: translateY(-1px);
}

.btn-build-action:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.btn-build-action.btn-hotel {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-border);
  color: var(--btn-primary-color);
}

.btn-build-action.btn-hotel:hover:not(:disabled) {
  background: var(--btn-primary-hover-bg);
  border-color: var(--btn-primary-hover-border);
  color: var(--btn-primary-hover-color);
}

.btn-build-sell {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: all 0.15s ease;
  background: var(--btn-negative-bg);
  color: var(--btn-negative-color);
  min-width: 90px;
  text-align: center;
  /* Red-tinted top highlight + outer drop shadow — matches .btn-mortgage. */
  box-shadow:
    inset 0 2px 3px -1px rgba(255, 200, 200, 0.35),
    0 2px 5px rgba(0, 0, 0, 0.4);
}

.btn-build-sell:hover:not(:disabled) {
  background: var(--btn-negative-hover-bg);
  border-color: var(--btn-negative-hover-border);
  color: var(--btn-negative-hover-color);
  transform: translateY(-1px);
  box-shadow:
    inset 0 2px 3px -1px rgba(255, 210, 210, 0.42),
    0 3px 6px rgba(0, 0, 0, 0.45);
}

.btn-build-sell:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.build-empty {
  padding: 20px;
  text-align: center;
  color: #888;
  font-style: italic;
  width: 100%;
}
/* FPS Counter */
.fps-counter {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 20;
  background: rgba(0, 0, 0, 0.6);
  color: #0f0;
  font-family: monospace;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  pointer-events: none;
  user-select: none;
}

/* Toast */
#toast-container {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: linear-gradient(180deg, rgba(30, 26, 18, 0.85) 0%, rgba(18, 15, 10, 0.9) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 4px;
  padding: 14px 32px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-align: center;
  animation: toast-in 0.3s ease, toast-out 0.4s ease 2.6s forwards;
  max-width: 90vw;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-20px); }
}

/* Rent Notification */
.rent-notification {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 300;
  background: linear-gradient(180deg, rgba(30, 26, 18, 0.9) 0%, rgba(18, 15, 10, 0.92) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 4px;
  padding: 16px 28px;
  text-align: center;
  pointer-events: none;
  animation: rent-pop-in 0.5s ease-out;
}

.rent-notification-large {
  border-color: rgba(232, 196, 74, 0.42);
  box-shadow: 0 0 26px rgba(232, 196, 74, 0.14);
}

.rent-notification-huge {
  border-color: rgba(255, 115, 115, 0.38);
  box-shadow: 0 0 34px rgba(190, 40, 40, 0.2), 0 0 24px rgba(232, 196, 74, 0.1);
}

.rent-notification-tax {
  border-color: rgba(214, 88, 88, 0.32);
}

.rent-notification.fade-out {
  animation: rent-fade-out 0.4s ease forwards;
}

/* Postcard layout — country illustration as a stamped postcard with the
 * amount + flow row rendered as a caption underneath. The outer
 * .rent-notification panel becomes invisible (no panel/glow/border)
 * because the postcard is the visual anchor. */
.rent-notification-with-bg {
  background: none;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  /* Same flip-in feel as the title-deed and card-drawn dialogs (see
   * dialog-property.css title-deed-flip / dialog-cards.css card-flip).
   * Inline perspective per keyframe; translate(-50%, -50%) preserved
   * throughout so the centering doesn't drop mid-flip. */
  animation: rent-postcard-flip 0.7s ease-out;
}

@keyframes rent-postcard-flip {
  0%   { transform: translate(-50%, -50%) perspective(1200px) rotateX(90deg) scale(0.85); opacity: 0; }
  40%  { transform: translate(-50%, -50%) perspective(1200px) rotateX(-8deg) scale(1.02); opacity: 1; }
  70%  { transform: translate(-50%, -50%) perspective(1200px) rotateX(3deg) scale(1); }
  100% { transform: translate(-50%, -50%) perspective(1200px) rotateX(0deg) scale(1); }
}

.rent-notif-postcard {
  position: relative;
  width: 620px;
  max-width: 92vw;
  aspect-ratio: 16 / 9;
  /* Cream paper card with torn outer edges (deckle) + edge-only
   * oxidation: a narrow dark-brown band hugs the torn deckle edge and
   * fades into clean cream within ~5px (paper edges oxidize first from
   * touch + air contact). The "ring" is computed in SVG: the torn rect
   * is eroded with feMorphology, blurred for a soft inner gradient,
   * then feComposite operator='out' subtracts the eroded shape from the
   * full torn rect — leaving only the ring along the deckle edge. */
  background-color: #efe5cc;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 620 349' preserveAspectRatio='none'><filter id='r' x='-5%25' y='-5%25' width='110%25' height='110%25'><feTurbulence type='fractalNoise' baseFrequency='0.022' numOctaves='2' seed='3'/><feDisplacementMap in='SourceGraphic' scale='10' result='torn'/><feMorphology in='torn' operator='erode' radius='3' result='shrunk'/><feGaussianBlur in='shrunk' stdDeviation='3.5' result='shrunkBlur'/><feComposite in='torn' in2='shrunkBlur' operator='out'/></filter><rect width='620' height='349' fill='%23704624' fill-opacity='0.6' filter='url(%23r)'/></svg>");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 620 349' preserveAspectRatio='none'><filter id='t' x='-3%25' y='-5%25' width='106%25' height='110%25'><feTurbulence type='fractalNoise' baseFrequency='0.022' numOctaves='2' seed='3'/><feDisplacementMap in='SourceGraphic' scale='10'/></filter><rect width='620' height='349' fill='white' filter='url(%23t)'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 620 349' preserveAspectRatio='none'><filter id='t' x='-3%25' y='-5%25' width='106%25' height='110%25'><feTurbulence type='fractalNoise' baseFrequency='0.022' numOctaves='2' seed='3'/><feDisplacementMap in='SourceGraphic' scale='10'/></filter><rect width='620' height='349' fill='white' filter='url(%23t)'/></svg>");
  -webkit-mask-size: 100% 100%;
          mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.6));
}

/* The country illustration — sits inside the cream rim with its own
 * torn deckle edge (different seed from the outer mask so the two
 * silhouettes don't echo each other). The thin printed rule still
 * traces the rectangular border-box but is mostly hidden by the mask;
 * the residual ink along the photo edge reads as faint darkroom border. */
.rent-notif-postcard::before {
  content: '';
  position: absolute;
  inset: 14px;
  background-image: var(--rent-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 592 321' preserveAspectRatio='none'><filter id='t' x='-3%25' y='-5%25' width='106%25' height='110%25'><feTurbulence type='fractalNoise' baseFrequency='0.028' numOctaves='2' seed='17'/><feDisplacementMap in='SourceGraphic' scale='8'/></filter><rect width='592' height='321' fill='white' filter='url(%23t)'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 592 321' preserveAspectRatio='none'><filter id='t' x='-3%25' y='-5%25' width='106%25' height='110%25'><feTurbulence type='fractalNoise' baseFrequency='0.028' numOctaves='2' seed='17'/><feDisplacementMap in='SourceGraphic' scale='8'/></filter><rect width='592' height='321' fill='white' filter='url(%23t)'/></svg>");
  -webkit-mask-size: 100% 100%;
          mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(80, 50, 12, 0.45);
}

/* Aged-photo texture overlay — paper grain + edge vignette, multiplied
 * over the illustration only. Mirrors the ::before mask so the texture
 * follows the photo's torn silhouette instead of overflowing onto the rim. */
.rent-notif-postcard::after {
  content: '';
  position: absolute;
  inset: 14px;
  pointer-events: none;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/></svg>"),
    linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.9) 100%),
    radial-gradient(ellipse at center, transparent 60%, rgba(40, 25, 8, 0.32) 100%);
  background-size: 220px 220px, 100% 100%, 100% 100%;
  background-repeat: repeat, no-repeat, no-repeat;
  mix-blend-mode: multiply;
  opacity: 0.6;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 592 321' preserveAspectRatio='none'><filter id='t' x='-3%25' y='-5%25' width='106%25' height='110%25'><feTurbulence type='fractalNoise' baseFrequency='0.028' numOctaves='2' seed='17'/><feDisplacementMap in='SourceGraphic' scale='8'/></filter><rect width='592' height='321' fill='white' filter='url(%23t)'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 592 321' preserveAspectRatio='none'><filter id='t' x='-3%25' y='-5%25' width='106%25' height='110%25'><feTurbulence type='fractalNoise' baseFrequency='0.028' numOctaves='2' seed='17'/><feDisplacementMap in='SourceGraphic' scale='8'/></filter><rect width='592' height='321' fill='white' filter='url(%23t)'/></svg>");
  -webkit-mask-size: 100% 100%;
          mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
}

/* Property-name title at the top of the postcard — plain text in the
 * property's color (set inline by JS), no background band. 8-direction
 * dark outline halo + drop shadow so the colored title reads on any
 * illustration tone underneath. */
.rent-notif-postcard-title {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  /* Soft cream glow underneath so the dark sepia type always reads,
   * even over the darkest patches of pencil illustration. The glow is
   * roughly the rim-paper colour so it disappears into the postcard
   * border and only "lifts" the type where it sits over the painting. */
  filter:
    drop-shadow(0 0 4px rgba(239, 229, 204, 0.95))
    drop-shadow(0 0 10px rgba(239, 229, 204, 0.7))
    drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}

.rent-notif-postcard-name {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-weight: 700;
  font-size: 44px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #2a1810;
}

/* Postage stamp pinned to the top-left of the postcard, tilted a few
 * degrees as if pasted on by hand. The actual stamp art is one of 11
 * pre-recolored WebPs (one per color group) generated from a single
 * AI source by ImageMagick chroma-key replacement — see
 * scripts/recolor-stamps.sh. White paper frame and dark engraving
 * stay untouched; only the inner blue panel gets swapped to the
 * group hex. Only rendered for tiles with a colorGroup.
 *
 * The two-layer drop-shadow integrates the stamp with the postcard:
 * a tight warm-brown ground-contact shadow (1px offset) reads as
 * "pressed flat against the paper" rather than floating, and a
 * larger soft shadow underneath gives gentle depth without lifting
 * the edge. No z-index — the postcard's ::after grain + vignette
 * overlay falls on the stamp too, so the stamp picks up the same
 * paper texture and corner darkening as the painting underneath. */
.rent-notif-postcard-stamp {
  position: absolute;
  top: 24px;
  left: 24px;
  width: 93px;
  height: auto;
  transform: rotate(-2.5deg);
  filter:
    drop-shadow(0 0 6px rgba(160, 120, 50, 0.35))
    drop-shadow(0 1px 1px rgba(40, 25, 8, 0.55))
    drop-shadow(0 3px 6px rgba(40, 25, 8, 0.3));
  pointer-events: none;
}

/* Houses / hotel built — large indicator pinned top-right of postcard.
 * Stacked drop-shadow (tight dark outline + soft falloff) so the icons
 * pop on any patch of illustration. */
.rent-notif-postcard-buildings {
  position: absolute;
  top: 24px;
  right: 26px;
  font-size: 38px;
  letter-spacing: 2px;
  filter:
    drop-shadow(0 0 2px rgba(0, 0, 0, 0.95))
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.7));
}

/* Payment row pinned to the bottom of the postcard: from-player on
 * the left, big golden amount in the middle, to-player on the right.
 * 3-column grid keeps the amount in the geometric center regardless of
 * player-name length — the from chip right-aligns to the left column,
 * the to chip left-aligns to the right column, balancing the amount. */
.rent-notif-payment-row {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 32px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 22px;
  padding: 0 24px;
}

.rent-notif-payment-player {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.rent-notif-payment-from { justify-self: end; }
.rent-notif-payment-to   { justify-self: start; }

/* Postcard "Bank" destination on tax tiles — warm coral to read as
 * "money lost to the bank" rather than a regular player chip. The
 * existing 8-direction halo on .rent-notif-payment-name keeps it
 * legible against the painting underneath. */
.rent-notif-payment-bank { color: #ed8a76; }

/* Go-to-jail postcard variant — no money changes hands, so the
 * payment row is just the player's name centered at the bottom of
 * the postcard. Override the 3-column grid with a single centered
 * column. */
.rent-notif-payment-row.rent-notif-payment-row-jail {
  display: block;
  text-align: center;
  padding: 0;
}

.rent-notif-payment-label {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #f5e6c1;
  /* 4-direction dark outline + soft drop so the label reads on any
   * illustration tone underneath. */
  text-shadow:
    -1px -1px 0 rgba(0, 0, 0, 0.9),
     1px -1px 0 rgba(0, 0, 0, 0.9),
    -1px  1px 0 rgba(0, 0, 0, 0.9),
     1px  1px 0 rgba(0, 0, 0, 0.9),
     0 2px 4px rgba(0, 0, 0, 0.7);
}

.rent-notif-payment-name {
  font-family: 'Caveat', 'Cambria', cursive;
  font-weight: 700;
  font-size: 32px;
  line-height: 1;
  /* 8-direction 1.5px outline halo so the colored name is fully legible
   * against the illustration. Drop shadow underneath for lift. */
  text-shadow:
    -1.5px -1.5px 0 rgba(0, 0, 0, 0.9),
     1.5px -1.5px 0 rgba(0, 0, 0, 0.9),
    -1.5px  1.5px 0 rgba(0, 0, 0, 0.9),
     1.5px  1.5px 0 rgba(0, 0, 0, 0.9),
       0   -1.5px 0 rgba(0, 0, 0, 0.9),
       0    1.5px 0 rgba(0, 0, 0, 0.9),
    -1.5px   0    0 rgba(0, 0, 0, 0.9),
     1.5px   0    0 rgba(0, 0, 0, 0.9),
     0 4px 8px rgba(0, 0, 0, 0.7);
}

/* Big golden rent amount — show-stopping headline in the middle of the
 * payment row. Solid metallic gold with a thick dark outline halo so
 * the digits read clearly on any illustration tone underneath, plus a
 * stacked drop-shadow + golden glow for presence. */
.rent-notif-postcard-amount {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 72px;
  letter-spacing: 1.5px;
  line-height: 1;
  color: #f0c64a;
  /* Drop-in stamp: amount falls from above, lands with overshoot, slight
   * squash, settles. Reads as a stamp slammed onto the postcard. */
  animation: rent-amount-pop-in 0.65s cubic-bezier(0.4, 1.4, 0.5, 1) both;
  /* 8-direction dark outline halo (1.5px) so the gold pops on any bg,
   * plus a soft gold glow + multi-layer drop shadow for depth. */
  text-shadow:
    -1.5px -1.5px 0 #1a0e02,
     1.5px -1.5px 0 #1a0e02,
    -1.5px  1.5px 0 #1a0e02,
     1.5px  1.5px 0 #1a0e02,
       0px -1.5px 0 #1a0e02,
       0px  1.5px 0 #1a0e02,
    -1.5px  0px   0 #1a0e02,
     1.5px  0px   0 #1a0e02,
    0 0 22px rgba(232, 196, 74, 0.55),
    0 4px 4px rgba(0, 0, 0, 0.75),
    0 10px 18px rgba(0, 0, 0, 0.55);
}

/* DEAD: stamp rules below — JS no longer renders .rent-notif-postcard-stamp.
 * Kept for now for git history, safe to delete. */
 * reads as pasted-on, not pixel-aligned. */
.rent-notif-postcard-address {
  position: absolute;
  left: 22px;
  bottom: 20px;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 22px 14px;
  background: linear-gradient(180deg, #ecd9a8 0%, #d4be86 100%);
  border: 1.5px solid #5e3f15;
  /* Inner printed guide line — outline + negative offset draws a second
   * border inside the first, giving a classic double-line label look. */
  outline: 1px solid #5e3f15;
  outline-offset: -5px;
  border-radius: 1px;
  transform: rotate(-1.4deg);
  box-shadow:
    0 5px 16px rgba(0, 0, 0, 0.55),
    inset 0 0 30px rgba(140, 95, 30, 0.16);
}

.rent-notif-addr-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}

.rent-notif-addr-label {
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  font-size: 12px;
  color: rgba(80, 50, 10, 0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
  flex-shrink: 0;
  width: 38px;
  text-align: right;
}

.rent-notif-addr-name {
  font-family: 'Caveat', 'Cambria', cursive;
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 240, 200, 0.5);
}

.rent-notif-amount {
  font-size: 48px;
  font-weight: 900;
  color: #e8c44a;
  margin-bottom: 10px;
  text-shadow: 0 0 16px rgba(232, 196, 74, 0.5), 0 2px 6px rgba(0,0,0,0.6);
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.rent-notif-amount-negative {
  color: #f07c67;
  text-shadow: 0 0 16px rgba(240, 124, 103, 0.35), 0 2px 6px rgba(0,0,0,0.6);
}

.rent-notification-large .rent-notif-amount {
  font-size: 54px;
}

.rent-notification-huge .rent-notif-amount {
  font-size: 60px;
}

.rent-notif-coin {
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
  animation: rent-coin-spin 0.6s ease-out;
}
@keyframes rent-coin-spin {
  from { transform: rotateY(180deg) scale(0.5); opacity: 0; }
  to { transform: rotateY(0deg) scale(1); opacity: 1; }
}
.rent-notif-pulse {
  animation: rent-amount-pulse 0.8s ease-in-out 3;
}
@keyframes rent-amount-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.rent-notif-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 6px;
}

.rent-notif-player-payer {
  animation: rent-player-payer 0.7s ease-out;
}

.rent-notif-player-owner {
  animation: rent-player-owner 0.7s ease-out;
}

.rent-notif-player {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 2px solid;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  color: #eee;
  background: rgba(255, 255, 255, 0.05);
}

.rent-notif-player-bank {
  background: rgba(240, 124, 103, 0.08);
  border-color: rgba(240, 124, 103, 0.45) !important;
}

.rent-notif-bank-icon {
  font-size: 16px;
  line-height: 1;
}

.rent-notif-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.rent-notif-arrow {
  font-size: 20px;
  color: #e8c44a;
}

.rent-notif-transfer {
  position: relative;
  width: 50px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rent-notif-trail {
  position: absolute;
  inset: 0;
}

.rent-notif-trail-coin {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 16px;
  height: 16px;
  opacity: 0;
  transform: translateY(-50%) scale(0.5);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  animation: rent-trail-move 1s ease-out forwards;
}

.rent-notif-trail-coin-1 { animation-delay: 0.02s; }
.rent-notif-trail-coin-2 { animation-delay: 0.12s; }
.rent-notif-trail-coin-3 { animation-delay: 0.22s; }
.rent-notif-trail-coin-4 { animation-delay: 0.32s; }
.rent-notif-trail-coin-5 { animation-delay: 0.42s; }
.rent-notif-trail-coin-6 { animation-delay: 0.52s; }
.rent-notif-trail-coin-7 { animation-delay: 0.62s; }

.rent-notif-card {
  margin: 6px 0 16px;
  background: var(--gold-bg-light);
  border: 1px solid var(--gold-border-light);
  border-radius: 4px;
  overflow: hidden;
  display: inline-block;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  animation: rent-card-emerge 0.32s ease-out;
}

.rent-notif-card-large {
  box-shadow: 0 0 10px rgba(232, 196, 74, 0.08), inset 0 1px 0 rgba(255,255,255,0.05);
}

.rent-notif-card-huge {
  box-shadow: 0 0 12px rgba(255, 120, 120, 0.1), 0 0 8px rgba(232, 196, 74, 0.08), inset 0 1px 0 rgba(255,255,255,0.05);
}

.rent-notif-card-color {
  width: 100%;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rent-notif-card-color-tax {
  background: linear-gradient(90deg, #9f2f2f, #d65858);
}

.rent-notif-card-name {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  letter-spacing: 0.5px;
}

.rent-notif-flag-bg {
  width: 160px;
  min-height: 90px;
  display: block;
  opacity: 0.9;
  object-fit: contain;
}

.rent-notif-icon-bg {
  text-align: center;
  padding: 10px 0;
}

.rent-notif-icon-img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.rent-notif-parking-img {
  width: 240px;
  height: 240px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
  margin: 4px auto;
  display: block;
}

.rent-notif-card-rent {
  font-size: 11px;
  color: #bba;
  padding: 2px 10px 2px;
}
.rent-notif-buildings {
  padding: 4px 10px 8px;
  font-size: 20px;
  letter-spacing: 4px;
  text-align: center;
}
.rent-notif-hotel {
  font-size: 36px;
}

.rent-notif-tax-mark {
  letter-spacing: 0;
  color: #f1b6a9;
}

@keyframes rent-player-payer {
  0% { transform: translate(0, 0); opacity: 0; }
  30% { transform: translate(-8px, 3px); opacity: 1; }
  100% { transform: translate(0, 0); opacity: 1; }
}

@keyframes rent-player-owner {
  0% { transform: translate(0, 0); opacity: 0; }
  30% { transform: translate(8px, -3px); opacity: 1; }
  100% { transform: translate(0, 0); opacity: 1; }
}

@keyframes rent-trail-move {
  0% {
    opacity: 0;
    transform: translate(0, -50%) scale(0.55);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(60px, -50%) scale(1);
  }
}

@keyframes rent-card-emerge {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes rent-pop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rent-amount-pop-in {
  0%   { transform: translateY(-26px) scale(0.55); opacity: 0; }
  55%  { transform: translateY(0) scale(1.14); opacity: 1; }
  75%  { transform: translateY(0) scale(0.96); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes rent-fade-out {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
}


/* Center Announcement */
.center-announcement {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 300;
  background: linear-gradient(180deg, rgba(30, 26, 18, 0.9) 0%, rgba(18, 15, 10, 0.92) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 4px;
  padding: 20px 36px;
  font-size: 22px;
  font-weight: bold;
  color: #eee;
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
  animation: rent-pop-in 0.5s ease-out;
}

.center-announcement.fade-out {
  animation: rent-fade-out 0.4s ease forwards;
}

/* Trade Notification */
.trade-notification {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 300;
  background: linear-gradient(180deg, rgba(30, 26, 18, 0.92) 0%, rgba(18, 15, 10, 0.95) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 4px;
  padding: 24px 36px 28px;
  text-align: center;
  pointer-events: none;
  animation: rent-pop-in 0.5s ease-out;
  min-width: 380px;
  box-shadow: 0 0 0 1px rgba(201, 168, 76, 0.1), 0 8px 32px rgba(0, 0, 0, 0.5);
}
.trade-notification.fade-out {
  animation: rent-fade-out 0.4s ease forwards;
}
.trade-notif-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.25);
}
.trade-notif-icon {
  font-size: 28px;
  line-height: 1;
}
.trade-notif-title {
  font-family: 'Nunito', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #c9a84c;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.trade-notif-columns {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.trade-notif-col {
  flex: 1;
  min-width: 0;
  text-align: center;
}
.trade-notif-col .rent-notif-player {
  justify-content: center;
  width: 100%;
  margin-bottom: 10px;
  font-size: 15px;
}
.trade-notif-arrow-col {
  display: flex;
  align-items: center;
  padding-top: 8px;
  font-size: 24px;
  color: #e8c44a;
}
.trade-notif-items {
  text-align: left;
  padding: 6px 4px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
  min-height: 32px;
}

/* Cluster tiles embedded in a trade notification: compact header (no count
 * badge is shown here) and snug rows. */
.trade-notif-items .trade-prop-cluster {
  margin-bottom: 6px;
}
.trade-notif-items .trade-prop-cluster:last-child {
  margin-bottom: 0;
}
.trade-notif-items .trade-prop-cluster-header {
  min-height: 6px;
  padding: 0;
}
.trade-notif-items .prop-mini-card {
  padding: 4px 10px;
  font-size: 14px;
}
.trade-notif-money {
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #5ce65c;
  padding: 4px 6px;
}
.trade-notif-goojf {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: #e8c44a;
  padding: 4px 6px;
}
.trade-notif-empty {
  color: rgba(201, 168, 76, 0.3);
  font-size: 15px;
  padding: 4px 6px;
  text-align: center;
}

/* Money Change Animation */
.money-change {
  position: absolute;
  right: 5px;
  top: 24px;
  font-weight: bold;
  font-size: 26px;
  pointer-events: none;
  animation: money-float 3.5s ease-out forwards;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.money-change.positive { color: #35c070; }
.money-change.negative { color: #ff4444; }

@keyframes money-float {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  10% { transform: translateY(-2px) scale(1.15); }
  50% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-36px) scale(1); }
}

/* Sidebar Buttons (Settings, History, Leave, Auto) */
.btn-sidebar {
  position: absolute;
  right: 16px;
  z-index: 20;
  /* Match the player-info-card / btn-action look: gray gradient body, no
   * outline, warm brass inset highlight for glass 3D, text/icon drop shadow. */
  background: linear-gradient(180deg, rgba(78, 80, 84, 0.9) 0%, rgba(52, 54, 58, 0.92) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: none;
  border-radius: 4px;
  color: #f0e8d8;
  padding: 10px 16px 8px;
  min-width: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  font-weight: 500;
  text-shadow: -1px 2px 2px rgba(0, 0, 0, 0.5), -1px 1px 1px rgba(0, 0, 0, 0.35);
  /* Softer top glow, harder bottom inset, outer drop shadow — matches btn-action. */
  box-shadow:
    inset 0 2px 4px -2px rgba(255, 225, 160, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 3px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.15s ease;
}

.btn-sidebar .btn-icon {
  font-size: 24px;
  line-height: 1;
}

.btn-sidebar .btn-label {
  font-size: 13px;
  line-height: 1.2;
}

.btn-sidebar:hover {
  background: linear-gradient(180deg, rgb(110, 85, 35) 0%, rgb(75, 58, 24) 100%);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 225, 160, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5);
  transform: translateY(-1px);
}

.btn-sidebar-leave:hover {
  background: linear-gradient(180deg, rgba(120, 50, 50, 0.92) 0%, rgba(85, 32, 32, 0.95) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 180, 180, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45);
}

#leave-game-btn { bottom: 16px; }
#settings-toggle-btn { bottom: 84px; }
#transactions-toggle-btn { bottom: 152px; }
#auto-play-btn { bottom: 220px; }
#leave-spectate-btn { bottom: 16px; }


#action-buttons.auto-play-hidden {
  opacity: 0;
  pointer-events: none;
}

.auto-play-active {
  background: rgba(40, 120, 40, 0.5) !important;
  border-color: rgba(80, 200, 80, 0.4) !important;
}

.auto-play-active:hover {
  background: rgba(50, 140, 50, 0.5) !important;
  border-color: rgba(80, 200, 80, 0.6) !important;
}

/* In-game Settings Panel */
.ingame-settings-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 500;
  background: rgba(30, 28, 24, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: none;
  border-radius: 4px;
  padding: 14px 18px;
  width: 460px;
  max-height: 80%;
  overflow-y: auto;
  box-shadow: var(--panel-shadow);
  text-shadow: var(--ui-text-shadow);
  user-select: none;
}

.ingame-settings-header {
  color: var(--gold-text);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding-bottom: 8px;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ingame-settings-close {
  background: none;
  border: none;
  color: #5a4a2a;
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
  text-decoration: none;
}

.ingame-settings-close:hover {
  color: var(--gold-text);
  border-bottom: 1px solid rgba(201, 168, 76, 0.3);
}

.ingame-settings-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}

.ingame-settings-section {
  margin-bottom: 4px;
}

.ingame-settings-section-title {
  color: var(--gold-text);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 0 4px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
  margin-bottom: 2px;
}

.ingame-settings-divider {
  height: 1px;
  background: rgba(90, 80, 64, 0.5);
  margin: 6px 0;
}

.ingame-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}

.ingame-settings-label {
  color: #d4cbb8;
  font-size: 12px;
  font-weight: 500;
}

.btn-cycle {
  background: rgba(30, 28, 24, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--gold-border);
  border-radius: 4px;
  color: #f0e8d8;
  padding: 6px 14px;
  min-width: 110px;
  text-align: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.btn-cycle:hover {
  background: linear-gradient(180deg, #c9981e 0%, #a07516 100%);
  border-color: #d4a526;
  color: #fff;
}

/* Transactions Button - uses .btn-sidebar */

/* Transactions Panel — flex sibling that pushes game area */
.transactions-panel {
  width: 280px;
  height: 100vh;
  background: rgba(22, 20, 16, 0.95);
  border-left: 1px solid var(--gold-border);
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.transactions-panel.hidden {
  display: flex !important; /* override global .hidden */
  width: 0;
  padding-left: 0;
  padding-right: 0;
  border-left: none;
  pointer-events: none;
}

.transactions-header {
  color: #e8c44a;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gold-border);
}

.transactions-summary {
  padding: 4px 0 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.transactions-summary:empty {
  display: none;
}

.top-prop-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  font-size: 12px;
  color: #ddd;
}

.top-prop-medal {
  font-size: 14px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.top-prop-color {
  width: 4px;
  height: 16px;
  border-radius: 1px;
  flex-shrink: 0;
}

.top-prop-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-prop-amount {
  font-weight: 700;
  color: #4ecb71;
  white-space: nowrap;
}

.transactions-empty {
  color: #888;
  font-size: 13px;
  text-align: center;
  padding: 24px 0;
}

.transactions-list {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.tx-round-divider {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  color: rgba(201, 168, 76, 0.7);
  text-align: center;
  padding: 10px 0 4px;
  margin: 4px 0;
  border-top: 2px solid;
  border-image: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.6), transparent) 1;
}

.tx-round-divider:first-child {
  border-top: none;
  padding-top: 0;
}

/* Silver gradient between player turns */
.tx-turn-gap {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(180, 185, 195, 0.4), transparent);
  margin: 6px 8px;
}

.tx-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0 8px;
  align-items: center;
  padding: 3px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.tx-row:last-child {
  border-bottom: none;
}

.tx-row.tx-zero {
}

.tx-parties {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #ddd;
  min-width: 0;
  overflow: hidden;
}

.tx-party {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.tx-arrow {
  color: #e8c44a;
  font-size: 12px;
  flex-shrink: 0;
}

.tx-amount-pos {
  font-size: 13px;
  font-weight: 700;
  color: #4ecb71;
  text-align: right;
  white-space: nowrap;
}

.tx-amount-neg {
  font-size: 13px;
  font-weight: 700;
  color: #e85454;
  text-align: right;
  white-space: nowrap;
}

.tx-reason {
  grid-column: 1 / 3;
  font-size: 10px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transactions-list::-webkit-scrollbar {
  width: 4px;
}

.transactions-list::-webkit-scrollbar-track {
  background: transparent;
}

.transactions-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
}

/* Leave Button - uses .btn-sidebar + .btn-sidebar-leave */

/* Disabled action button */
.btn-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-action:disabled:hover {
  background: rgba(30, 28, 24, 0.6);
  border-color: rgba(201, 168, 76, 0.2);
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}


/* Dev Panel */
.btn-dev-toggle {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 60;
  background: rgba(80, 20, 20, 0.9);
  border: 1px solid #aa4444;
  border-radius: 6px;
  color: #ff8888;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 11px;
  font-family: monospace;
}

.btn-dev-toggle:hover {
  background: #aa4444;
  color: #fff;
}

#dev-panel {
  position: fixed;
  top: 40px;
  right: 8px;
  width: 340px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  background: rgba(30, 10, 10, 0.95);
  border: 1px solid #aa4444;
  border-radius: 8px;
  padding: 12px;
  z-index: 55;
  font-size: 12px;
  font-family: monospace;
}

#dev-panel h3 {
  color: #ff6666;
  margin-bottom: 8px;
  font-size: 14px;
  border-bottom: 1px solid #aa4444;
  padding-bottom: 4px;
}

.dev-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.dev-tag {
  background: rgba(80, 30, 30, 0.8);
  border: 1px solid #553333;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 10px;
  color: #cc9999;
}

.dev-tag b {
  color: #ffccaa;
}

.dev-tag-warn {
  border-color: #aa8833;
  color: #ffcc44;
}

.dev-tag-warn b {
  color: #ffee66;
}

.dev-player-section {
  background: rgba(50, 20, 20, 0.6);
  border: 1px solid #663333;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 8px;
}

.dev-player-current {
  border-color: #44aa44;
}

.dev-player-bankrupt {
  opacity: 0.5;
}

.dev-player-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.dev-player-name {
  font-weight: bold;
  color: #ffaa88;
}

.dev-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: bold;
  text-transform: uppercase;
}

.dev-badge-turn {
  background: #2a5a2a;
  color: #88ff88;
}

.dev-badge-bankrupt {
  background: #5a2a2a;
  color: #ff8888;
}

.dev-badge-jail {
  background: #5a4a2a;
  color: #ffcc66;
}

.dev-badge-dc {
  background: #4a2a4a;
  color: #cc88ff;
}

.dev-player-stats {
  font-size: 10px;
  color: #999;
  margin-bottom: 6px;
}

.dev-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.dev-row label {
  width: 55px;
  flex-shrink: 0;
  color: #cc8888;
  font-size: 11px;
}

.dev-row input, .dev-row select {
  flex: 1;
  background: #1a0a0a;
  border: 1px solid #663333;
  color: #eee;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-family: monospace;
}

.dev-row select {
  max-width: 160px;
}

.btn-dev {
  background: #552222;
  border: 1px solid #883333;
  border-radius: 4px;
  color: #ffaaaa;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 11px;
  font-family: monospace;
  white-space: nowrap;
}

.btn-dev:hover {
  background: #883333;
  color: #fff;
}

.btn-dev-sm {
  padding: 2px 5px;
  font-size: 10px;
}

.dev-section-title {
  color: #ff8888;
  font-size: 11px;
  margin: 8px 0 4px;
  border-bottom: 1px solid #442222;
  padding-bottom: 2px;
}


/* Confirm Modal */
.confirm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: confirm-fade-in 0.15s ease-out;
}

@keyframes confirm-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.confirm-box {
  background: linear-gradient(180deg, rgba(30, 26, 18, 0.97) 0%, rgba(18, 15, 10, 0.98) 100%);
  border: 2px solid #5a4a2a;
  border-radius: 4px;
  padding: 28px 32px 22px;
  min-width: 300px;
  max-width: 420px;
  box-shadow:
    0 0 0 1px rgba(212, 165, 38, 0.15),
    0 0 60px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(212, 165, 38, 0.1);
  animation: confirm-scale-in 0.15s ease-out;
  text-align: center;
}

@keyframes confirm-scale-in {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.confirm-icon {
  font-size: 36px;
  margin-bottom: 10px;
}

.confirm-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold-text);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.confirm-message {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
  margin-bottom: 20px;
}

.confirm-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.confirm-btn {
  background: var(--gold-bg-hover);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 4px;
  color: #f0e8d8;
  padding: 10px 24px;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.confirm-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

.confirm-btn-cancel:hover {
  background: rgba(180, 140, 40, 0.35);
  border-color: rgba(212, 165, 38, 0.5);
  color: #fff;
  box-shadow: 0 2px 16px rgba(212, 165, 38, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.confirm-btn-danger {
  background: var(--btn-negative-bg);
  border-color: var(--btn-negative-border);
  color: var(--btn-negative-color);
}

.confirm-btn-danger:hover {
  background: var(--btn-negative-hover-bg);
  border-color: var(--btn-negative-hover-border);
  color: var(--btn-negative-hover-color);
  box-shadow: 0 2px 16px rgba(220, 60, 60, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #5a5040;
  border-radius: 3px;
}

/* ── Mobile: Fullscreen Button ──────────────── */
.mobile-fullscreen-btn {
  position: fixed;
  bottom: 12px;
  right: 12px;
  z-index: 9998;
  background: rgba(30, 26, 18, 0.9);
  border: 1px solid var(--gold-border);
  border-radius: 4px;
  color: var(--gold-text);
  font-size: 20px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.mobile-fullscreen-btn:hover {
  background: var(--gold-bg-hover);
  border-color: var(--gold-text);
}

/* Only show on touch devices not already in fullscreen */
@media (pointer: coarse) {
  .mobile-fullscreen-btn {
    display: flex;
  }
}

.mobile-fullscreen-btn.hidden {
  display: none !important;
}

/* ── Mobile: Property card + auction ─────────── */
@media (max-width: 768px) {
  #property-card {
    left: 4px !important;
    transform: translateY(-50%) scale(0.55);
    transform-origin: left center;
  }

  .auction-dialog {
    left: auto !important;
    right: 48px !important;
    transform: translateY(-50%) !important;
    width: auto !important;
    min-width: 240px;
    max-width: 50vw !important;
  }
}

/* ── Mobile: Responsive Button Scaling ──────── */
/* ── Mobile: Landscape phones ───────────────── */
@media (max-height: 500px) {
  /* Action buttons: icon-only, compact */
  #action-buttons {
    gap: 5px;
    bottom: 8px;
  }

  #action-buttons > .btn-action {
    min-width: 48px;
    padding: 8px 10px 6px;
  }

  #action-buttons > .btn-action .btn-label {
    display: none;
  }

  #action-buttons > .btn-action .btn-icon {
    font-size: 22px;
  }

  /* Compact player strip */
  .player-card {
    padding: 4px 8px;
    font-size: 11px;
  }

  .player-money {
    font-size: 13px;
  }

  /* Smaller notifications */
  .rent-notification {
    padding: 8px 14px;
  }

  .rent-notif-amount {
    font-size: 26px;
    margin-bottom: 4px;
  }

  .rent-notif-coin {
    width: 24px;
    height: 24px;
  }

  .rent-notif-player {
    font-size: 10px;
    padding: 2px 6px;
  }

  .rent-notif-card-name {
    font-size: 16px;
  }

  .rent-notif-flag-bg {
    width: 120px;
  }

  /* Smaller jail dialog */
  .jail-btn {
    padding: 10px 14px;
    font-size: 14px;
  }

  .jail-btn-icon {
    font-size: 18px;
    width: 24px;
  }

  /* Settings panel: fit in landscape */
  .ingame-settings-panel {
    bottom: 8px !important;
    right: 44px !important;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    padding: 10px 14px;
    min-width: 180px;
    font-size: 12px;
  }

  .ingame-settings-header {
    font-size: 13px;
    margin-bottom: 6px;
  }

  .ingame-settings-row {
    padding: 3px 0;
  }

  /* Sidebar buttons: compact icon-only column */
  .btn-sidebar {
    right: 6px;
    padding: 6px;
    min-width: 36px;
  }

  .btn-sidebar .btn-label {
    display: none;
  }

  .btn-sidebar .btn-icon {
    font-size: 18px;
  }

  #leave-game-btn { bottom: 8px; }
  #settings-toggle-btn { bottom: 52px; }
  #transactions-toggle-btn { bottom: 96px; }
  #auto-play-btn { bottom: 140px; }
}

/* ── Mobile: Portrait phones ────────────────── */
@media (max-width: 500px) and (orientation: portrait) {
  /* Move action buttons to full-width bottom bar */
  #action-buttons {
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    background: rgba(20, 18, 12, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--gold-border);
    padding: 8px 12px;
    gap: 6px;
    justify-content: space-evenly;
  }

  #action-buttons > .btn-action {
    min-width: 0;
    flex: 1;
    padding: 8px 4px 6px;
    max-width: 70px;
  }

  #action-buttons > .btn-action .btn-label {
    font-size: 9px;
  }

  #action-buttons > .btn-action .btn-icon {
    font-size: 20px;
  }

  /* Player strip: minimal mode — non-active players become dots */
  #player-info-strip {
    gap: 4px;
    padding: 6px 42px 6px 6px;
    align-items: center;
  }

  .player-info-card {
    min-width: 0;
    padding: 0;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
  }

  .player-info-card .name {
    display: none;
  }

  .player-info-card .money {
    display: none;
  }

  .player-info-card .player-detail {
    display: none;
  }

  /* Show colored dot via the player-color-dot */
  .player-info-card .player-color-dot {
    width: 20px;
    height: 20px;
    margin: 0;
    flex-shrink: 0;
  }

  /* Active player: show as full card */
  .player-info-card.active {
    width: auto;
    height: auto;
    border-radius: 4px;
    padding: 6px 10px;
    background: rgba(30, 28, 24, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 214, 102, 0.55);
    box-shadow: 0 0 12px rgba(212, 165, 38, 0.4);
    min-width: 100px;
    overflow: visible;
  }

  .player-info-card.active .name {
    display: block;
    font-size: 11px;
  }

  .player-info-card.active .money {
    display: block;
    font-size: 13px;
  }

  .player-info-card.active .player-color-dot {
    width: 8px;
    height: 8px;
  }

  /* Bankrupt dots dimmed */
  .player-info-card.bankrupt {
    opacity: 0.3;
  }

  /* Sidebar: horizontal row at top-right */
  .btn-sidebar {
    position: fixed;
    right: auto;
    bottom: auto !important;
    padding: 6px;
    min-width: 36px;
  }

  .btn-sidebar .btn-label {
    display: none;
  }

  .btn-sidebar .btn-icon {
    font-size: 18px;
  }

  #settings-toggle-btn { top: 8px; right: 8px; position: fixed; }
  #transactions-toggle-btn { top: 8px; right: 50px; position: fixed; }
  #auto-play-btn { top: 8px; right: 92px; position: fixed; }
  #leave-game-btn { top: 8px; right: 134px; position: fixed; }

  /* Property card: top area, auction: bottom area */
  #property-card {
    left: 50% !important;
    top: 20% !important;
    transform: translate(-50%, -50%) scale(0.5);
    transform-origin: center center;
  }

  .auction-dialog {
    top: auto !important;
    bottom: 56px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: 90vw !important;
    max-width: 90vw !important;
    max-height: 50vh;
    overflow-y: auto;
  }

  /* Smaller text on property card */
  .property-card-band h3 {
    font-size: 12px;
  }

  .pc-price {
    font-size: 11px;
  }

  .rent-line {
    font-size: 10px;
  }

  .pc-build-cost, .pc-mortgage, .pc-harbour-info {
    font-size: 10px;
    padding: 3px 4px;
  }

  /* Smaller text on drawn cards (chance/community) */
  .card-drawn-type {
    font-size: 14px !important;
    padding: 10px 14px !important;
  }

  .card-drawn-text {
    font-size: 12px !important;
    padding: 8px 14px !important;
  }

  .card-drawn-player {
    font-size: 10px;
    padding: 5px 14px;
    margin: 0 8px 8px;
  }

  .auction-dialog {
    top: auto !important;
    bottom: 60px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 90vw !important;
    max-height: 45vh;
    overflow-y: auto;
  }

  /* Smaller notifications */
  .rent-notification {
    padding: 8px 12px;
    max-width: 260px;
  }

  .rent-notif-amount {
    font-size: 24px;
  }

  .rent-notif-coin {
    width: 22px;
    height: 22px;
  }

  .rent-notif-flag-bg {
    width: 100px;
  }
}

/* ── Mobile: Action Cards ───────────────────────
 * Action cards (300×440 hand / 340×500 announcement)
 * are far too big for phone viewports. Scope: only
 * touch/small viewports — desktop is untouched.
 * ────────────────────────────────────────────────*/
@media (max-width: 768px), (max-height: 500px) {
  /* ── Card Hand: scale entire container ────────
   * The fan layout uses JS-set inline transforms
   * + negative margins. Scaling the parent shrinks
   * everything proportionally without touching JS. */
  #action-card-hand,
  .action-card-hand {
    transform: translateX(-50%) scale(0.5);
    transform-origin: bottom center;
    bottom: 78px;
    padding: 8px 40px;
  }

  /* ── Draft Modal: scale entire card row ───────
   * Use transform: scale() rather than direct
   * resize so internal pixel offsets (e.g.
   * .card-text bottom calc with +4px) remain
   * proportional. Same approach as the hand. */
  .draft-title {
    font-size: 15px;
    margin-bottom: 12px;
    letter-spacing: 2px;
  }
  .draft-timer {
    font-size: 13px;
    margin-bottom: 8px;
  }
  .draft-cards {
    gap: 16px;
    perspective: 400px;
    transform: scale(0.5);
    transform-origin: center center;
  }
  .draft-cards .action-card:hover {
    transform: translateY(-10px) scale(1.04);
  }
  .action-card-draft {
    overflow: hidden;
  }

  /* ── Card Played Announcement ───────────────── */
  .announcement-card.action-card {
    width: 190px !important;
    height: 280px !important;
  }
  .announcement-card.action-card .card-frame {
    height: 286px !important;
  }
  .announcement-card.action-card .card-name {
    font-size: 11px !important;
    letter-spacing: 1px !important;
    margin-bottom: 2px !important;
  }
  .announcement-card.action-card .card-desc {
    font-size: 8px !important;
    line-height: 1.25 !important;
  }
  .announcement-card.action-card .card-tier {
    font-size: 7px !important;
    letter-spacing: 1px !important;
  }
  .announcement-player {
    font-size: 12px;
    padding: 5px 14px;
    margin-bottom: 10px;
    gap: 8px;
  }
  .announcement-flow {
    gap: 6px;
    margin-bottom: 10px;
  }
  .announcement-badge {
    font-size: 11px;
    padding: 5px 10px;
    gap: 4px;
  }
  .announcement-icon {
    font-size: 13px;
  }
  .announcement-arrow {
    font-size: 14px;
  }
  .announcement-dot {
    width: 9px;
    height: 9px;
  }

  /* ── Card Flip Reveal (single) ──────────────── */
  .flip-received-label,
  .flip-stolen-label {
    font-size: 13px;
    padding: 5px 16px;
    margin-bottom: 10px;
  }
  .flip-inner {
    width: 190px !important;
    height: 280px !important;
  }
  .flip-inner .action-card {
    width: 190px !important;
    height: 280px !important;
  }
  .flip-inner .action-card .card-frame {
    height: 286px !important;
  }
  .flip-inner .action-card .card-name {
    font-size: 11px !important;
    letter-spacing: 1px !important;
    margin-bottom: 2px !important;
  }
  .flip-inner .action-card .card-desc {
    font-size: 8px !important;
    line-height: 1.25 !important;
  }
  .flip-inner .action-card .card-tier {
    font-size: 7px !important;
    letter-spacing: 1px !important;
  }

  /* ── Card Flip Reveal (dual: wheel +2) ──────── */
  .action-card-flip.flip-dual .flip-cards-row {
    gap: 10px;
  }
  .action-card-flip.flip-dual .flip-inner,
  .action-card-flip.flip-dual .flip-inner .action-card {
    width: 140px !important;
    height: 206px !important;
  }
  .action-card-flip.flip-dual .flip-inner .action-card .card-frame {
    height: 210px !important;
  }
  .action-card-flip.flip-dual .flip-inner .action-card .card-name {
    font-size: 9px !important;
    letter-spacing: 0.5px !important;
  }
  .action-card-flip.flip-dual .flip-inner .action-card .card-desc {
    font-size: 7px !important;
    line-height: 1.2 !important;
  }
  .action-card-flip.flip-dual .flip-inner .action-card .card-tier {
    font-size: 6px !important;
  }

  /* ── Target Selection Dialog ────────────────── */
  .target-dialog {
    padding: 14px 16px;
    max-height: 80vh;
  }
  .target-header {
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 10px;
  }
  .target-header-art {
    width: 42px;
    height: 42px;
  }
  .target-dialog h3 {
    font-size: 12px;
    letter-spacing: 1.5px;
  }
  .target-subtitle {
    font-size: 10px;
  }
  .target-item {
    padding: 8px 8px;
    font-size: 12px;
  }
}

/* ── Mobile: Action Cards — portrait phones ────
 * Tighter scale for narrow portrait screens where
 * the bottom action bar takes up real estate. */
@media (max-width: 500px) and (orientation: portrait) {
  #action-card-hand,
  .action-card-hand {
    transform: translateX(-50%) scale(0.42);
    bottom: 110px; /* clear the bottom action bar */
  }

  /* Draft: tighter scale for narrow portrait */
  .draft-cards {
    gap: 12px;
    transform: scale(0.36);
  }
  .draft-title {
    font-size: 13px;
    margin-bottom: 10px;
    letter-spacing: 1.5px;
  }
  .draft-timer {
    font-size: 12px;
    margin-bottom: 6px;
  }

  /* Target dialog: collapse 2-col grouped list to 1 col */
  .target-group {
    flex: 0 0 100%;
  }
}

@media (max-width: 640px) {
  /* Narrow screens */
  .trade-dialog {
    width: 95vw !important;
  }

  .trade-layout {
    flex-direction: column;
  }

  .mortgage-dialog {
    width: 95vw !important;
  }

  .build-dialog {
    width: 95vw !important;
    max-width: 95vw !important;
  }

  .build-group {
    flex: 1 1 100% !important;
    min-width: 0 !important;
  }

  .auction-dialog {
    width: 90vw !important;
  }

  .trade-incoming-dialog {
    width: 90vw !important;
  }

  .game-over-dialog {
    width: 95vw !important;
    max-width: 95vw !important;
  }

  .go-top-row {
    flex-direction: column;
  }

  .go-player-grid {
    grid-template-columns: 1fr !important;
  }
}
/* ── Action Card Hand Button ────────────────────────────────────── */

#action-cards-btn {
  position: relative;
}

.card-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--btn-negative-bg, #b33);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  border-radius: 9px;
  text-align: center;
  pointer-events: none;
}

/* ── Card Hand Overlay ─────────────────────────────────────────── */

.action-card-hand {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0;
  z-index: 45;
  padding: 10px 60px;
}

.action-card-hand.hidden {
  display: none !important;
}

/* ── Card Component ────────────────────────────────────────────── */

.action-card-wrapper {
  perspective: 800px;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  --fan-rotate: 0deg;
}

/* ── Fan / Overlap in Hand ──────────────────────────────────────── */

.action-card-hand .action-card-wrapper {
  transition: transform 0.7s ease, z-index 0s;
}

/* ── Hold-to-Play Indicator ─────────────────────────────────────── */

.card-play-indicator {
  position: absolute;
  top: 20px;
  left: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 80, 0, 0.8);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.card-play-indicator.active {
  opacity: 1;
}

.card-play-indicator span {
  position: relative;
  z-index: 2;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
}

.card-play-indicator svg {
  pointer-events: none;
}

.play-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  transform: rotate(-90deg);
}

.play-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 3;
}

.play-ring-progress {
  fill: none;
  stroke: var(--btn-positive-border, #4a8);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.05s linear;
}

/* ── Timing Badge (disabled cards, above grayscale) ────────────── */

.card-timing-badge {
  position: absolute;
  top: calc(8% + 1.2px);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Nunito', sans-serif;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  z-index: 10;
  white-space: nowrap;
}

/* ── Round Lock Notice ──────────────────────────────────────────── */

.card-round-lock {
  position: absolute;
  bottom: calc(27% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(180, 30, 30, 0.9);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 80, 80, 0.6);
  white-space: nowrap;
  z-index: 10;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* ── Hold-to-Discard Button ─────────────────────────────────────── */

.card-discard-btn {
  position: absolute;
  top: 20px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  color: #ccc;
  font-size: 18px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  transition: opacity 0.2s;
}

.action-card-wrapper:hover .card-discard-btn,
.action-card:hover .card-discard-btn {
  opacity: 1;
}

.card-discard-btn:hover {
  background: rgba(100, 40, 40, 0.85);
  color: var(--btn-negative-color);
}

.card-discard-btn.holding {
  opacity: 1;
  background: rgba(100, 40, 40, 0.9);
  color: var(--btn-negative-hover-color);
}

.card-discard-btn span,
.card-discard-btn svg {
  pointer-events: none;
}

.card-discard-btn span {
  position: relative;
  z-index: 2;
  line-height: 1;
}

.discard-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  transform: rotate(-90deg);
}

.discard-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 3;
}

.discard-ring-progress {
  fill: none;
  stroke: var(--btn-negative-hover-border);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.05s linear;
}

.action-card {
  position: relative;
  width: 300px;
  height: 440px;
  cursor: pointer;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
  flex-shrink: 0;
  background: #2a1f14;
  overflow: hidden;
  border-radius: 8px;
  transform-style: preserve-3d;
  will-change: transform;
}

.action-card:hover {
  z-index: 2;
}

.action-card.disabled {
  pointer-events: none;
  cursor: default;
  filter: grayscale(1) brightness(0.5);
}

.action-card.card-bronze,
.action-card.card-silver,
.action-card.card-gold {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.action-card.card-back {
  width: 270px;
  height: 396px;
}

.action-card.card-back .card-frame {
  height: 100%;
}

.action-card .card-art {
  position: absolute;
  top: 10%;
  left: 10%;
  width: 80%;
  height: 65%;
  object-fit: cover;
  z-index: 1;
}

.action-card .card-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 450px;
  z-index: 2;
  pointer-events: none;
}

.action-card .card-text {
  position: absolute;
  bottom: calc(3% + 4px);
  left: 16%;
  right: 16%;
  height: 24%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #f0e0c0;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.action-card .card-name {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 3px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}

.action-card .card-desc {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.action-card .card-tier {
  position: absolute;
  top: calc(8% + 1.2px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  font-family: 'Nunito', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  opacity: 0.8;
  white-space: nowrap;
}

/* Tier colors */
.tier-bronze { color: #cd9b6a; }
.tier-silver { color: #c0c0c0; }
.tier-gold { color: #ffd700; }
.timing-pre { color: #00e5ff; text-shadow: 0 0 10px rgba(0,229,255,0.7), 0 1px 3px rgba(0,0,0,0.9); }
.timing-post { color: #33dd33; text-shadow: 0 0 6px rgba(51,221,51,0.5); }
.timing-any { color: #ffcc00; text-shadow: 0 0 6px rgba(255,204,0,0.5); }

/* Frame tinting */
.card-bronze .card-frame {
  filter: sepia(0.3) saturate(1.2) brightness(0.9);
}
.card-silver .card-frame {
  filter: saturate(0) brightness(1.2);
}
.card-gold .card-frame {
  filter: brightness(1.15) saturate(1.5) hue-rotate(18deg);
}

/* ── Draft Modal ───────────────────────────────────────────────── */

.action-card-draft {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  text-shadow: var(--ui-text-shadow);
}

.action-card-draft.hidden {
  display: none !important;
}

.draft-title {
  font-family: 'Nunito', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #c9a84c;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.draft-timer {
  font-family: 'Nunito', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #aaa;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.draft-cards {
  display: flex;
  gap: 32px;
  perspective: 600px;
}

.draft-cards .action-card.card-back {
  width: 300px;
  height: 440px;
}

.draft-cards .action-card.card-back .card-frame {
  height: 100%;
}

.draft-cards .action-card:hover {
  transform: translateY(-14px) scale(1.04);
  box-shadow: 0 24px 56px -12px rgba(0, 0, 0, 0.8), 0 8px 20px rgba(0, 0, 0, 0.3), 0 0 24px rgba(201, 168, 76, 0.15);
}

@keyframes draft-card-reveal {
  0%   { opacity: 0; transform: rotateX(90deg) scale(0.8); }
  35%  { opacity: 1; transform: rotateX(-10deg) scale(1.03); }
  65%  { transform: rotateX(4deg) scale(1); }
  100% { opacity: 1; transform: rotateX(0deg) scale(1); }
}

@keyframes draft-card-pick {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.15) translateY(-30px); }
}

@keyframes draft-card-dismiss {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.85) translateY(20px); }
}

/* ── Card Target Selection ─────────────────────────────────────── */

.action-card-target {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  text-shadow: var(--ui-text-shadow);
}

.action-card-target.hidden {
  display: none !important;
}

.target-dialog {
  background: linear-gradient(180deg, rgba(30, 26, 18, 0.95), rgba(18, 15, 10, 0.97));
  border: none;
  border-radius: 4px;
  padding: 20px 24px;
  min-width: 240px;
  max-width: 500px;
  width: 90vw;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: var(--panel-shadow);
  text-shadow: var(--ui-text-shadow);
  user-select: none;
}
.target-dialog-wide {
  max-width: 660px;
}

.target-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.25);
}

.target-header-art {
  width: 52px;
  height: 52px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid rgba(201, 168, 76, 0.3);
  flex-shrink: 0;
}

.target-header-text {
  flex: 1;
  min-width: 0;
}

.target-dialog h3 {
  font-family: 'Nunito', sans-serif;
  color: #c9a84c;
  font-size: 14px;
  margin: 0 0 3px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.target-subtitle {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  color: rgba(240, 224, 192, 0.6);
  line-height: 1.3;
}

.target-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.target-list-grouped {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
}
.target-group {
  flex: 0 0 calc(50% - 4px);
  border: 1px solid rgba(201, 168, 76, 0.1);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.target-group-bar {
  height: 6px;
  border-radius: 4px 4px 0 0;
}
.target-group .target-item {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.target-group .target-item:last-child {
  border-bottom: none;
}

.target-item {
  cursor: pointer;
  padding: 4px 10px;
}
.target-item:hover {
  background: rgba(201, 168, 76, 0.12);
}



/* Legacy group header — kept for opponentThenProperty group picker */
.target-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.target-group-header:first-child { margin-top: 0; }
.target-group-dot {
  width: 100%;
  height: 3px;
  border-radius: 2px;
  opacity: 0.7;
}

.target-section-label {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: rgba(201, 168, 76, 0.6);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}

.target-item-money {
  float: right;
  color: rgba(201, 168, 76, 0.7);
  font-size: 12px;
}

.target-cancel {
  margin-top: 12px;
  width: 100%;
  padding: 8px;
  background: var(--btn-neutral-bg, rgba(80, 60, 30, 0.8));
  color: var(--btn-neutral-text, #d4c49a);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  text-align: center;
  transition: all 0.15s ease;
  /* Borderless pop-out: warm-amber top highlight + outer drop shadow. */
  box-shadow:
    inset 0 2px 3px -1px rgba(255, 225, 160, 0.28),
    0 2px 5px rgba(0, 0, 0, 0.4);
}

.target-cancel:hover {
  background: rgba(100, 75, 35, 0.9);
  transform: translateY(-1px);
  box-shadow:
    inset 0 2px 3px -1px rgba(255, 225, 160, 0.38),
    0 3px 6px rgba(0, 0, 0, 0.45);
}

/* ── Card Played Announcement ──────────────────────────────────── */

.action-card-announcement {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 90;
  pointer-events: none;
  text-shadow: var(--ui-text-shadow);
}

.action-card-announcement.hidden {
  display: none !important;
}

/* Player bar (no-target fallback) */
.announcement-player {
  background: linear-gradient(180deg, rgba(30, 26, 18, 0.9) 0%, rgba(18, 15, 10, 0.92) 100%);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 4px;
  padding: 8px 22px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  animation: announcement-bar-in 0.3s ease-out;
}

.announcement-player .player-name {
  color: #c9a84c;
}

/* Player → Target flow bar */
.announcement-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
  animation: announcement-bar-in 0.3s ease-out;
}

.announcement-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px solid rgba(201, 168, 76, 0.4);
  border-radius: 4px;
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #eee;
  background: rgba(40, 35, 24, 0.95);
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.announcement-badge-player {
  border-color: rgba(201, 168, 76, 0.5);
  color: #c9a84c;
}

.announcement-badge-target {
  animation: announcement-target-in 0.4s ease-out 0.15s both;
}

.announcement-icon {
  font-size: 18px;
}

.announcement-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.announcement-arrow {
  font-size: 18px;
  color: #e8c44a;
  animation: announcement-arrow-pulse 0.6s ease-out 0.1s both;
}

@keyframes announcement-target-in {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes announcement-arrow-pulse {
  0% { opacity: 0; transform: scale(0.5); }
  60% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes announcement-bar-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.announcement-card {
  animation: card-reveal 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.announcement-card.action-card {
  width: 340px;
  height: 500px;
  cursor: default;
}

.announcement-card.action-card .card-frame {
  height: 510px;
}

.announcement-card.action-card .card-name {
  font-size: 17px;
}

.announcement-card.action-card .card-desc {
  font-size: 12px;
}

.announcement-card.action-card .card-tier {
  font-size: 10px;
}

/* Tier-specific glow on announcement — box-shadow on the card itself */
.announcement-card.card-bronze {
  box-shadow: 0 0 30px 4px rgba(205, 155, 106, 0.5), 0 0 0 1px rgba(205, 155, 106, 0.3);
}

.announcement-card.card-silver {
  box-shadow: 0 0 30px 4px rgba(192, 192, 192, 0.5), 0 0 0 1px rgba(192, 192, 192, 0.3);
}

.announcement-card.card-gold {
  box-shadow: 0 0 40px 6px rgba(255, 215, 0, 0.55), 0 0 80px rgba(255, 215, 0, 0.2), 0 0 0 1px rgba(255, 215, 0, 0.35);
}

@keyframes announcement-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes card-reveal {
  from {
    opacity: 0;
    transform: scale(0.7) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ── Card Flip Reveal ──────────────────────────────────────────── */

.action-card-flip {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 85;
  pointer-events: none;
  perspective: 600px;
}

.action-card-flip.hidden {
  display: none !important;
}

.flip-received-label {
  background: linear-gradient(180deg, rgba(20, 40, 20, 0.92) 0%, rgba(14, 30, 14, 0.95) 100%);
  border: 1px solid rgba(92, 230, 92, 0.3);
  border-radius: 4px;
  padding: 8px 24px;
  margin-bottom: 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #5ce65c;
  letter-spacing: 1px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  animation: announcement-bar-in 0.3s ease-out;
}
.flip-stolen-label {
  background: linear-gradient(180deg, rgba(40, 20, 20, 0.92) 0%, rgba(30, 14, 14, 0.95) 100%);
  border: 1px solid rgba(230, 92, 92, 0.3);
  border-radius: 4px;
  padding: 8px 24px;
  margin-bottom: 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #ff6666;
  letter-spacing: 1px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  animation: announcement-bar-in 0.3s ease-out;
}

.flip-inner {
  width: 340px;
  height: 500px;
  border-radius: 8px;
  overflow: hidden;
  background: #2a1f14;
  animation: action-card-flip-rotate 0.9s ease-out forwards;
}

.flip-inner .action-card {
  width: 340px;
  height: 500px;
  transform: none;
  will-change: auto;
  box-shadow: none;
}

.flip-inner .action-card .card-frame {
  height: 510px;
}

@keyframes action-card-flip-rotate {
  0% { transform: rotateX(90deg) scale(0.8); opacity: 0; }
  35% { transform: rotateX(-10deg) scale(1.03); opacity: 1; }
  65% { transform: rotateX(4deg) scale(1); }
  100% { transform: rotateX(0deg) scale(1); }
}

/* ── Dual Card Flip (wheel +2 Kards) ──────────────────────────── */

.action-card-flip.flip-dual .flip-cards-row {
  display: flex;
  gap: 24px;
  flex-direction: row;
}

.action-card-flip.flip-dual .flip-inner {
  width: 340px;
  height: 500px;
}

.action-card-flip.flip-dual .flip-inner .action-card {
  width: 340px;
  height: 500px;
}

.action-card-flip.flip-dual .flip-inner .action-card .card-frame {
  height: 510px;
}



