: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%);
  --panel-shadow: 0 0 0 1px var(--gold-glow), 0 8px 32px rgba(0, 0, 0, 0.5);
  /* Shadows */
  --shadow-medium: rgba(0, 0, 0, 0.5);
  --shadow-light: rgba(0, 0, 0, 0.3);
  /* 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(100, 40, 40, 0.85), rgba(70, 28, 28, 0.92));
  --btn-negative-border: rgba(140, 60, 60, 0.55);
  --btn-negative-color: #d4b0b0;
  --btn-negative-hover-bg: linear-gradient(180deg, rgba(115, 50, 50, 0.92), rgba(85, 35, 35, 0.95));
  --btn-negative-hover-border: rgba(160, 70, 70, 0.65);
  --btn-negative-hover-color: #ffd0d0;
  --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 */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  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 {
  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: 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;
}

.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: 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;
}

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

/* Language flag toggle */
.lang-flag-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  background: none;
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 4px;
  font-size: 24px;
  height: 34px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  min-width: 42px;
  transition: border-color 0.2s, transform 0.15s;
  line-height: 1;
}
.lang-flag-btn:hover {
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.08);
}

.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: 36px 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: 10px;
  max-width: 380px;
  margin: 0 auto;
}

/* Staggered entry animation */
.lobby-menu .lobby-deco-divider,
.lobby-menu .lobby-action-card,
.lobby-menu .lobby-footer-ornament {
  animation: lobby-slide-in 0.4s ease-out both;
}

.lobby-menu .lobby-deco-divider:nth-child(1) { animation-delay: 0.1s; }
.lobby-menu .lobby-action-card:nth-child(2) { animation-delay: 0.15s; }
.lobby-menu .lobby-action-card:nth-child(3) { animation-delay: 0.2s; }
.lobby-menu .lobby-deco-divider:nth-child(4) { animation-delay: 0.25s; }
.lobby-menu .lobby-action-card:nth-child(5) { animation-delay: 0.3s; }
.lobby-menu .lobby-footer-ornament { animation-delay: 0.4s; }

@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-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
  opacity: 0.6;
}

.lobby-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lobby-section-label {
  font-size: 11px;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 8px;
  padding-left: 2px;
}
.lobby-section-label:first-child {
  margin-top: 0;
}

/* 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;
}

.lobby-deco-line {
  height: 1px;
  margin: 6px 0 10px;
  background: linear-gradient(90deg, transparent, #c9a84c 40%, #c9a84c 60%, transparent);
}

.lobby-footer-ornament {
  margin-top: 18px;
  font-size: 10px;
  color: #5a4a2a;
  letter-spacing: 8px;
}

.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;
}

.lobby-version {
  margin-top: 8px;
  font-size: 10px;
  color: #4a3e28;
  letter-spacing: 2px;
}

.lobby-action-card {
  background: var(--gold-bg);
  border: 1px solid var(--gold-border-light);
  border-radius: 4px;
  padding: 14px;
}

.lobby-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
  color: #5a5040;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.lobby-divider::before,
.lobby-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(90, 80, 64, 0.4);
}

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

.btn-lobby-create: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), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

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

.lobby-join-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.lobby-join-field {
  position: relative;
  flex: 1;
}

.lobby-join-field input {
  text-transform: uppercase;
  padding-left: 38px;
  margin-bottom: 0;
  letter-spacing: 6px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  font-size: 18px;
  border-style: dashed;
  border-color: #5a4a2a;
  color: var(--gold-text);
}

.lobby-join-field input::placeholder {
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  letter-spacing: 2px;
  font-weight: 400;
  color: #5a5040;
}

.lobby-join-field input:focus {
  border-color: var(--gold-text);
  border-style: solid;
}

.btn-lobby-join {
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid #5a4a2a;
  border-radius: 4px;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(50, 44, 30, 0.95), rgba(28, 24, 16, 0.97));
  color: var(--gold-text);
  transition: all 0.25s;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 1px;
}

.btn-lobby-join:hover {
  background: linear-gradient(180deg, rgba(70, 60, 40, 0.95), rgba(40, 35, 24, 0.97));
  border-color: var(--gold-text);
  color: #e8d5a0;
  transform: translateY(-1px);
}

/* Browse Games button */
.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: 12px;
  left: 64px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 10;
}

