:root {
  /* Основные фоны */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-row: #152033;
  --bg-row-hover: #1a2740;
  --bg-input: #0f172a;
  
  /* Текст */
  --text-primary: #f8fafc;
  --text-secondary: #f1f5f9;
  --text-muted: #94a3b8;
  --text-placeholder: #64748b;
  --text-comment: #64748b;
  
  /* Акцент */
  --accent: #9146FF;
  --accent-hover: #772ce8;
  --accent-light: #a78bfa;
  
  /* Границы */
  --border: #334155;
  --border-input: #475569;
  --border-row: #1e293b;
  
  /* Кнопки действий */
  --success: #22c55e;
  --success-hover: #16a34a;
  --warning: #f59e0b;
  --danger: #be123c;
  --danger-hover: #9f1239;
  
  /* Статус: Пройдена */
  --status-completed-border: #c0e5a0;
  --status-completed-text: #edf7d9;
  --status-completed-separator: #edf7d9;

  /* Статус: Дроп */
  --status-dropped-color: #fccccc;
--status-dropped-text: #fccccc;
--status-dropped-border: #fccccc;

/* Статус: В процессе */
--status-inprogress-color: #accfe3;
--status-inprogress-text: #accfe3;
--status-inprogress-border: #accfe3;

/* Статус: Отложено */
--status-postponed-color: #ffff99;
--status-postponed-text: #ffff99;
--status-postponed-border: #ffff99;

  /* Тени */
  --shadow-group: drop-shadow(2px 0 4px rgba(0, 0, 0, 0.3)) drop-shadow(-2px 0 4px rgba(0, 0, 0, 0.3));
--shadow-group-hover: drop-shadow(3px 0 8px rgba(145, 70, 255, 0.25)) drop-shadow(-3px 0 8px rgba(145, 70, 255, 0.25));
--shadow-group-completed-hover: drop-shadow(3px 0 8px rgba(192, 229, 160, 0.35)) drop-shadow(-3px 0 8px rgba(192, 229, 160, 0.35));--shadow-color: rgba(0, 0, 0, 0.3);
--shadow-group-dropped-hover: drop-shadow(3px 0 8px rgba(252, 204, 204, 0.4)) drop-shadow(-3px 0 8px rgba(252, 204, 204, 0.4));
--shadow-group-inprogress-hover: drop-shadow(3px 0 8px rgba(172, 207, 227, 0.4)) drop-shadow(-3px 0 8px rgba(172, 207, 227, 0.4));
--shadow-group-postponed-hover: drop-shadow(3px 0 8px rgba(255, 255, 153, 0.4)) drop-shadow(-3px 0 8px rgba(255, 255, 153, 0.4));
--shadow-color-box: rgba(0, 0, 0, 0.5);
--shadow-color-strong: rgba(0, 0, 0, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

body {
  background: var(--bg-primary);
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  padding: 0;
  min-height: 100vh;
}

/* Контейнер */
.content-wrapper {
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 2rem 2rem 2rem;
  flex: 1;
  animation: fadeInPage 0.6s ease forwards;
}

/* Анимации */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInPage {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeInTable {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; max-height: 0; transform: translateY(-15px); }
  to { opacity: 1; max-height: 600px; transform: translateY(0); }
}
@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-5px); }
}
@keyframes fadeOutData { from { opacity: 1; } to { opacity: 0; } }
@keyframes fadeInData { from { opacity: 0; } to { opacity: 1; } }

/* Шапка */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-secondary);
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px var(--shadow-color-box);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}
.site-header-left { display: flex; align-items: center; gap: 12px; }
.site-header-right { display: flex; align-items: center; gap: 12px; }
.site-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Кнопки */
.btn {
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-size: 0.9rem;
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn svg, .btn img, .btn span { vertical-align: middle; }
.btn-primary { background: var(--accent); color: white; border: 1px solid var(--accent-light); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-muted); border: 1px solid var(--border-input); }
.btn-secondary:hover { background: #475569; }
.btn-danger { background: transparent; border: 1px solid var(--danger); color: #fda4af; }
.btn-danger:hover { background: var(--danger); color: white; }
.btn-google { background: white; color: #1f2937; border: 1px solid #d1d5db; }
.btn-google:hover { background: #f3f4f6; }
.btn-small { padding: 6px 14px; font-size: 0.8rem; }

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-small,
#openAddGameModalBtn,
#shareBtnProfile,
#applyFilterBtn {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.5s ease;
}

/* Модальные окна */
.modal {
  position: fixed;
  top: 72px;
  left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: 1.5rem;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  border: 1px solid var(--border);
}
.modal-content h2 { margin-bottom: 1.5rem; color: var(--text-primary); }
.modal-content input {
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-input);
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.modal-content input:focus { outline: none; border-color: var(--accent); }
.modal-actions { display: flex; gap: 10px; margin-top: 1rem; justify-content: flex-end; }

#addGameModal {
  top: 0;
  align-items: center;
  justify-content: center;
}
#addGameModal .record-item input.record-url-input {
  height: 36px; line-height: 36px; padding: 0 8px; margin-bottom: 0;
  border-radius: 8px; font-size: 0.85rem;
}
#addGameModal .record-item select.record-platform-select {
  height: 36px; line-height: 36px; padding: 0 8px; margin-bottom: 0;
  border-radius: 8px; font-size: 0.85rem;
}

/* Панель добавления */
.add-panel {
  background: var(--bg-primary);
  border-radius: 1.5rem;
  padding: 1.8rem;
  margin-bottom: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-end;
  border: 1px solid var(--border);
}
#addPanel { display: none !important; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 160px; }
.field label {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px;
  font-weight: 600; color: var(--text-placeholder);
}
.field input, .field select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-input);
  padding: 12px 14px; border-radius: 14px;
  color: var(--text-secondary); font-size: 0.95rem; outline: none;
}
.field input:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(145,70,255,0.2);
}
.field input.error, .field select.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.2);
}
.autocomplete-wrapper { position: relative; flex: 2 1 300px; }
#gameSearch { width: 100%; }
.suggestions {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-input);
  border-radius: 0 0 16px 16px;
  max-height: 320px; overflow-y: auto; z-index: 50; display: none;
  box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}
.suggestion-item {
  padding: 12px 14px; cursor: pointer;
  border-bottom: 1px solid #2d3a4f;
  display: flex; align-items: center; gap: 12px; font-size: 0.9rem;
}
.suggestion-item:hover { background: var(--accent); color: white; }
.suggestion-cover {
  width: 40px; height: 48px; object-fit: cover;
  border-radius: 6px; background: var(--bg-tertiary); flex-shrink: 0;
}

/* Таблица */
.table-wrapper {
  display: none;
  width: 100%;
  overflow-x: visible;
  overflow-y: visible;
  padding: 0;
  margin: 0;
}
.table-wrapper.visible { display: block; }
table {
  border-spacing: 0 8px;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
  border-radius: 0;
  overflow: visible;
}
th {
  text-align: left;
  padding: 12px 12px 8px 12px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  border: none;
}
.cover-thumb {
  width: auto; height: 60px; max-width: 45px;
  object-fit: cover; border-radius: 8px; background: var(--bg-tertiary);
}
.badge { background: var(--bg-tertiary); padding: 4px 10px; border-radius: 20px; font-size: 0.7rem; font-weight: 600; }
.personal-rating { background: #fbbf24; color: black; font-weight: 700; padding: 4px 10px; border-radius: 30px; font-size: 0.8rem; }
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-placeholder);
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--border-input);
}

/* Строки */
.game-row {
  background: var(--bg-row);
  border: 1px solid var(--border-input);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  transition: background 0.5s ease, border-color 0.5s ease;
}

