/* The Duraks profile window, copied 1:1 from games/duraks/public/style.css (same colours, sizes, labels),
   scoped under .dk so it can't clash with the front page's own styles. Opened from a village on the map.
   If the Duraks profile window's look changes, copy the matching rules here again. */
.dk {
  --felt-dark: #143a4d; --felt: #235d7a; --felt-light: #2a6a88; --gold: #c9a24b; --gold-bright: #e2c374; --cream: #faf6ec;
  --muted: #a9c6d4; --danger: #8f2d2d; --danger-bright: #b23a3a; --elo-onevone: #e8b84b; --elo-multi: #5ac8e0;
  --font-display: Georgia, 'Times New Roman', serif; --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-family: var(--font-ui); color: var(--cream); line-height: normal; font-size: 16px;
  scrollbar-width: thin; scrollbar-color: rgba(201, 162, 75, 0.45) transparent;
}
/* browser defaults the Duraks page relies on (the front page resets them) */
.dk h2 { font-size: 1.5em; margin: 0 0 0.83em; line-height: normal; }
.dk p { margin: 1em 0; }
.dk ::-webkit-scrollbar { width: 8px; height: 8px; }
.dk ::-webkit-scrollbar-track { background: transparent; }
.dk ::-webkit-scrollbar-thumb { background: rgba(201, 162, 75, 0.4); border-radius: 999px; }
.dk ::-webkit-scrollbar-thumb:hover { background: rgba(201, 162, 75, 0.65); }
.dk .btn { display: block; text-align: center; }

.dk .profile-stats-divider {
  margin: 14px 0 4px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-top: 1px solid rgba(201, 162, 75, 0.2);
  padding-top: 10px;
}
.dk .btn {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-ui);
  transition: transform 0.08s ease, filter 0.15s ease;
}
.dk .btn:hover { filter: brightness(1.08);
}
.dk .btn:active { transform: scale(0.98);
}
.dk .btn-secondary {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold-bright);
}
.dk .muted { color: var(--muted); font-size: 0.8rem;
}
.dk.dk-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.dk .modal-card {
  background: var(--felt-dark);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  width: min(320px, 90vw);
  max-width: 320px;
  overflow-x: hidden;
  box-sizing: border-box;
}
.dk .modal-card h2 {
  font-family: var(--font-display);
  color: var(--gold-bright);
  margin-top: 0;
}
.dk .modal-card-scrollable {
  max-height: 86vh;
  display: flex;
  flex-direction: column;
}
.dk .modal-card-scrollable .modal-scroll-body {
  overflow-y: auto;
  /* min-height: 0 overrides flex items' default min-height:auto, which
     would otherwise let this grow to fit its content and defeat the
     scrolling entirely. */
  min-height: 0;
  flex: 1 1 auto;
  /* Breathing room between the themed scrollbar track (see the global
     ::-webkit-scrollbar rules near the top of this file) and any
     right-aligned content, e.g. the <strong> stat values in
     .profile-stat-row, so the bar never visually overlaps the text. */
  padding-right: 8px;
}
.dk .modal-card-scrollable > .btn {
  flex-shrink: 0;
  margin-top: 16px;
}
.dk .muted.small { font-size: 0.72rem; margin-top: 10px;
}
.dk .btn-ghost-danger {
  background: transparent;
  border: 1px solid rgba(178, 58, 58, 0.6);
  color: #e08a7a;
}
.dk .btn-ghost-danger:hover { background: rgba(178, 58, 58, 0.15);
}
.dk .profile-stats {
  margin: 18px 0;
  text-align: left;
}
.dk .profile-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(201, 162, 75, 0.15);
  font-size: 0.9rem;
}
.dk .profile-stat-row span {
  min-width: 0;
  overflow-wrap: break-word;
}
.dk .profile-stat-row strong {
  flex-shrink: 0;
  white-space: nowrap;
}
.dk .profile-stat-row strong { color: var(--gold-bright);
}
.dk .profile-stat-row.muted-row {
  font-size: 0.78rem;
  color: var(--muted);
}
.dk .profile-stat-row.muted-row strong { color: var(--muted);
}
.dk .profile-history {
  margin: 18px 0;
  text-align: left;
}
.dk .profile-elo-chart {
  margin: 18px 0;
  text-align: left;
}
.dk .profile-elo-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 4px;
  border-top: 1px solid rgba(201, 162, 75, 0.2);
  padding-top: 10px;
}
.dk .profile-elo-chart-header .profile-elo-chart-divider {
  margin: 0;
  border-top: none;
  padding-top: 0;
}
.dk .elo-toggle-row {
  display: flex;
  gap: 12px;
}
.dk .elo-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.dk .elo-toggle input[type="checkbox"] {
  width: auto;
  margin: 0;
  cursor: pointer;
}
.dk .elo-swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 3px;
  flex-shrink: 0;
}
.dk .elo-swatch-oneVOne { background: var(--elo-onevone);
}
.dk .elo-swatch-multi { background: var(--elo-multi);
}
.dk .profile-elo-chart-svg {
  width: 100%;
  height: 90px;
  display: block;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
}
.dk .profile-elo-chart-labels {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}
.dk .profile-elo-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  flex: 1;
}
.dk .profile-elo-stat-label {
  overflow-wrap: break-word;
  text-align: center;
}
.dk .profile-elo-stat-value {
  font-weight: 700;
  font-size: 0.85rem;
  margin-top: 2px;
}
.dk .profile-elo-stat-low .profile-elo-stat-value { color: #c95c5c;
}
.dk .profile-elo-stat-high .profile-elo-stat-value { color: #4caf6d;
}
.dk .profile-elo-stat-current .profile-elo-stat-value { color: var(--gold-bright);
}
.dk .profile-elo-series-legend { margin-top: 10px;
}
.dk .profile-elo-series-legend-title {
  display: flex;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 600;
  margin: 0 0 3px;
}
.dk .profile-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}
.dk .profile-history-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  border-left: 3px solid var(--muted);
  font-size: 0.85rem;
  min-width: 0;
  cursor: help;
}
.dk .profile-history-row.profile-history-won { border-left-color: #4caf6d;
}
.dk .profile-history-row.profile-history-lost { border-left-color: #c95c5c;
}
.dk .profile-history-row.profile-history-placed { border-left-color: var(--gold-bright);
}
.dk .profile-history-row.profile-history-draw { border-left-color: var(--muted);
}
.dk .profile-history-outcome {
  font-weight: 600;
  overflow-wrap: break-word;
}
.dk .profile-history-meta {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: left;
  overflow-wrap: break-word;
}