.auth-btn-login {
  height: 34px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 4px;
  cursor: pointer;
  background: var(--gold-bg-light);
  color: #8a7a5a;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}
.auth-btn-login:hover {
  background: rgba(201, 168, 76, 0.15);
  border-color: rgba(201, 168, 76, 0.5);
  color: var(--gold-text);
}

.auth-btn-logout {
  height: 34px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 1px solid var(--gold-border-light);
  border-radius: 4px;
  cursor: pointer;
  background: none;
  color: #6a6050;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}
.auth-btn-logout:hover {
  background: rgba(229, 115, 115, 0.1);
  border-color: rgba(229, 115, 115, 0.3);
  color: #e57373;
}

.auth-btn-profile {
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 16px;
  line-height: 34px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-bg-light);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 4px;
  cursor: pointer;
  color: var(--gold-text);
  transition: all 0.2s;
}
.auth-btn-profile:hover {
  background: rgba(201, 168, 76, 0.15);
  border-color: rgba(201, 168, 76, 0.4);
}
.auth-username {
  display: none;
}

/* ── 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;
}

.player-list-item {
  padding: 8px 12px;
  border: 1px solid;
  border-radius: 4px;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.5px;
}
.player-bot-badge { margin-right: 4px; }
.bot-remove-btn {
  background: none; border: none; color: #c9a84c; cursor: pointer;
  font-size: 18px; line-height: 1; padding: 0 4px; opacity: 0.6;
}
.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;
}

.btn-settings-toggle {
  font-size: 11px;
  color: #5a4a2a;
  background: none;
  border: 1px solid var(--gold-border-light);
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.2s;
}

.btn-settings-toggle:hover {
  color: #8a7a5a;
  border-color: rgba(201, 168, 76, 0.4);
}

.btn-settings-toggle.active {
  color: var(--gold-text);
  border-color: var(--gold-text);
  background: var(--gold-bg-hover);
}

.btn-settings-toggle:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn-reset-settings {
  font-size: 11px;
  color: #8a7a5a;
  background: none;
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  margin-left: auto;
}

.btn-reset-settings:hover {
  color: var(--gold-text);
  border-color: var(--gold-text);
}

.settings-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(201, 168, 76, 0.2);
  margin-bottom: 12px;
}

.settings-tab {
  flex: 1;
  padding: 10px 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #6a6050;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.settings-tab:hover {
  color: #b8a060;
}

.settings-tab.active {
  color: var(--gold-text);
  border-bottom-color: var(--gold-text);
  background: var(--gold-bg-hover);
}

.settings-tab-content {
  min-height: 200px;
}

.settings-tab-pane {
  display: none;
  animation: tab-fade-in 0.25s ease-out;
}

.settings-tab-pane.active {
  display: block;
}

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

.settings-section {
  background: rgba(201, 168, 76, 0.02);
  border: 1px solid rgba(201, 168, 76, 0.12);
  border-radius: 4px;
  overflow: hidden;
}

.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: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}


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

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

.setting-label {
  font-size: 12px;
  color: #ccc;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.setting-hint {
  font-size: 11px;
  color: #6a6050;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.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(58, 58, 58, 0.9) 0%, rgba(38, 38, 38, 0.92) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 4px;
  padding: 10px 15px 10px 18px;
  min-width: 175px;
  border: 1px solid var(--gold-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  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 {
  /* Match border to gradient top so no visible line appears around the card;
   * transparent leaves a 1px gap that the backdrop-blur shows through as a
   * faint outline. */
  border-color: rgb(82, 78, 65);
  background: linear-gradient(180deg, rgb(82, 78, 65) 0%, rgb(56, 52, 43) 100%);
  box-shadow: inset 0 0 16px rgba(232, 186, 60, 0.25), 0 4px 16px rgba(0, 0, 0, 0.3);
}

.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);
}

.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:hover {
  background: linear-gradient(180deg, rgba(50, 48, 40, 0.97) 0%, rgba(32, 30, 24, 0.98) 100%);
}

.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 {
  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: 8px 16px;
  cursor: pointer;
  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;
}

.btn-action: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);
}

.btn-action:active {
  transform: translateY(1px);
  background: rgba(180, 140, 40, 0.25);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

.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;
}