.game-comment-row {
  background: var(--bg-row);
  border-left: 1px solid var(--border-input);
  border-right: 1px solid var(--border-input);
  border-bottom: 1px solid var(--border-input);
  border-top: none;
  border-radius: 0 0 10px 10px;
  transition: background 0.5s ease, border-color 0.5s ease;
}

.game-row.status-completed td { color: var(--status-completed-text); }
.game-comment-row.status-completed {
  border-color: var(--status-completed-border);
}
.game-comment-row.status-completed td { 
  color: var(--status-completed-text); 
  border-color: var(--status-completed-border); 
  border-top-color: var(--status-completed-border);
}
.game-group-table .game-comment-row.status-completed td {
  border-top: 2px solid var(--status-completed-border);
}
.game-row td {
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 0.9rem;
  vertical-align: middle;
}
.game-row td:first-child {
  border-radius: 10px 0 0 0;
  padding-left: 14px;
}

.game-row td:last-child {
  border-radius: 0 10px 0 0;
  padding-right: 14px;
}

.game-row.editing {
  background: var(--bg-row);
  border: 1px solid var(--accent);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
}

.game-row.editing td {
  padding: 10px 12px 8px 12px;
  background: var(--bg-row);
  border-bottom: none;
}

.game-row.editing td:first-child {
  padding-left: 14px;
  border-radius: 10px 0 0 0;
}

.game-row.editing td:last-child {
  padding-right: 6px;
  border-radius: 0 10px 0 0;
}

.game-group-table .game-row.editing td:last-child {
  padding-right: 6px;
}

.game-row.editing input[type="text"],
.game-row.editing input[type="number"],
.game-row.editing input:not([type]) {
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 10px;
  color: #f1f5f9;
  padding: 8px 10px;
  font-size: 0.9rem;
  width: 100%;
  outline: none;
  box-sizing: border-box;
  height: 40px;
}

.game-row.editing input[type="number"] {
  height: 40px;
}

.game-row.editing input:focus,
.game-row.editing select:focus {
  border-color: #9146FF;
}

.game-row.editing .view-mode { animation: fadeOut 0.2s ease forwards; }
.game-row.editing .edit-title { width: 100% !important; box-sizing: border-box; }
.game-row.editing .edit-title-wrapper { width: 100%; }
.game-row.editing .game-title-cell-edit { width: auto; }

.game-comment-row.editing-comment {
  background: var(--bg-row);
  border-left: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  border-top: none;
  border-radius: 0 0 10px 10px;
}

.game-comment-row.editing-comment textarea {
  background: var(--bg-secondary);
  border: 1px solid #475569;
  border-radius: 10px;
  color: #f1f5f9;
  padding: 8px 10px;
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.4;
  width: 100%;
  outline: none;
  box-sizing: border-box;
  resize: vertical;
  min-height: 40px;
}

.game-comment-row.editing-comment textarea:focus {
  border-color: #9146FF;
}

.game-row.editing .edit-mode {
  animation: fadeInData 0.2s ease forwards;
}

.game-row.editing .view-mode {
  animation: fadeOutData 0.2s ease forwards;
}

.game-comment-row.editing-comment td {
  border-top: 1px solid transparent;
  background: var(--bg-row);
  border-radius: 0 0 10px 10px;
  padding: 8px 10px;
}

.game-comment-row td {
  padding: 8px 14px;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.8rem;
  border-bottom: none;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
  border-top: 2px solid var(--border-input);
  border-radius: 0 0 10px 10px;
  transition: border-color 0.2s ease, border-width 0.2s ease;
}

.edit-comment-textarea {
  background: var(--bg-primary); border: 1px solid var(--border-input);
  border-radius: 8px; color: var(--text-secondary); padding: 8px 10px;
  font-size: 0.85rem; width: 100%; outline: none; resize: vertical;
  min-height: 40px; line-height: 1.4;
}
.edit-comment-textarea:focus { border-color: var(--accent); }

