/* Popups: help, stats, end of round */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 40;
  animation: fade 0.15s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 24px 20px 20px;
  animation: rise 0.2s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.modal h2 {
  font-family: var(--font-pixel);
  font-size: 1.5rem;
  margin-bottom: 14px;
  text-align: center;
}
.modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 36px;
  height: 36px;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--color-muted);
  border-radius: 50%;
}
.modal-close:hover { color: var(--color-text); background: var(--color-surface-2); }

.help p { margin-bottom: 12px; }
.tier-list { list-style: none; margin: 4px 0 16px; display: grid; gap: 6px; }
.tier-list li { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; }
.tier-list b { color: var(--tier); }
.swatch { width: 14px; height: 14px; border-radius: 4px; background: var(--tier); flex: none; }

.share-grid { text-align: center; font-size: 1.6rem; letter-spacing: 0.1em; margin: 8px 0 16px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0; }
.stat { display: flex; flex-direction: column; align-items: center; text-align: center; }
.stat-value { font-family: var(--font-pixel); font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 0.72rem; color: var(--color-muted); }
.stats-title { text-align: center; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-muted); margin-top: 4px; }
.btn-wide + .btn-wide { margin-top: 8px; }
