/* «Предложить игру» (suggest.html). Отдельным файлом: общий css/style.css
   от неё не тяжелеет. Цвета и радиусы — переменные оттуда. */

/* предупреждение «сервер не ответил» */
.sg-draft {
  border: 1px dashed var(--gold); border-radius: var(--r-md);
  background: rgba(232, 195, 74, 0.07); color: var(--ink);
  padding: 10px 14px; font-size: 13.5px; max-width: 76ch;
}
.sg-draft[hidden] { display: none; }

.sg-form, .sg-list {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-2);
  padding: 14px 16px 16px; max-width: 640px; width: 100%;
}
.sg-label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.sg-row { display: flex; gap: 8px; align-items: center; }
#suggestUrl {
  flex: 1; min-width: 0; font: inherit; font-size: 15px;
  padding: 10px 18px; color: var(--ink); background: var(--panel-2);
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  outline: none; caret-color: var(--accent);
}
#suggestUrl:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
#suggestUrl[aria-invalid="true"] { border-color: var(--red); }
#suggestUrl:disabled { opacity: 0.5; }
#suggestUrl::placeholder { color: var(--muted); }
#btnSuggest { padding: 10px 18px; font-size: 14px; }
#btnSuggest:disabled { opacity: 0.5; cursor: default; transform: none; }
.sg-error { color: var(--red); font-size: 13px; margin-top: 8px; }
.sg-error[hidden], .sg-list[hidden] { display: none; }
.sg-hint { color: var(--muted); font-size: 12.5px; margin-top: 8px; }

.sg-list-title { font-family: var(--font-display); font-size: 15px; font-weight: 800; margin-bottom: 10px; }
.sg-list-hint { margin: -4px 0 10px; }
.sg-items { list-style: none; display: grid; gap: 6px; padding: 0; margin: 0; }
.sg-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: var(--r-md);
}
.sg-item-name { font-weight: 700; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.sg-item-name:hover { color: var(--accent); }
.sg-item-votes { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
/* голос за кандидата: маленькая кнопка в строке списка */
.sg-vote {
  font: inherit; font-size: 12.5px; font-weight: 700; white-space: nowrap;
  padding: 4px 12px; color: var(--accent); background: transparent;
  border: 1px solid var(--accent); border-radius: var(--r-pill); cursor: pointer;
}
.sg-vote:hover { background: var(--accent-dim); }
.sg-vote:disabled { opacity: 0.5; cursor: default; }

/* статус кандидатов: кольцо голосов слева, легенда с числами справа.
   У каждого сектора подпись и число в легенде: цвет не единственный признак */
.sg-stats { display: flex; align-items: center; gap: 22px; }
.sg-donut { width: 140px; height: 140px; flex: none; overflow: visible; }
.sg-donut .sg-seg { fill: none; stroke: var(--st); stroke-width: 16; transition: stroke-width 0.15s; cursor: default; }
.sg-donut .sg-seg.on { stroke-width: 20; }
.sg-donut .sg-track { fill: none; stroke: var(--panel-2); stroke-width: 16; }
.sg-donut-num { fill: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 22px; }
.sg-donut-cap { fill: var(--muted); font-size: 9.5px; }
.sg-legend { list-style: none; display: grid; gap: 4px; padding: 0; margin: 0; flex: 1; min-width: 0; max-width: 320px; }
.sg-legend li {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: var(--r-sm); cursor: default;
}
.sg-legend li.on { background: var(--panel-2); }
.sg-legend-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--st); flex: none; }
.sg-legend-name { font-size: 14px; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.sg-legend-num { margin-left: auto; font-weight: 700; font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.sg-legend-pct { width: 4ch; text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
/* цвета кандидатов по месту в списке. Порядок — часть подбора: соседние
   секторы различимы и при дальтонизме, последний при любом числе секторов —
   с первым, двенадцатый и первый — с «Остальными»; любые два цвета не
   путаются при обычном зрении (проверено на фоне --panel). Менять — только
   проверив заново. */
.sg-c1 { --st: #3987e5; }
.sg-c2 { --st: #d95926; }
.sg-c3 { --st: #199e70; }
.sg-c4 { --st: #c98500; }
.sg-c5 { --st: #d55181; }
.sg-c6 { --st: #008300; }
.sg-c7 { --st: #9b4b66; }
.sg-c8 { --st: #706d06; }
.sg-c9 { --st: #73599e; }
.sg-c10 { --st: #a74a04; }
.sg-c11 { --st: #a950b2; }
.sg-c12 { --st: #829821; }
.sg-c-other { --st: #6e6474; }

@media (max-width: 560px) {
  .sg-stats { flex-direction: column; align-items: stretch; }
  .sg-donut { align-self: center; }
  .sg-row { flex-direction: column; align-items: stretch; }
  .sg-item { flex-wrap: wrap; }
}