/* Кнопки действий */
.action-buttons { display: flex; gap: 2px; align-items: center; }
.btn-save {
  background: var(--success); border: none; color: white;
  width: 28px; height: 28px; padding: 0; border-radius: 6px;
  cursor: pointer; font-size: 0.9rem; transition: 0.2s;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.btn-save:hover { background: var(--success-hover); }
.btn-cancel-edit {
  background: transparent; border: 1px solid var(--warning); color: #fbbf24;
  width: 28px; height: 28px; padding: 0; border-radius: 6px;
  cursor: pointer; font-size: 0.9rem; transition: 0.2s;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.btn-delete-row {
  background: transparent; border: 1px solid var(--danger); color: #fda4af;
  width: 28px; height: 28px; padding: 0; border-radius: 6px;
  cursor: pointer; font-size: 0.9rem; transition: 0.2s;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.btn-delete-row:hover { background: var(--danger); color: white; }

/* Модальное окно подтверждения */
.confirm-modal {
  display: none; position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7); z-index: 200;
  align-items: center; justify-content: center;
}
.confirm-modal.active { display: flex; }
.confirm-content {
  background: var(--bg-secondary); border-radius: 1.5rem; padding: 2rem;
  width: 90%; max-width: 420px; border: 1px solid var(--border); text-align: center;
}
.confirm-content h3 { color: var(--text-primary); margin-bottom: 0.5rem; font-size: 1.2rem; }
.confirm-content p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.95rem; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.btn-confirm-yes {
  background: var(--danger); color: white; border: none;
  padding: 10px 24px; border-radius: 10px; cursor: pointer; font-weight: 600;
}
.btn-confirm-yes:hover { background: var(--danger-hover); }
.btn-confirm-no {
  background: var(--bg-tertiary); color: var(--text-muted);
  border: 1px solid var(--border-input); padding: 10px 24px;
  border-radius: 10px; cursor: pointer; font-weight: 600;
}
.btn-confirm-no:hover { background: #475569; }

/* Глобальные подсказки */
.global-suggestions {
  position: fixed; background: var(--bg-secondary);
  border: 1px solid var(--border-input); border-radius: 12px;
  max-height: 300px; overflow-y: auto; z-index: 10000; display: none;
  box-shadow: 0 15px 40px rgba(0,0,0,0.95); min-width: 300px;
}
.global-suggestions .suggestion-item { padding: 10px 14px; }
.global-suggestions .suggestion-cover { width: 35px; height: 42px; }

/* Ручной поиск */
.manual-search-prompt {
  padding: 12px 14px; cursor: pointer; border-top: 1px solid #2d3a4f;
  color: var(--accent); font-size: 0.85rem; text-align: center; transition: background 0.2s;
}
.manual-search-prompt:hover { background: rgba(145, 70, 255, 0.1); }
.manual-search-form {
  padding: 12px 14px; display: flex; flex-direction: column;
  gap: 8px; border-top: 1px solid #2d3a4f;
}
.manual-search-form input {
  background: var(--bg-primary); border: 1px solid var(--border-input);
  border-radius: 8px; color: var(--text-secondary);
  padding: 8px 10px; font-size: 0.85rem; outline: none; width: 100%;
}
.manual-search-form input:focus { border-color: var(--accent); }
.manual-search-row { display: flex; gap: 8px; }
.manual-search-row input { flex: 1; }

/* Профиль */
.profile-info-block {
  background: var(--bg-primary); border-radius: 1.5rem; padding: 1.5rem;
  margin-bottom: 1.5rem; border: 1px solid var(--border);
  animation: fadeInDown 0.35s ease forwards; animation-delay: 0s;
  opacity: 0; animation-fill-mode: forwards;
  box-shadow: 0 2px 8px var(--shadow-color-box);
}
.profile-info-content { display: flex; align-items: flex-start; gap: 20px; position: relative; }
.profile-info-left { flex-shrink: 0; }
.profile-block-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  object-fit: cover; background: var(--bg-tertiary);
}
.profile-info-right { flex: 1; min-width: 0; }
.profile-info-right h3 { font-size: 1.3rem; color: var(--text-primary); margin-bottom: 0.5rem; }
.profile-details {
  display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 0.5rem;
  font-size: 0.85rem; color: var(--text-muted);
}
.profile-detail-item { display: flex; align-items: center; gap: 4px; }
.profile-detail-label { color: var(--text-placeholder); }
.profile-socials { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 0.5rem; }
.profile-social-link {
  display: flex; align-items: center; gap: 6px; color: var(--accent);
  text-decoration: none; font-size: 0.85rem; transition: color 0.2s;
}
.profile-social-link:hover { color: var(--accent-light); }
.social-icon {
  width: 18px; height: 18px; flex-shrink: 0; display: inline-flex;
  align-items: center; justify-content: center; border-radius: 4px;
  background: var(--bg-tertiary); padding: 2px;
}
.social-icon svg { width: 14px; height: 14px; fill: var(--text-muted); }
.profile-bio {
  color: var(--text-muted); font-size: 0.9rem; font-style: italic;
  line-height: 1.4; margin-top: 0.5rem;
}

/* Записи */
.record-item { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
#addGameModal .record-item select.record-platform-select,
.record-item select {
  padding: 0 28px 0 8px;
  line-height: 36px;
  height: 36px;
  box-sizing: border-box;
  background: var(--bg-secondary);
  border: 1px solid var(--border-input);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  outline: none;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%2364748b'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.record-item input { flex: 1; }
.record-item select:focus, .record-item input:focus { border-color: var(--accent); }
.record-item .btn-add-record, .record-item .btn-remove-record {
  height: 36px; width: 36px; line-height: 36px; padding: 0;
  box-sizing: border-box; display: inline-flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.btn-add-record, .btn-remove-record {
  background: var(--bg-tertiary); color: var(--text-muted);
  border: 1px solid var(--border-input); padding: 6px 10px;
  border-radius: 8px; cursor: pointer; font-size: 1rem;
}
.btn-add-record:hover { background: #475569; }
.btn-remove-record { background: transparent; border: 1px solid var(--danger); color: #fda4af; }
.btn-remove-record:hover { background: var(--danger); color: white; }
.record-link { color: var(--accent); text-decoration: none; font-size: 0.8rem; margin-right: 8px; cursor: pointer; }
.record-link:hover { text-decoration: underline; }

/* Чекбоксы */
.checkbox-field { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.checkbox-field input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }
.checkbox-field label { font-size: 0.9rem; color: var(--text-muted); cursor: pointer; }
.status-select {
  background: var(--bg-secondary); border: 1px solid var(--border-input);
  border-radius: 14px; color: var(--text-secondary);
  padding: 12px 14px; font-size: 0.95rem; outline: none; width: 100%;
}
.status-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(145,70,255,0.2); }
.status-select.error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(239,68,68,0.2); }
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-input);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
  vertical-align: middle;
}

input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 1px;
  width: 4px;
  height: 7px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

input[type="checkbox"]:hover {
  border-color: var(--accent);
}

input[type="checkbox"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#addGameModal .checkbox-inline input[type="checkbox"],
#gameDetailModal .checkbox-inline input[type="checkbox"],
.modal-content .checkbox-inline input[type="checkbox"],
.checkbox-inline input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

#viewToggleContainer input[type="checkbox"] {
  width: 20px;
  height: 20px;
}

/* HLTB */
.hltb-link { color: var(--accent); text-decoration: none; font-size: 0.9rem; margin-left: 4px; opacity: 0.7; transition: opacity 0.2s; }
.hltb-link:hover { opacity: 1; }

/* Новые строки */
.game-row.new-row { background: rgba(145, 70, 255, 0.1); transition: background 1s ease; }
.game-row.new-row.animation-complete { background: transparent; }

.game-row td,
.game-comment-row td {
  overflow: visible;
}

/* Адаптивность */
@media (max-width: 750px) {
  .content-wrapper { padding: 1rem; }
  .add-panel { flex-direction: column; }
  .site-header { flex-direction: column; align-items: flex-start; }
  .profile-info-content { flex-direction: column; align-items: center; text-align: center; }
  .profile-details, .profile-socials { justify-content: center; }
}

/* Таблица (размеры) */
#gamesTable thead th {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 5;
}

#gamesTable thead th:first-child,
.game-group-table th:first-child {
  padding-left: 14px;
}

#gamesTable thead th,
.game-group-table th {
  padding-top: 10px;
  padding-bottom: 10px;
}

#gamesTable {
  width: 100%;
  min-width: 100%;
  border-spacing: 0;
  overflow: visible;
}
#gamesTable thead tr {
  border-radius: 10px;
  margin-bottom: 4px;
  overflow: hidden;
  outline: 1px solid var(--bg-secondary);
  outline-offset: -1px;
}
#gamesTable thead tr th:first-child {
  border-radius: 10px 0 0 10px;
}
#gamesTable thead tr th:last-child {
  border-radius: 0 10px 10px 0;
}
#gamesTable thead { 
  position: sticky; top: 0; z-index: 10;
  filter: drop-shadow(0 2px 4px var(--shadow-color-box));
 }

 /* Фиксируем раскладку */
#gamesTable,
.game-group-table {
  table-layout: fixed;
}

/* Колонка 1 – Игра */
#gamesTable th:nth-child(1), #gamesTable td:nth-child(1),
.game-group-table th:nth-child(1), .game-group-table td:nth-child(1),
.game-row.editing td:nth-child(1) {
  width: 32%;
  min-width: 180px;
  text-align: left;
}

/* Колонка 2 – Год */
#gamesTable th:nth-child(2), #gamesTable td:nth-child(2),
.game-group-table th:nth-child(2), .game-group-table td:nth-child(2),
.game-row.editing td:nth-child(2) {
  width: 7%;
  text-align: center;
}

/* Колонка 3 – Платформа */
#gamesTable th:nth-child(3), #gamesTable td:nth-child(3),
.game-group-table th:nth-child(3), .game-group-table td:nth-child(3),
.game-row.editing td:nth-child(3) {
  width: 13%;
  text-align: center;
}

/* Колонка 4 – Жанр */
#gamesTable th:nth-child(4), #gamesTable td:nth-child(4),
.game-group-table th:nth-child(4), .game-group-table td:nth-child(4),
.game-row.editing td:nth-child(4) {
  width: 13%;
  text-align: center;
}

/* Колонка 5 – Рейтинг IGDB */
#gamesTable th:nth-child(5), #gamesTable td:nth-child(5),
.game-group-table th:nth-child(5), .game-group-table td:nth-child(5),
.game-row.editing td:nth-child(5) {
  width: 10%;
  text-align: center;
}

/* Колонка 6 – Часы */
#gamesTable th:nth-child(6), #gamesTable td:nth-child(6),
.game-group-table th:nth-child(6), .game-group-table td:nth-child(6),
.game-row.editing td:nth-child(6) {
  width: 8%;
  text-align: center;
}

/* Колонка 7 – Моя оценка */
#gamesTable th:nth-child(7), #gamesTable td:nth-child(7),
.game-group-table th:nth-child(7), .game-group-table td:nth-child(7),
.game-row.editing td:nth-child(7) {
  width: 10%;
  text-align: center;
}

