/* Lobby polish. Load after halloween-theme.css. No JS changes. */
body[data-role="host"] .lobby-players {
  grid-template-columns:repeat(8,minmax(0,1fr));
  gap:12px;
}
body[data-role="host"] .lobby-player {
  padding:16px 8px 13px;
  background:var(--panel);
  border-color:var(--border);
  /* Polling rebuilds roster nodes: do not replay entrance effects each time. */
  animation:none;
}
body[data-role="host"] .lobby-player .avatar {
  width:64px;
  height:64px;
  border-radius:20px;
}
body[data-role="host"] .lobby-player strong {
  display:block;
  margin-top:8px;
  font-size:13px;
  line-height:1.4;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
body[data-role="host"] .lobby-player small {
  display:block;
  margin-top:4px;
  font-size:11px;
  line-height:1.4;
}
body[data-role="host"] .lobby-roster-heading h2,
body[data-role="host"] #lobby-player-count {
  font-size:14px;
}
body[data-role="host"] #lobby-start-hint {
  font-size:13px;
  line-height:1.6;
  max-width:360px;
}
body[data-role="host"] .lobby-code { font-size:clamp(48px,5vw,76px); }
/* Roster remains readable on narrower host screens. */
@media(max-width:1100px) {
  body[data-role="host"] .lobby-players { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
@media(max-width:480px) {
  body[data-role="host"] .lobby-players { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  body[data-role="host"] .lobby-player .avatar { width:52px; height:52px; }
  body[data-role="host"] .lobby-player strong { font-size:12px; }
  body[data-role="host"] .lobby-player small { font-size:10px; }
}
/* Picker feedback only: free-avatar filtering remains a server task. */
.avatar-option[aria-pressed="true"] {
  border-color:var(--orange);
  background:rgba(255,153,94,.12);
  box-shadow:0 0 0 1px var(--orange);
}
@media(hover:hover) {
  .avatar-option:hover { transform:translateY(-2px); }
}
@media(hover:none) {
  .avatar-option:hover { transform:none; }
}
.avatar-option:active { transform:scale(.95); }
@media(prefers-reduced-motion:reduce) {
  .avatar-option:active, .avatar-option:hover { transform:none; }
}
html.motion-paused .avatar-option:active,
html.motion-paused .avatar-option:hover { transform:none; }

/* Слайдер выбора аватарки */
#avatar-picker.avatar-picker {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 50%;
  padding: 10px calc(50% - 44px) 14px;
  margin-inline: -4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}
#avatar-picker.avatar-picker::-webkit-scrollbar { display: none; }

#avatar-picker .avatar-option {
  flex: 0 0 88px;
  scroll-snap-align: center;
  padding: 4px;
  border-radius: 24px;
}
#avatar-picker .avatar-option .avatar {
  width: 80px;
  height: 80px;
  border-radius: 22px;
}
#avatar-picker .avatar-option[aria-pressed="true"] {
  transform: scale(1.08);
}

/* Экран ведущего на большом экране: служебный текст крупнее */
@media (min-width: 992px) {
  body[data-role="host"] .question-progress { font-size: 18px; }
  body[data-role="host"] .question-progress strong { font-size: 26px; }
  body[data-role="host"] #round-status { font-size: 18px; }
  body[data-role="host"] .category-label,
  body[data-role="host"] .card-number { font-size: 15px; }
  body[data-role="host"] .question-eyebrow { font-size: 13px; letter-spacing: .2em; }
  body[data-role="host"] .details-trigger,
  body[data-role="host"] .card-bottomline { font-size: 15px; }
  body[data-role="host"] #host-waiting-text { font-size: 17px; }

  body[data-role="host"] .sidebar-title h2 { font-size: 16px; }
  body[data-role="host"] .score-row .avatar { width: 46px; height: 46px; }
  body[data-role="host"] .score-player strong { font-size: 15px; }
  body[data-role="host"] .score-status { font-size: 12px; }
  body[data-role="host"] .score-value { font-size: 24px; }
  body[data-role="host"] .sidebar-note { font-size: 12px; }

  body[data-role="host"] .answer-panel p { font-size: 20px; line-height: 1.6; }
  body[data-role="host"] .answer-heading h2 { font-size: 32px; }
  body[data-role="host"] .host-comment p { font-size: 18px; }
}

/* В новой колоде нет источников — пустой блок «А это откуда?» скрываем */
#sources-details:has(#source-fact:empty):has(#source-links:empty) { display: none; }