@keyframes btn-blink {
  0%, 100% {
    background: rgba(30, 28, 24, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
  50% {
    background: rgba(180, 140, 40, 0.35);
    border-color: rgba(212, 165, 38, 0.5);
    box-shadow: 0 2px 16px rgba(212, 165, 38, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
}
@keyframes btn-blink-urgent {
  0%, 100% {
    background: rgba(30, 28, 24, 0.6);
    border-color: rgba(255, 80, 80, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }
  50% {
    background: rgba(220, 50, 50, 0.4);
    border-color: rgba(255, 80, 80, 0.7);
    box-shadow: 0 2px 20px rgba(255, 50, 50, 0.4);
  }
}

#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: 1px solid var(--gold-border);
  border-radius: 4px;
  box-shadow: var(--panel-shadow);
  padding: 24px;
  z-index: 50;
  min-width: 300px;
  max-width: 500px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.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: 1px solid var(--gold-border);
  border-radius: 4px;
  box-shadow: var(--panel-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;
}

/* 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;
}

.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;
}

.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: 1px solid var(--gold-border);
  border-radius: 4px;
  box-shadow: var(--panel-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: 1px solid var(--gold-border);
  border-radius: 4px;
  box-shadow: var(--panel-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: 620px;
  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;
  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: 60vh;
}

.trade-side {
  flex: 1;
  background: var(--gold-bg);
  border: 1px solid var(--gold-border-light);
  border-radius: 4px;
  padding: 12px;
  max-height: 60vh;
  overflow-y: auto;
}

.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: 8px;
  padding: 12px 18px;
  border-top: 1px solid #5a5040;
  justify-content: flex-end;
}

.btn-trade-send {
  background: var(--btn-primary-bg);
  border: 1px solid var(--btn-primary-border);
  border-radius: 4px;
  color: var(--btn-primary-color);
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-trade-send:hover {
  background: var(--btn-primary-hover-bg);
  border-color: var(--btn-primary-hover-border);
  color: var(--btn-primary-hover-color);
}

.btn-trade-cancel {
  background: var(--btn-negative-bg);
  border: 1px solid var(--btn-negative-border);
  border-radius: 4px;
  color: var(--btn-negative-color);
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-trade-cancel:hover {
  background: var(--btn-negative-hover-bg);
  color: var(--btn-negative-hover-color);
}

/* Property mini cards (trade items) */
.prop-mini-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 10px;
  margin: 3px 0;
  border: 1px solid rgba(90, 80, 64, 0.2);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

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

.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 color groups */
.trade-prop-group {
  margin-bottom: 6px;
  border-radius: 4px;
  overflow: hidden;
}

.trade-prop-group-bar {
  height: 4px;
  border-radius: 4px 4px 0 0;
}

/* Trade money stepper */
.trade-money-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}

.trade-money-row input[type="number"] {
  flex: 1;
  min-width: 50px;
  width: 60px;
  text-align: center;
  margin: 0;
  font-size: 14px;
  background: rgba(42, 40, 34, 0.9);
  border: 1px solid #5a5040;
  color: #e8e0d0;
  border-radius: 4px;
  padding: 4px;
  -moz-appearance: textfield;
  appearance: textfield;
}

.trade-money-row input[type="number"]::-webkit-inner-spin-button,
.trade-money-row input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.trade-money-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.trade-step-btn {
  background: rgba(50, 48, 40, 0.9);
  border: 1px solid #5a5040;
  color: #d4cbb8;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.trade-step-btn:hover {
  background: rgba(70, 66, 56, 0.95);
  color: #fff;
  border-color: #7a7060;
}

/* 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;
}
.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: 1px solid transparent;
}
.trade-btn-accept {
  background: var(--btn-positive-bg);
  border-color: var(--btn-positive-border);
  color: var(--btn-positive-color);
}
.trade-btn-accept:hover {
  background: var(--btn-positive-hover-bg);
  border-color: var(--btn-positive-hover-border);
  color: var(--btn-positive-hover-color);
}
.trade-btn-counter {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-border);
  color: var(--btn-primary-color);
}
.trade-btn-counter:hover {
  background: var(--btn-primary-hover-bg);
  border-color: var(--btn-primary-hover-border);
  color: var(--btn-primary-hover-color);
}
.trade-btn-reject {
  background: var(--btn-negative-bg);
  border-color: var(--btn-negative-border);
  color: var(--btn-negative-color);
}
.trade-btn-reject:hover {
  background: var(--btn-negative-hover-bg);
  border-color: var(--btn-negative-hover-border);
  color: var(--btn-negative-hover-color);
}
/* ── Property Card (Title Deed) ── */

#property-card {
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
}

.property-card {
  min-width: 260px;
  max-width: 300px;
  padding: 0;
  border: 3px solid #c9a84c;
  border-radius: 4px;
  overflow: hidden;
  background: linear-gradient(rgba(255,255,255,0.3), rgba(255,255,255,0.3)), url('/tile-texture.webp') center / cover;
  color: #222;
  user-select: none;
}

.property-card h3 {
  color: #111;
  text-align: center;
  font-size: 17px;
  margin: 8px 16px 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.property-card .btn-action {
  display: block;
  width: calc(100% - 32px);
  margin: 8px 16px 14px;
  background: var(--btn-neutral-bg);
  color: var(--btn-neutral-color);
  border: 1px solid var(--btn-neutral-border);
  border-radius: 4px;
  padding: 6px;
  cursor: pointer;
  font-size: 13px;
}

.property-card .btn-action:hover {
  background: var(--btn-neutral-hover-bg);
  color: var(--btn-neutral-hover-color);
}

.property-card-header {
  height: 50px;
  margin: 0;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 2px solid #444;
}

.property-card-header .header-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.85);
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

#property-card-owner {
  text-align: center;
  font-size: 12px;
  padding: 6px 16px;
  font-weight: bold;
}

.pc-owner-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pc-owner-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid #444;
  flex-shrink: 0;
}

.pc-owner-name {
  color: #333;
}

.pc-mortgaged-tag {
  display: inline-block;
  background: #cc3333;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

.pc-unowned {
  color: #777;
  font-style: italic;
  font-weight: normal;
}

#property-card-details {
  font-size: 12px;
  padding: 0 16px;
}

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

.pc-rent-section {
  padding: 4px 0 2px;
}

#property-card-details .rent-line {
  display: flex;
  justify-content: space-between;
  padding: 3px 4px;
  border-bottom: 1px dotted #d5d0c0;
  font-size: 12px;
  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: 10px;
}