/* Колонка 8 – Иконки */
#gamesTable th:nth-child(8), #gamesTable td:nth-child(8),
.game-group-table th:nth-child(8), .game-group-table td:nth-child(8),
.game-row.editing td:nth-child(8) {
  width: 7%;
  min-width: 130px;
  text-align: right;
  white-space: nowrap;
}

.game-row td:last-child {
  padding-right: 14px;
}

/* Мелкий паддинг у 8-й колонки в обычной таблице */
#gamesTable th:nth-child(8),
#gamesTable td:nth-child(8) {
  padding: 4px 4px;
}

.game-group-table.editing-group {
  filter: var(--shadow-group);
}

.game-group-table.editing-group.platinum-active::after {
  opacity: 0;
  animation: none;
}

.game-group-table.editing-group.platinum-active:hover::after {
  opacity: 0;
  animation: none;
}

.game-row.editing .records-and-actions {
  flex-wrap: nowrap;
}

/* Иконки записей в таблице */
.record-icon-link {
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px; transition: transform 0.2s, opacity 0.2s; flex-shrink: 0;
}
.record-icon-link:hover { transform: scale(1.2); opacity: 0.85; }
.records-and-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}
.records-and-actions > * { flex-shrink: 0; }
.game-title-cell-edit .edit-icon-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  padding: 2px 4px;
  margin-left: 6px;
  font-size: 1rem;
  line-height: 1;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  vertical-align: middle;
}

.game-detail-title-row .edit-icon-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  padding: 2px 6px;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: 4px;
  opacity: 0.8;
  cursor: pointer;
  transition: opacity 0.15s, color 0.15s;
}

.game-detail-title-row .edit-icon-inline:hover {
  color: var(--accent);
  background: none;
  opacity: 1;
}

.game-row:hover .game-title-cell-edit .edit-icon-inline {
  opacity: 1;
}
.game-row:hover .game-title-cell-edit .edit-icon-inline:hover {
  color: var(--accent);
  background: none;
}
.game-row.editing .records-and-actions .records-container-inline { display: none; }
.game-row.editing .game-title-cell-edit .edit-icon-inline {
  display: none;
}
.game-row.editing .record-icon-link { display: none !important; }
.records-container-inline { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }

/* Плитки */
.games-grid { display: none; grid-template-columns: repeat(5, 1fr); gap: 16px; padding: 0; }
.games-grid.visible { display: grid; }
@media (max-width: 1400px) { .games-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1100px) { .games-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 750px) { .games-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .games-grid { grid-template-columns: 1fr; } }
.table-wrapper.grid-hidden { display: none !important; }
.game-card {
  position: relative; aspect-ratio: 3/4; border-radius: 16px; overflow: hidden;
  cursor: pointer; border: 1px solid var(--border);
  animation: fadeIn 0.3s ease forwards; background: var(--bg-primary);
  box-shadow: 0 2px 8px var(--shadow-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.game-card:hover { box-shadow: 0 12px 32px rgba(0,0,0,0.4); border-color: var(--accent); }
.game-card-cover { width: 100%; height: 100%; object-fit: cover; transition: all 0.4s ease; }
.game-card-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0); display: flex; align-items: center; justify-content: center;
  transition: all 0.3s ease; padding: 12px; text-align: center;
}
.game-card:hover .game-card-overlay { background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); }
.game-card-title-overlay {
  color: white; font-weight: 700; font-size: 1rem; opacity: 0;
  transform: translateY(10px); transition: all 0.3s ease;
  word-break: break-word; text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.game-card:hover .game-card-title-overlay { opacity: 1; transform: translateY(0); }

.game-card.status-completed:hover { border-color: var(--status-completed-border); }
.game-card.status-dropped:hover { border-color: var(--status-dropped-border); }
.game-card.status-in_progress:hover { border-color: var(--status-inprogress-border); }
.game-card.status-postponed:hover { border-color: var(--status-postponed-border); }

@keyframes platinumBorderSmooth {
  0%   { border-color: rgba(255, 150, 150, 0.8); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }
  25%  { border-color: rgba(255, 220, 150, 0.8); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }
  50%  { border-color: rgba(150, 255, 150, 0.8); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }
  75%  { border-color: rgba(150, 200, 255, 0.8); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }
  100% { border-color: rgba(255, 150, 150, 0.8); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }
}

.game-card.platinum-active {
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow-color);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  animation: fadeIn 0.3s ease forwards;
}

.game-card.platinum-active:hover {
  animation: platinumBorderSmooth 3s linear infinite;
  border-width: 1px;
}

.game-card.platinum-active:not(:hover) {
  border-color: var(--border);
  box-shadow: 0 2px 8px var(--shadow-color);
}

/* Модальное окно игры */
.game-detail-modal {
  display: none; position: fixed; top: 72px; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8); z-index: 300; align-items: center; justify-content: center; padding: 20px;
}
.game-detail-modal.active { display: flex; }
.game-detail-content {
  background: var(--bg-secondary); border-radius: 20px; padding: 40px;
  width: 90%; max-width: 800px; max-height: calc(100vh - 140px); overflow-y: auto;
  border: 1px solid var(--border); position: relative;
  animation: fadeInDown 0.3s ease forwards; display: flex; gap: 24px;
}
.game-detail-close {
  position: absolute; top: 16px; right: 16px; width: 32px; height: 32px;
  border-radius: 8px; border: 1px solid var(--border-input); background: var(--bg-secondary);
  color: var(--text-muted); cursor: pointer; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s; z-index: 10;
}
.game-detail-close:hover { background: var(--danger); border-color: var(--danger); color: white; }
.game-detail-left { flex-shrink: 0; }
.game-detail-cover { 
  width: 200px; 
  height: auto; 
  border-radius: 12px; 
  object-fit: cover; 
  background: var(--bg-tertiary); 
  box-shadow: 0 2px 8px var(--shadow-color-box);
}
.game-detail-right { flex: 1; min-width: 0; }
.game-detail-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.game-detail-title { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); word-break: break-word; }
.game-detail-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.game-detail-badge { background: var(--bg-tertiary); padding: 4px 10px; border-radius: 16px; font-size: 0.8rem; color: var(--text-muted); }
.game-detail-info { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; margin-bottom: 8px; }
.game-detail-comment { color: var(--text-muted); font-style: italic; font-size: 0.9rem; line-height: 1.5; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.game-detail-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
@media (max-width: 650px) {
  .game-detail-content { flex-direction: column; padding: 20px; }
  .game-detail-cover { width: 120px; }
}

.platinum-icon-inline {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  margin-right: 2px;
}

.game-card-title-overlay .platinum-icon-inline {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 2px;
}

/* Переключатель режима */
.view-toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
  }
.view-toggle-label { font-size: 0.85rem; color: var(--text-muted); user-select: none; }
.view-switch { position: relative; display: inline-block; width: 48px; height: 26px; cursor: pointer; }
.view-switch input { opacity: 0; width: 0; height: 0; }
.view-slider { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: var(--bg-tertiary); border-radius: 26px; transition: 0.3s; border: 1px solid var(--border-input); }
.view-slider:before { content: ""; position: absolute; height: 20px; width: 20px; left: 2px; bottom: 2px; background: var(--text-muted); border-radius: 50%; transition: 0.3s; }
.view-switch input:checked + .view-slider { background: var(--accent); border-color: var(--accent-light); }
.view-switch input:checked + .view-slider:before { transform: translateX(22px); background: white; }
.controls-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    visibility: hidden;
}

  .controls-row #openAddGameModalBtn {
    display: none;
    height: 38px;
    line-height: 38px;
    padding-top: 0;
    padding-bottom: 0;
    box-sizing: border-box;
}
  
  .controls-row.owner #openAddGameModalBtn {
    display: flex;
  }

  .controls-row.visible {
    visibility: visible;
    animation: fadeInDown 0.4s ease forwards;
}

