/* ==========================================================================
   Темы сайта. Все серые/красные цвета Minecraft-стиля вынесены в токены --c-XXXXXX
   (имя = цвет тёмной темы). Тёмная тема — значения по умолчанию, светлая —
   переопределение в html[data-theme="light"]. Переключается кнопкой в шапке /
   сайдбаре панели, выбор хранится в localStorage ("theme").
   ========================================================================== */
:root {
  --page-width: 1280px;
  color-scheme: dark;
  --c-000000: #000000;
  --c-101010: #101010;
  --c-111111: #111111;
  --c-161616: #161616;
  --c-1c1c1c: #1c1c1c;
  --c-1f1f1f: #1f1f1f;
  --c-232323: #232323;
  --c-262626: #262626;
  --c-2a1515: #2a1515;
  --c-2a2a2a: #2a2a2a;
  --c-2b2b2b: #2b2b2b;
  --c-2f2f2f: #2f2f2f;
  --c-363636: #363636;
  --c-3a1a1a: #3a1a1a;
  --c-3a3a3a: #3a3a3a;
  --c-3f1515: #3f1515;
  --c-3f3f3f: #3f3f3f;
  --c-484848: #484848;
  --c-4a1f1f: #4a1f1f;
  --c-4a4a4a: #4a4a4a;
  --c-555555: #555555;
  --c-5a2a2a: #5a2a2a;
  --c-5a5a5a: #5a5a5a;
  --c-6a6a6a: #6a6a6a;
  --c-6b1f1f: #6b1f1f;
  --c-6f6f6f: #6f6f6f;
  --c-888888: #888888;
  --c-8a8a8a: #8a8a8a;
  --c-aaaaaa: #aaaaaa;
  --c-b06a6a: #b06a6a;
  --c-d98a8a: #d98a8a;
  --c-d9d9d9: #d9d9d9;
  --c-ff5555: #ff5555;
  --c-ffffff: #ffffff;
}

html[data-theme="light"] {
  color-scheme: light;
  --c-000000: #2b2b2b;
  --c-101010: #f4f4f4;
  --c-111111: #f2f2f2;
  --c-161616: #7d7d7d;
  --c-1c1c1c: #e0e0e0;
  --c-1f1f1f: #a8a8a8;
  --c-232323: #d9d9d9;
  --c-262626: #b4b4b4;
  --c-2a1515: #efcaca;
  --c-2a2a2a: #dbdbdb;
  --c-2b2b2b: #c6c6c6;
  --c-2f2f2f: #bdbdbd;
  --c-363636: #d2d2d2;
  --c-3a1a1a: #e6bcbc;
  --c-3a3a3a: #cfcfcf;
  --c-3f1515: #e8c0c0;
  --c-3f3f3f: #e4e4e4;
  --c-484848: #dedede;
  --c-4a1f1f: #e4b5b5;
  --c-4a4a4a: #ffffff;
  --c-555555: #8a8a8a;
  --c-5a2a2a: #d8a0a0;
  --c-5a5a5a: #ffffff;
  --c-6a6a6a: #606060;
  --c-6b1f1f: #d99a9a;
  --c-6f6f6f: #5f5f5f;
  --c-888888: #5f5f5f;
  --c-8a8a8a: #5c5c5c;
  --c-aaaaaa: #3b3b3b;
  --c-b06a6a: #9a3a3a;
  --c-d98a8a: #a83a3a;
  --c-d9d9d9: #1a1a1a;
  --c-ff5555: #c22b2b;
  --c-ffffff: #111111;
}

/* ---------- Кнопка смены темы ---------- */
html body .theme-toggle, html body.tierlist-page .theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0; cursor: pointer; flex: none;
}
.theme-toggle svg { width: 22px; height: 22px; shape-rendering: crispEdges; fill: currentColor; }
.theme-toggle .ico-sun { display: none; }
html[data-theme="light"] .theme-toggle .ico-sun { display: block; }
html[data-theme="light"] .theme-toggle .ico-moon { display: none; }
html body .admin-sidebar .theme-toggle { width: 100%; height: 40px; gap: 10px; margin-bottom: 4px; }
.admin-sidebar .theme-toggle .theme-label::before { content: 'Светлая тема'; }
html[data-theme="light"] .admin-sidebar .theme-toggle .theme-label::before { content: 'Тёмная тема'; }

/* ---------- Мелочи светлой темы ---------- */
html[data-theme="light"] body.tierlist-page { text-shadow: 1px 1px 0 var(--c-2a2a2a); }
html[data-theme="light"] body.tierlist-page h1 { text-shadow: 2px 2px 0 var(--c-2a2a2a); }
html[data-theme="light"] .modal-backdrop { background: rgba(40,40,40,.55) !important; }
html[data-theme="light"] ::selection { background: #8fb4ff; color: #111; }

/* Поля ввода: в светлой теме белая «внешняя» грань фаски не видна на светлом фоне —
   рисуем тёмную рамку и тёмную внутреннюю тень */
html[data-theme="light"] body.tierlist-page input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="light"] body.tierlist-page select,
html[data-theme="light"] body.tierlist-page textarea,
html[data-theme="light"] body.tierlist-page .search-box input {
  background: #f7f7f7; color: var(--c-aaaaaa);
  box-shadow: inset 2px 2px 0 #7d7d7d, 0 0 0 2px #2b2b2b;
}
html[data-theme="light"] body.tierlist-page input:focus,
html[data-theme="light"] body.tierlist-page select:focus,
html[data-theme="light"] body.tierlist-page textarea:focus,
html[data-theme="light"] body.tierlist-page .search-box input:focus {
  box-shadow: inset 2px 2px 0 #7d7d7d, 0 0 0 2px #000;
}
html[data-theme="light"] input::placeholder, html[data-theme="light"] textarea::placeholder { color: #7a7a7a; }