.pc-build-cost {
  display: flex;
  justify-content: space-between;
  padding: 5px 4px;
  font-size: 12px;
  color: #555;
  border-top: 1px dashed #bbb;
}

.pc-mortgage {
  display: flex;
  justify-content: space-between;
  padding: 5px 4px;
  font-size: 12px;
  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;
}

#property-card-details .mortgage-badge {
  text-align: center;
  color: #cc3333;
  font-weight: bold;
  font-size: 13px;
  padding: 6px 0 2px;
}

.pc-building-status {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #2a7a2a;
  padding: 4px 0 2px;
  border-top: 1px dashed #bbb;
}
/* ── 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.3);
  opacity: 0.45;
}
.prop-row-mortgaged .prop-row-value,
.prop-row-mortgaged .prop-row-buildings {
  opacity: 0.45;
}

.prop-group {
  border: 1px solid;
  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: 860px;
  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;
}

.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: 8px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.1);
  flex-wrap: wrap;
}

.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: 1px solid var(--gold-border-light);
  border-radius: 4px;
  overflow: hidden;
}

.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: 1px solid;
  white-space: nowrap;
  text-align: center;
  box-sizing: border-box;
  transition: all 0.15s ease;
  min-width: 80px;
}

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

.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);
}

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

.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: 860px;
  max-width: 90vw;
  user-select: none;
  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;
}

.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: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.1);
  transition: background 0.15s;
  flex-wrap: wrap;
}

.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: 1px solid var(--btn-positive-border);
  white-space: nowrap;
  transition: all 0.2s;
  background: var(--btn-positive-bg);
  color: var(--btn-positive-color);
  min-width: 90px;
  text-align: center;
}

.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: 1px solid var(--btn-negative-border);
  white-space: nowrap;
  transition: all 0.15s ease;
  background: var(--btn-negative-bg);
  color: var(--btn-negative-color);
  min-width: 90px;
  text-align: center;
}

.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);
}

.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;
}

.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-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;
}
.trade-notif-prop {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #e8e0d0;
  padding: 4px 6px;
}
.trade-notif-color {
  width: 5px;
  height: 18px;
  border-radius: 2px;
  flex-shrink: 0;
}
.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;
  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: 10px 16px 8px;
  min-width: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  font-weight: 500;
  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;
}

.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: 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);
}

.btn-sidebar-leave:hover {
  background: rgba(200, 45, 45, 0.4);
  border-color: rgba(220, 60, 60, 0.5);
  box-shadow: 0 2px 16px rgba(200, 50, 50, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#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: 1px solid var(--gold-border);
  border-radius: 4px;
  padding: 14px 18px;
  width: 460px;
  max-height: 80%;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  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 h3 {
    font-size: 12px;
    margin: 5px 10px 4px;
  }

  .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;
}

.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;
}

.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: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 4px;
  padding: 20px 24px;
  min-width: 240px;
  max-width: 500px;
  width: 90vw;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 0 0 1px rgba(201, 168, 76, 0.1), 0 8px 32px rgba(0, 0, 0, 0.5);
  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: 10px 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: 1px solid var(--btn-neutral-border, rgba(201, 168, 76, 0.25));
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  text-align: center;
}

.target-cancel:hover {
  background: rgba(100, 75, 35, 0.9);
}

/* ── 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;
}

.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;
}



/* ── Property Card Effect Badges ───────────────────────────────── */

.pc-effects {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 6px 0;
}

.pc-effect-badge {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 4px;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.pc-effect-double {
  background: rgba(40, 30, 5, 0.9);
  color: #fff;
  border: 1px solid rgba(255, 215, 0, 0.6);
}

.pc-effect-roadblock {
  background: rgba(50, 25, 5, 0.9);
  color: #fff;
  border: 1px solid rgba(255, 140, 50, 0.6);
}

.pc-effect-flatbonus {
  background: rgba(10, 40, 25, 0.9);
  color: #fff;
  border: 1px solid rgba(100, 220, 140, 0.6);
}