/* Чекбоксы */
.checkbox-inline { 
  display: inline-flex; 
  align-items: center; 
  gap: 6px; 
  cursor: pointer; 
  font-size: 0.9rem; 
  color: var(--text-muted); 
  white-space: nowrap; 
  user-select: none;
}
.checkbox-inline input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.checkbox-inline span { line-height: 1; }

.checkbox-inline input[type="checkbox"] {
  position: relative;
  z-index: 1;
  cursor: pointer;
  pointer-events: auto;
  width: 16px;
  height: 16px;
}

.checkbox-inline span {
  pointer-events: none;
}

/* Модальное окно добавления */
.modal-close-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border-input);
  background: var(--bg-secondary); color: var(--text-muted); cursor: pointer;
  font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.modal-close-btn:hover { background: var(--danger); border-color: var(--danger); color: white; }
#addGameModal .field input, #addGameModal .field select, #addGameModal .field textarea {
  height: 40px; padding: 8px 10px; box-sizing: border-box; line-height: 1.4;
}
#addGameModal .field textarea { height: auto; min-height: 40px; resize: vertical; }
#addGameModal input[type="number"] { 
  background: var(--bg-secondary);
  color: var(--text-secondary);
}
.modal-add-game-content { max-width: 600px; max-height: calc(100vh - 80px); overflow-y: auto; padding: 1.2rem; }
.modal-add-game-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; }
.modal-add-game-header h2 { margin: 0; font-size: 1.3rem; color: var(--text-primary); }
.modal-field { margin-bottom: 0.6rem; }
.modal-field-full { width: 100%; }
.modal-field input,
.modal-field select,
.modal-field textarea {
  background: var(--bg-secondary);
  height: 40px;
  padding: 8px 10px;
  box-sizing: border-box;
  line-height: 1.4;
  border-radius: 10px; 
}
.modal-field textarea { height: auto; min-height: 40px; resize: vertical; }
.modal-field-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 0.6rem; }
.modal-field-row .field { flex: 1; min-width: 120px; margin-bottom: 0; }
.modal-checkboxes { display: flex; align-items: center; gap: 24px; margin-bottom: 0.8rem; flex-wrap: wrap; }
.modal-add-game-actions { display: flex; gap: 8px; margin-top: 0.6rem; }
.edit-detail-comment {
  width: 100%; background: var(--bg-primary); border: 1px solid var(--border-input);
  border-radius: 10px; color: var(--text-secondary); padding: 8px 10px;
  min-height: 40px; resize: vertical; font-family: inherit;
  font-size: 0.95rem; line-height: 1.4; box-sizing: border-box;
}

#addGameModal select,
#addGameModal input[type="number"],
#addGameModal input[type="text"],
.modal-field input,
.modal-field select,
.modal-field textarea {
  background: var(--bg-secondary);
}

/* Числовые поля */
input[type="number"] { 
  background: var(--bg-secondary); 
  color: var(--text-secondary); 
}
#modalGameTime, #modalGameRating, .edit-detail-time, .edit-detail-rating {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  -webkit-appearance: none;
  -moz-appearance: textfield;
  appearance: none;
}

/* Поля записей */
.record-url-input { flex: 1; height: 36px; padding: 6px 8px; box-sizing: border-box; line-height: 1.4; background: var(--bg-secondary); border: 1px solid var(--border-input); border-radius: 8px; color: var(--text-secondary); font-size: 0.85rem; outline: none; }
.record-url-input:focus { border-color: var(--accent); }
.record-platform-select { height: 36px; padding: 6px 8px; box-sizing: border-box; line-height: 1.4; background: var(--bg-secondary); border: 1px solid var(--border-input); border-radius: 8px; color: var(--text-secondary); font-size: 0.85rem; outline: none; flex-shrink: 0; }
.record-platform-select:focus { border-color: var(--accent); }
#modalRecordsContainer { display: flex; flex-direction: column; gap: 6px; margin-bottom: 0.6rem; }

#addGameModal .record-url-input,
#modalRecordsContainer .record-url-input {
  background: var(--bg-secondary);
}

/* Автозаполнение */
#searchInput:-webkit-autofill,
#searchInput:-webkit-autofill:hover,
#searchInput:-webkit-autofill:focus,
#headerSearchInput:-webkit-autofill,
#headerSearchInput:-webkit-autofill:hover,
#headerSearchInput:-webkit-autofill:focus,
.edit-rating:-webkit-autofill,
.edit-rating:-webkit-autofill:hover,
.edit-rating:-webkit-autofill:focus,
#gameRating:-webkit-autofill,
#gameRating:-webkit-autofill:hover,
#gameRating:-webkit-autofill:focus,
#modalGameTime:-webkit-autofill,
#modalGameTime:-webkit-autofill:hover,
#modalGameTime:-webkit-autofill:focus,
#modalGameRating:-webkit-autofill,
#modalGameRating:-webkit-autofill:hover,
#modalGameRating:-webkit-autofill:focus,
.edit-detail-time:-webkit-autofill,
.edit-detail-rating:-webkit-autofill,
#addGameModal input[type="number"]:-webkit-autofill {
  background-color: var(--bg-secondary);
  -webkit-box-shadow: 0 0 0 30px var(--bg-secondary) inset !important;
  -webkit-text-fill-color: var(--text-secondary) !important;
  transition: background-color 5000s ease-in-out 0s;
}
.record-url-input:-webkit-autofill, .record-url-input:-webkit-autofill:hover, .record-url-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 30px var(--bg-secondary) inset !important;
  -webkit-text-fill-color: var(--text-secondary) !important;
  transition: background-color 5000s ease-in-out 0s;
}
#addGameModal input:-webkit-autofill, #addGameModal input:-webkit-autofill:hover, #addGameModal input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 30px var(--bg-secondary) inset !important;
  -webkit-text-fill-color: var(--text-secondary) !important;
  transition: background-color 5000s ease-in-out 0s;
}

.social-icon.telegram { background: #0088cc; }
  .social-icon.telegram svg { fill: white; }
  .social-icon.discord { background: #5865F2; }
  .social-icon.discord svg { fill: white; }
  .social-icon.vk { background: #0077FF; }
  .social-icon.vk svg { fill: white; }
  .social-icon.twitch { background: #9146FF; }
  .social-icon.twitch svg { fill: white; }
  .social-icon.youtube { background: #FF0000; }
  .social-icon.youtube svg { fill: white; }
  .social-icon.goodgame { background: #1a1a1a; }
  .social-icon.goodgame svg { fill: #FFC107; }
  .social-icon.other { background: var(--bg-tertiary); }
  .social-icon.other svg { fill: var(--text-muted); }
  
  .sort-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .custom-multiselect {
    position: relative;
    min-width: 180px;
  }
  
  .multiselect-trigger {
  background: var(--bg-secondary);
  border: 1px solid var(--border-input);
  border-radius: 10px;
  color: var(--text-secondary);
  padding: 8px 32px 8px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%2364748b'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
  
  .multiselect-trigger:hover {
    border-color: var(--accent);
    transition: all 0.5s ease;
  }
  
  .multiselect-trigger::after {
  display: none;
}
  
  .multiselect-dropdown {
  position: fixed;
  background: var(--bg-secondary);
  border: 1px solid var(--border-input);
  border-radius: 10px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 9999;
  display: none;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  min-width: 180px;
  padding: 4px;
}
  
  .multiselect-dropdown.open {
    display: block !important;
  }

  .multiselect-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all 0.15s;
  border-radius: 6px;
  margin: 2px 4px;
  position: relative;
}
  
  .multiselect-option:hover {
  background: rgba(145, 70, 255, 0.15);
}
  
  .multiselect-option input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: auto;
  width: auto;
  height: auto;
  background: none;
  border: none;
  position: absolute;
  opacity: 0;
}

.checkbox-inline input[type="checkbox"],
.modal-content input[type="checkbox"] {
  padding: 0;
}
  
  .multiselect-option.selected {
    color: var(--accent);
    background: rgba(145, 70, 255, 0.15);
  }

  .multiselect-option::before {
  display: none;
  content: none;
}

.multiselect-option.selected::before {
  display: none;
  content: none;
}

select,
.custom-select-trigger,
.multiselect-trigger {
  background: var(--bg-secondary);
  border: 1px solid var(--border-input);
  border-radius: 10px;
  color: var(--text-secondary);
  padding: 8px 32px 8px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%2364748b'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  box-sizing: border-box;
  height: 38px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

select:hover,
.custom-select-trigger:hover,
.multiselect-trigger:hover {
  border-color: var(--accent);
  transition: all 0.5s ease;
}

select:focus,
.custom-select-trigger:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(145, 70, 255, 0.2);
  outline: none;
}

.custom-select-wrapper {
  position: relative;
  min-width: 160px;
}

.custom-select-trigger {
  height: 38px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--bg-secondary);
  border: 1px solid var(--border-input);
  border-radius: 10px;
  color: var(--text-secondary);
  padding: 8px 32px 8px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  min-height: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%2364748b'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  transition: border-color 0.2s;
}

.custom-select-trigger:hover {
  border-color: var(--accent);
}

.custom-select-dropdown {
  position: fixed;
  background: var(--bg-secondary);
  border: 1px solid var(--border-input);
  border-radius: 10px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 99999;
  display: none;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  min-width: 180px;
  padding: 4px;
}

.custom-select-dropdown.open {
  display: block;
}

.custom-select-option {
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-radius: 6px;
  transition: all 0.15s;
}

.custom-select-option:hover {
  background: rgba(145, 70, 255, 0.15);
  color: var(--text-primary);
}

.custom-select-option.selected {
  color: var(--accent);
  background: rgba(145, 70, 255, 0.15);
}
  
  .sort-clear-btn {
    height: 38px;
    width: 38px;
    box-sizing: border-box;
    border-radius: 6px;
    border: 1px solid var(--danger);
    background: transparent;
    color: #fda4af;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  
  .sort-clear-btn:hover {
    background: var(--danger);
    color: white;
    transition: all 0.5s ease;
  }

.add-panel select {
  height: 44px;
  border-radius: 14px;
  padding: 12px 36px 12px 14px;
}

/* Все селекты в режиме редактирования */
.game-row.editing select,
.game-comment-row.editing-comment select,
.game-detail-content select,
.modal-content select,
#addGameModal select {
  background: var(--bg-secondary);
  border: 1px solid #475569;
  border-radius: 10px;
  color: #f1f5f9;
  padding: 8px 32px 8px 12px;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%2364748b'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  box-sizing: border-box;
  height: 40px;
}

.game-row.editing select:hover,
.game-comment-row.editing-comment select:hover,
.game-detail-content select:hover,
.modal-content select:hover {
  border-color: var(--accent);
}

.game-row.editing select:focus,
.game-comment-row.editing-comment select:focus,
.game-detail-content select:focus,
.modal-content select:focus {
  border-color: var(--accent);
}

.edit-platform-select {
  width: 100% !important;
}

select option {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 10px 14px;
  font-size: 0.85rem;
  border: none;
}

select option:hover,
select option:checked,
select option:focus {
  background: rgba(145, 70, 255, 0.2) !important;
}

#applyFilterBtn {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 1px solid var(--border-input);
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    height: 38px;
    box-sizing: border-box;
  }
  
  #applyFilterBtn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent-light);
  }
  
  #applyFilterBtn.active:hover {
    background: var(--accent-hover);
    transition: all 0.5s ease;
  }

  .game-row.cascade-hidden,
.game-comment-row.cascade-hidden {
  opacity: 0 !important;
}

.game-detail-content .form-group {
  margin-bottom: 0.8rem;
}

.game-detail-content .form-group label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 4px;
}

.game-detail-content .form-group input,
.game-detail-content .form-group select,
.game-detail-content .form-group textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid #475569;
  border-radius: 8px;
  color: #f1f5f9;
  padding: 8px 10px;
  font-size: 0.9rem;
  outline: none;
  box-sizing: border-box;
}

.game-detail-content .form-group input:focus,
.game-detail-content .form-group select:focus,
.game-detail-content .form-group textarea:focus {
  border-color: #9146FF;
}

.game-detail-content .form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.game-detail-edit-form {
  width: 100%;
}

.game-detail-edit-form .modal-add-game-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.custom-select-dropdown::-webkit-scrollbar,
.multiselect-dropdown::-webkit-scrollbar,
.game-comment-row.editing-comment textarea::-webkit-scrollbar,
.suggestions::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
.modal-import-content::-webkit-scrollbar,
#importReview::-webkit-scrollbar,
.game-detail-content::-webkit-scrollbar {
  width: 5px;
}

.custom-select-dropdown::-webkit-scrollbar-track,
.multiselect-dropdown::-webkit-scrollbar-track,
.game-comment-row.editing-comment textarea::-webkit-scrollbar-track,
.suggestions::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track,
.modal-import-content::-webkit-scrollbar-track,
#importReview::-webkit-scrollbar-track,
.game-detail-content::-webkit-scrollbar-track {
  background: transparent;
}

.custom-select-dropdown::-webkit-scrollbar-thumb,
.multiselect-dropdown::-webkit-scrollbar-thumb,
.game-comment-row.editing-comment textarea::-webkit-scrollbar-thumb,
.suggestions::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb,
.modal-import-content::-webkit-scrollbar-thumb,
#importReview::-webkit-scrollbar-thumb,
.game-detail-content::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
  min-height: 30px;
}

.custom-select-dropdown::-webkit-scrollbar-thumb:hover,
.multiselect-dropdown::-webkit-scrollbar-thumb:hover,
.game-comment-row.editing-comment textarea::-webkit-scrollbar-thumb:hover,
.suggestions::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover,
.modal-import-content::-webkit-scrollbar-thumb:hover,
#importReview::-webkit-scrollbar-thumb:hover,
.game-detail-content::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}

/* Firefox */
.custom-select-dropdown,
.multiselect-dropdown,
.game-comment-row.editing-comment textarea,
.suggestions,
.modal-content,
.modal-import-content,
#importReview,
.game-detail-content {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.game-comment-row.editing-comment textarea.edit-comment-textarea::-webkit-scrollbar {
  width: 5px;
}
.game-comment-row.editing-comment textarea.edit-comment-textarea::-webkit-scrollbar-track {
  background: transparent;
}
.game-comment-row.editing-comment textarea.edit-comment-textarea::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}
.game-comment-row.editing-comment textarea.edit-comment-textarea {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

textarea.edit-detail-comment {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

textarea.edit-detail-comment::-webkit-scrollbar {
  width: 5px;
}
textarea.edit-detail-comment::-webkit-scrollbar-track {
  background: transparent;
}
textarea.edit-detail-comment::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}

.game-detail-content,
.modal-content,
.confirm-content {
  box-shadow: 0 4px 16px var(--shadow-color-strong);
}

#tableBody {
  display: block;
  width: 100%;
}

.game-group-table {
  display: table;
  width: 100%;
  border-spacing: 0;
  margin-bottom: 8px;
  filter: var(--shadow-group);
  transition: filter 0.5s ease;
  outline: 1px solid var(--bg-row);
  outline-offset: -1px;  
  border-radius: 10px;
}

.game-group-table:first-child {
  margin-top: 8px;
}

.game-group-table:hover {
  filter: var(--shadow-group-hover);
}

.game-group-table:hover .game-row,
.game-group-table:hover .game-comment-row {
  background: var(--bg-row-hover);
  border-color: var(--accent);
}

.game-group-table.editing-group.status-completed-group:hover,
.game-group-table.editing-group.status-dropped-group:hover,
.game-group-table.editing-group.status-in_progress-group:hover,
.game-group-table.editing-group.status-postponed-group:hover,
.game-group-table.editing-group.platinum-active:hover {
  filter: var(--shadow-group);
  animation: none;
}

.game-group-table.editing-group.status-completed-group:hover .game-row,
.game-group-table.editing-group.status-completed-group:hover .game-comment-row,
.game-group-table.editing-group.status-dropped-group:hover .game-row,
.game-group-table.editing-group.status-dropped-group:hover .game-comment-row,
.game-group-table.editing-group.status-in_progress-group:hover .game-row,
.game-group-table.editing-group.status-in_progress-group:hover .game-comment-row,
.game-group-table.editing-group.status-postponed-group:hover .game-row,
.game-group-table.editing-group.status-postponed-group:hover .game-comment-row {
  border-color: var(--accent);
}

.game-group-table.status-completed-group:hover {
  filter: var(--shadow-group-completed-hover);
}

.game-group-table.status-completed-group:hover .game-row,
.game-group-table.status-completed-group:hover .game-comment-row {
  border-color: var(--status-completed-border);
}

.game-detail-content .custom-select-trigger,
.modal-content .custom-select-trigger,
#addGameModal .custom-select-trigger {
  background: var(--bg-secondary);
  border: 1px solid #475569;
  border-radius: 10px;
  color: #f1f5f9;
  padding: 8px 32px 8px 10px;
  font-size: 0.9rem;
  height: 40px;
  min-height: 40px;
  line-height: 40px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-detail-content .custom-select-trigger:hover,
.modal-content .custom-select-trigger:hover,
#addGameModal .custom-select-trigger:hover {
  border-color: var(--accent);
  transition: all 0.5s ease;
}

.game-row.editing .custom-select-wrapper,
.game-row.editing .custom-select-trigger {
  width: 100%;
  min-width: 0;
}

.game-row.editing .custom-select-wrapper {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: block;
}

.game-row.editing .custom-select-trigger {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  height: 40px;
  min-height: 40px;
  line-height: 40px;
  padding: 0 32px 0 10px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  align-items: center;
}

.custom-select-trigger,
.multiselect-trigger {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.2s ease;
}

.view-switch {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.suggestions::-webkit-scrollbar {
  width: 5px;
}
.suggestions::-webkit-scrollbar-track {
  background: transparent;
}
.suggestions::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}
.suggestions {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(145, 70, 255, 0.2);  /* фиолетовое свечение */
}

.platinum-trophy-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  vertical-align: middle;
  background: url("https://cdn-icons-png.flaticon.com/512/2583/2583401.png") no-repeat center;
  background-size: contain;
  margin-right: 2px;
}

@keyframes platinumPulse {
  0%, 100% { opacity: 0.6; filter: blur(6px); }
  50% { opacity: 1; filter: blur(8px); }
}

.game-group-table.platinum-active::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 14px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(255, 150, 150, 0.5) 0%,
    rgba(255, 220, 150, 0.5) 20%,
    rgba(150, 255, 150, 0.5) 40%,
    rgba(150, 200, 255, 0.5) 60%,
    rgba(200, 150, 255, 0.5) 80%,
    rgba(255, 150, 150, 0.5) 100%
  );
  filter: blur(5px);
}

.game-group-table.platinum-active:hover::after {
  opacity: 1;
  animation: platinumPulse 2s ease-in-out infinite;
}

/* Неактивный чекбокс */
input[id^="editPlatinum"]:disabled,
#editDetailPlatinum:disabled,
#modalGamePlatinum:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  width: 18px;
  height: 18px;
}

/* Активный чекбокс */
input[id^="editPlatinum"]:not(:disabled),
#editDetailPlatinum:not(:disabled),
#modalGamePlatinum:not(:disabled) {
  opacity: 1;
  cursor: pointer;
  width: 18px;
  height: 18px;
}

/* Лейбл тоже должен реагировать */
input[id^="editPlatinum"]:disabled + span,
input[id^="editPlatinum"]:disabled ~ span,
#editDetailPlatinum:disabled + span,
#modalGamePlatinum:disabled + span {
  opacity: 0.5;
}

#viewModeCheckbox {
  width: 20px;
  height: 20px;
}

/* Чекбоксы в модальных окнах */
#modalGamePlatinum,
#modalHasRecords,
#editDetailPlatinum,
#editDetailHasRecords {
  width: 18px;
  height: 18px;
}

/* Чекбоксы в формах */
#gamePlatinum,
#hasRecords {
  width: 18px;
  height: 18px;
}

.game-row.status-dropped td { color: var(--status-dropped-text); }
.game-row.status-dropped { border-color: var(--status-dropped-border); }
.game-comment-row.status-dropped { border-color: var(--status-dropped-border); }
.game-comment-row.status-dropped td { color: var(--status-dropped-text); border-color: var(--status-dropped-border); }
.game-group-table .game-comment-row.status-dropped td { border-top: 2px solid var(--status-dropped-border); }
.game-group-table.status-dropped-group:hover { filter: var(--shadow-group-dropped-hover); }
.game-group-table.status-dropped-group:hover .game-row,
.game-group-table.status-dropped-group:hover .game-comment-row { border-color: var(--status-dropped-border); }
.game-row.status-dropped:hover { border-color: var(--status-dropped-border); }
.game-row:hover + .game-comment-row.status-dropped { border-color: var(--status-dropped-border); }

.game-row.status-in_progress td { color: var(--status-inprogress-text); }
.game-row.status-in_progress { border-color: var(--status-inprogress-border); }
.game-comment-row.status-in_progress { border-color: var(--status-inprogress-border); }
.game-comment-row.status-in_progress td { color: var(--status-inprogress-text); border-color: var(--status-inprogress-border); }
.game-group-table .game-comment-row.status-in_progress td { border-top: 2px solid var(--status-inprogress-border); }
.game-group-table.status-in_progress-group:hover { filter: var(--shadow-group-inprogress-hover); }
.game-group-table.status-in_progress-group:hover .game-row,
.game-group-table.status-in_progress-group:hover .game-comment-row { border-color: var(--status-inprogress-border); }
.game-row.status-in_progress:hover { border-color: var(--status-inprogress-border); }
.game-row:hover + .game-comment-row.status-in_progress { border-color: var(--status-inprogress-border); }

.game-row.status-postponed td { color: var(--status-postponed-text); }
.game-row.status-postponed { border-color: var(--status-postponed-border); }
.game-comment-row.status-postponed { border-color: var(--status-postponed-border); }
.game-comment-row.status-postponed td { color: var(--status-postponed-text); border-color: var(--status-postponed-border); }
.game-group-table .game-comment-row.status-postponed td { border-top: 2px solid var(--status-postponed-border); }
.game-group-table.status-postponed-group:hover { filter: var(--shadow-group-postponed-hover); }
.game-group-table.status-postponed-group:hover .game-row,
.game-group-table.status-postponed-group:hover .game-comment-row { border-color: var(--status-postponed-border); }
.game-row.status-postponed:hover { border-color: var(--status-postponed-border); }
.game-row:hover + .game-comment-row.status-postponed { border-color: var(--status-postponed-border); }

.header-game-search {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.header-game-title {
  white-space: nowrap;
}

.header-search-toggle {
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}

.header-search-toggle:hover {
  color: var(--accent);
  background: rgba(145, 70, 255, 0.1);
}

.header-search-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  animation: searchExpand 0.2s ease forwards;
}

@keyframes searchExpand {
  from { opacity: 0; max-width: 0; }
  to { opacity: 1; max-width: 100%; }
}

.header-search-input {
  flex: 1;
  min-width: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-input);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 4px 8px;
  font-size: 0.8rem;
  height: 28px;
  outline: none;
  box-sizing: border-box;
}

.header-search-input:focus {
  border-color: var(--accent);
}

.header-search-input::placeholder {
  color: var(--text-placeholder);
}

.header-search-clear {
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.7rem;
  color: var(--text-muted);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-search-clear:hover {
  color: var(--danger);
  background: rgba(190, 18, 60, 0.1);
}

/* Строка поиска */
.search-row {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.5rem;
  flex-wrap: nowrap;
  visibility: hidden;
}

.search-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.search-input {
  width: 30%;
  min-width: 200px;
  max-width: 400px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-input);
  border-radius: 10px;
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 0.9rem;
  height: 38px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(145, 70, 255, 0.2);
}

.search-input::placeholder {
  color: var(--text-placeholder);
}

.search-clear-btn {
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.7rem;
  color: var(--text-muted);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 4px;
}

.search-clear-btn:hover {
  color: var(--danger);
  background: rgba(190, 18, 60, 0.1);
  transition: all 0.5s ease;
}

.search-row.visible {
  visibility: visible;
  animation: fadeInDown 0.4s ease forwards;
}

#registerBtn {
  transition: background 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease, color 0.5s ease, opacity 0.3s ease 0s, transform 0.3s ease 0s, width 0.3s ease 0s, margin 0.3s ease 0s, padding 0.3s ease 0s, min-width 0.3s ease 0s;
  transform-origin: center;
}

#registerBtn.post-auth {
  opacity: 0;
  transform: scaleX(0);
  width: 0;
  min-width: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
}

#loginBtn {
  transition: background 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease, color 0.5s ease, opacity 0.3s ease 0.3s, transform 0.3s ease 0.3s, margin 0.3s ease 0.3s, padding 0.3s ease 0.3s, max-width 0.3s ease 0.3s;
}

#profileLinkHeader {
  transition: background 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease, color 0.5s ease, opacity 0.3s ease 0.6s, transform 0.3s ease 0.6s, margin 0.3s ease 0.6s, padding 0.3s ease 0.6s, max-width 0.3s ease 0.6s;
}

#loginBtn.pre-auth-hidden {
  opacity: 0;
  max-width: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Состояние до определения пользователя */
#loginBtn.pre-auth,
#registerBtn.pre-auth {
  opacity: 1;
  transform: translateY(0);
}

#profileLinkHeader.pre-auth {
  opacity: 0;
  max-width: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
}

#profileLinkHeader.post-auth {
  opacity: 1;
  max-width: 200px;
}

.btn, .btn-primary, .btn-secondary, .btn-danger, .btn-small, .btn-google,
#openAddGameModalBtn, #shareBtnProfile, #applyFilterBtn,
.btn-save, .btn-cancel-edit, .btn-delete-row,
.sort-clear-btn, .search-clear-btn, .modal-close-btn,
.btn-add-record, .btn-remove-record {
  transition: background 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease, color 0.5s ease, opacity 0.5s ease, transform 0.5s ease;
}

.record-url-input.error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

.record-error-hint {
  color: var(--danger);
  font-size: 0.75rem;
  margin-top: 4px;
  display: block;
}

.record-error-tooltip {
  animation: tooltipFadeIn 0.3s ease forwards;
}

@keyframes tooltipFadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Модалка импорта */
.modal-import-content {
  max-width: 700px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 1.5rem;
}

.import-source-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 1rem;
}

.import-source-btn {
  flex: 1;
  justify-content: center;
  padding: 16px;
  font-size: 1rem;
}

.import-preview-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.85rem;
}

.import-preview-table th,
.import-preview-table td {
  padding: 6px 10px;
  border: 1px solid var(--border-input);
  text-align: left;
}

.import-preview-table th {
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-weight: 600;
}

.import-mapping-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.import-mapping-label {
  min-width: 120px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.import-mapping-select {
  flex: 1;
  min-width: 150px;
}

.import-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  margin: 2px;
}

.import-status-badge.completed { background: rgba(192, 229, 160, 0.2); color: #c0e5a0; }
.import-status-badge.dropped { background: rgba(252, 204, 204, 0.2); color: #fcc; }
.import-status-badge.in_progress { background: rgba(172, 207, 227, 0.2); color: #accfe3; }
.import-status-badge.postponed { background: rgba(255, 255, 153, 0.2); color: #ff9; }

.import-color-preview {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
  border: 1px solid var(--border-input);
}

#importProgress {
  text-align: center;
  padding: 1rem;
  color: var(--text-muted);
}

.import-progress-bar {
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  margin: 8px 0;
  overflow: hidden;
}

.import-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

#importModal {
  top: 0;
  align-items: center;
  justify-content: center;
}

#importModal .modal-content {
  margin: auto;
}

#importModal .modal-import-content {
  max-width: 700px;
  width: 90%;
  max-height: 400px;
  overflow-y: auto;
  padding: 1.5rem;
  transition: max-height 0.4s ease;
  margin: auto;
}

#importModal .modal-import-content.expanded {
  max-height: calc(100vh - 100px);
}

.btn-loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Кнопка в состоянии загрузки */
.btn.loading {
  opacity: 0.7;
  pointer-events: none;
  cursor: not-allowed;
}

#loadGoogleSheet.loading {
  opacity: 0.7;
  pointer-events: none;
}
#loadGoogleSheet .btn-loading-spinner {
  display: none;
}
#loadGoogleSheet.loading .btn-loading-spinner {
  display: inline-block;
}

#addGameModal,
#importModal {
  display: flex;
}

#importConfirmBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-tertiary);
  border-color: var(--border-input);
  color: var(--text-muted);
}

#importConfirmBtn:not(:disabled) {
  opacity: 1;
  cursor: pointer;
  background: var(--accent);
  border-color: var(--accent-light);
  color: white;
}

#importConfirmBtn:not(:disabled):hover {
  background: var(--accent-hover);
}

.import-mapping-row .custom-select-wrapper {
  flex: 1;
  min-width: 0;
}

.import-mapping-row .custom-select-trigger {
  width: 100%;
}

.custom-color-mapping {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-secondary);
  border: 1px solid var(--border-input);
  border-radius: 8px;
  color: var(--text-secondary);
  padding: 4px 28px 4px 8px;
  font-size: 0.8rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%2364748b'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  flex: 1;
  height: 32px;
  transition: border-color 0.2s;
}

.custom-color-mapping:hover {
  border-color: var(--accent);
}

.custom-color-mapping:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(145, 70, 255, 0.2);
  outline: none;
}

.custom-color-mapping option {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.custom-status-config {
  padding: 8px 0;
}

.custom-color-mapping option,
.custom-status-config select option {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 6px 10px;
  font-size: 0.8rem;
}