/* ========================================
   RESET & BASE STYLES
   ======================================== */

html {
    overflow-y: scroll;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, #4a7ec9 0%, #6b9be0 50%, #4a7ec9 100%);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: bold;
}

button, .btn, .btn-submit, .btn-register-submit, .btn-login-submit {
    font-family: var(--font-sans);
}

input, select, textarea {
    font-family: var(--font-sans);
}

/* Боковые отступы страницы живут здесь, а не на body: шапка и футер — прямые
   дети body и должны тянуться во всю ширину экрана. 1440 = 1400 контента плюс
   два отступа по 20, поэтому ширина самого контента не изменилась. */
.main-wrapper {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
    flex: 1 0 auto;
}

/* ========================================
   HEADER STYLES
   ======================================== */

/* Шапка — полоса во всю ширину экрана: рамка только снизу, а отбивка снизу
   отделяет её от прозрачной контентной области. */
.site-header {
    background: linear-gradient(135deg, #1a2535 0%, #283852 100%);
    border-bottom: 1px solid #3d5270;
    margin-bottom: 20px;
}

/* Дубль правила из components/header.css — тот файл подключается позже и
   перебивает это. Держим значения синхронными: страницы без components/header.css
   иначе получат шапку с другой сеткой. */
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1440px;
    margin: 0 auto;
    padding: 16px 44px;
    gap: 20px;
    flex-wrap: wrap;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo-icon {
    background: linear-gradient(135deg, #e01a3f 0%, #c41535 100%);
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.header-logo-icon i {
    color: white;
    font-size: 24px;
}

.header-logo-text {
    font-weight: 800;
    font-size: 24px;
    color: white;
}

.header-logo-text span {
    color: #e01a3f;
}

/* Суффикс админки. Отрицательный margin гасит gap: 12px у .header-logo,
   иначе ".Admin" отрывается от названия сайта. */
.header-logo-admin {
    margin-left: -12px;
    font-weight: 800;
    font-size: 24px;
    color: #8a9cb5;
}

.header-user {
    flex-shrink: 0;
}

.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #4a6080;
}

.user-menu-trigger:hover {
    background: rgba(255,255,255,0.2);
    border-color: #e01a3f;
}

.user-avatar-mini {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e01a3f;
}

.user-avatar-mini i {
    font-size: 28px;
    color: #ebebeb;
}

.user-info-mini {
    display: flex;
    flex-direction: column;
}

.user-info-mini .username {
    font-size: 13px;
    font-weight: 600;
    color: white;
}


.user-menu-trigger .fa-chevron-down {
    color: #8a9cb5;
    font-size: 12px;
    transition: transform 0.2s;
}

.user-menu-trigger.active .fa-chevron-down {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.2);
    overflow: hidden;
    z-index: 1000;
    display: none;
}

.user-dropdown.show {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #1a2a3f;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
}

.dropdown-item:hover {
    background: #f1f5f9;
    color: #e01a3f;
}

.dropdown-item i {
    width: 20px;
    color: #5a6a80;
}

.dropdown-item:hover i {
    color: #e01a3f;
}

.dropdown-item.logout {
    border-top: 1px solid #e2e8f0;
    color: #e01a3f;
}

.dropdown-item.logout i {
    color: #e01a3f;
}

.auth-buttons {
    display: flex;
    gap: 12px;
}

.btn-register-header {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: rgba(255,255,255,0.1);
    border: 1px solid #4a6080;
    border-radius: 40px;
    color: white;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-register-header:hover {
    background: rgba(255,255,255,0.2);
    border-color: #e01a3f;
}

.btn-login-header {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: rgba(255,255,255,0.1);
    border: 1px solid #4a6080;
    border-radius: 40px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-login-header:hover {
    background: rgba(255,255,255,0.2);
    border-color: #e01a3f;
}

/* ========================================
   DASHBOARD
   ======================================== */

/* Оболочка и обе колонки идут без своего фона и рамок: сквозь них виден фон
   body, поэтому центр не образует общей карточки с шапкой и футером. */
.dashboard {
    display: grid;
    /* minmax(0, 1fr), а не 1fr: у 1fr автоминимум равен min-content, поэтому
       широкий контент (таблицы админки с nowrap) не раздувает основную колонку. */
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    overflow: hidden;
}

.dashboard-with-news-sidebar {
    grid-template-columns: minmax(0, 1fr) 300px;
}

.dashboard-one-column {
    grid-template-columns: minmax(0, 1fr);
}

.center-col {
    padding: 24px;
    min-height: 500px;    min-width: 0;
}

.right-col {
    padding: 24px;
}

/* ========================================
   ШИРОКАЯ РАСКЛАДКА АДМИНКИ
   Админские страницы рендерятся без правого сайдбара (см. layout.html),
   поэтому контент занимает всю ширину, а внешняя обёртка совпадает по размеру
   с обычной страницей.
   Правила живут в main_styles.css, а не в admin_cascade.css: тот
   подключён в конце <body>, и ширина менялась бы уже после первой
   отрисовки — страница заметно дёргалась бы.
   ======================================== */

.main-wrapper-wide {
    /* Админка без сайдбара использует ту же внешнюю ширину, что и
       главная страница вместе с сайдбаром. */
    max-width: 1440px;
}

.dashboard-wide {
    grid-template-columns: minmax(0, 1fr);
}

/* Таблицам и спискам широкая колонка нужна, формам — нет: поле ввода
   на всю ширину 1750px читать неудобно. Ограничиваем только оболочки форм. */
.dashboard-wide .config-form {
    max-width: 1200px;
}

.right-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ========================================
   GENRES & NAVIGATION
   ======================================== */

/* Блок навигации без фона — сквозь него виден основной фон страницы.
   Скругление и overflow оставлены: они обрезают подсветку первого и
   последнего пункта, иначе hover выходит за углы блока. */
.genres-section {
    border-radius: 12px;
    overflow: hidden;
}

.genres-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0;
}

.genre-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    font-weight: 500;
    color: #1a2a3f;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

/* Цвет иконок — под светлую тему, в один тон с текстом пунктов. Прежние цвета
   тёмной темы закреплены в theme.css: раньше она наследовала их отсюда. */
.genre-item i {
    width: 24px;
    color: #1a2a3f;
    font-size: 1rem;
    text-align: center;
}

.genre-item:hover {
    background: rgba(224, 26, 63, 0.08);
    color: #e01a3f;
}

.genre-item:hover i {
    color: #e01a3f;
}

.genre-item.active {
    background: rgba(0, 0, 0, 0.05);
    color: #1a2a3f;
    font-weight: 600;
}

/* Правило стоит после :hover-а намеренно: при равной специфичности активный
   пункт остаётся в своём цвете и под курсором. */
.genre-item.active i {
    color: #1a2a3f;
}

.genre-divider {
    height: 1px;
    background: rgba(0,0,0,0.05);
    margin: 8px 16px;
}

/* Подзаголовок группы пунктов («Подборки»). Раньше стили жили инлайном в
   partials/sidebar.html, из-за чего цвет нельзя было переопределить для
   тёмной темы — она переопределяет его в theme.css. */
.genre-group-title {
    padding: 6px 16px 4px;
    font-size: 11px;
    font-weight: 700;
    color: #1a2a3f;
    text-transform: uppercase;
}

/* ========================================
   SECTION HEADER
   ======================================== */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a2a3f;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ========================================
   GAMES GRID
   ======================================== */

.admin-section {
    background: rgba(255,255,255,0.5);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.admin-section h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1a2a3f;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid #c5d0de;
}

.admin-section h2 i {
    color: #e01a3f;
}

.table-wrapper {
    overflow-x: auto;
    width: 100%;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    font-size: 13px;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.admin-table th {
    background: #f1f5f9;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
}

.admin-table td {
    color: #334155;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-edit,
.btn-delete {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-edit {
    background: #3b82f6;
    color: white;
}

.btn-edit:hover {
    background: #2563eb;
}

.btn-delete {
    background: #ef4444;
    color: white;
}

.btn-delete:hover {
    background: #dc2626;
}

/* ========================================
   REGISTER PAGE
   ======================================== */

.register-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

.register-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 0 0 20px 0;
    border-bottom: none;
}

.register-header h1 {
    font-size: 28px;
    color: #1a2a3f;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.register-header h1 i {
    color: #e01a3f;
    font-size: 32px;
}

.register-header p {
    color: #64748b;
    font-size: 14px;
}

.register-error {
    background: rgba(224, 26, 63, 0.1);
    border-left: 4px solid #e01a3f;
    color: #991b1b;
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.register-form {
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.register-page .form-row {
    margin-bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.register-page .form-group {
    width: 320px;
    max-width: 90%;
}

.register-page .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    text-align: left;
}

.register-page .form-group label i {
    color: #ffffff;
    width: 20px;
    margin-right: 6px;
}

.register-page .form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s;
    outline: none;
    background: rgba(255,255,255,0.8);
}

.register-page .form-group input:focus {
    border-color: #e01a3f;
    background: white;
    box-shadow: 0 0 0 3px rgba(224, 26, 63, 0.1);
}

.register-page .form-group input::placeholder {
    color: #94a3b8;
}

.register-page .form-group small {
    display: block;
    font-size: 11px;
    color: #5a6a80;
    margin-top: 6px;
    text-align: left;
}

.register-page .form-actions {
    margin-top: 30px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.btn-register-submit {
    width: 320px;
    max-width: 90%;
    padding: 12px;
    background: linear-gradient(135deg, #e01a3f, #c41535);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-register-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(224, 26, 63, 0.3);
}

/* ========================================
   FOOTER
   ======================================== */

.site-footer {
    background: linear-gradient(135deg, #1a2535 0%, #283852 100%);
    border-top: 1px solid #3d5270;
    margin-top: 20px;
}

/* Та же сетка, что у .header-container: содержимое футера стоит под контентом,
   пока фон полосы тянется во всю ширину экрана. */
.footer-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px 44px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-info h3 {
    color: white;
    font-size: 20px;
    margin-bottom: 6px;
}

.footer-info h3 span {
    color: #e01a3f;
}

.footer-info p {
    color: #9aafc5;
    font-size: 13px;
}

.footer-socials {
    display: flex;
    gap: 12px;
}

.footer-socials a {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid #4a6080;
    border-radius: 10px;
    color: #9aafc5;
    transition: all 0.2s;
    text-decoration: none;
}

.footer-socials a:hover {
    background: #e01a3f;
    border-color: #e01a3f;
    color: white;
}

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid #3d5270;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.copyright {
    color: #7a8fa5;
    font-size: 12px;
}

.footer-bottom-links {
    display: flex;
    gap: 20px;
}

.footer-bottom-links a {
    color: #7a8fa5;
    text-decoration: none;
    font-size: 12px;
}

.footer-bottom-links a:hover {
    color: #e01a3f;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {}

@media (max-width: 768px) {
    .main-wrapper {
        padding: 0 10px;
    }

    .footer-container {
        padding: 24px 34px;
    }
    
    .header-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .dashboard,
    .dashboard-with-news-sidebar {
        grid-template-columns: minmax(0, 1fr);
    }    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-bottom-links {
        justify-content: center;
    }
    
    .admin-table {
        font-size: 12px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 8px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .register-header h1 {
        font-size: 24px;
    }
}

/* ========================================
   ЗВЕЗДНЫЙ РЕЙТИНГ
   ======================================== */

.star-rating {
    display: flex;
    gap: 8px;
    cursor: pointer;
}

.star-rating i {
    font-size: 28px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.star-rating i.far {
    color: #cbd5e1;
}

.star-rating i.fas {
    color: #fbbf24;
}

.star-rating i:hover {
    transform: scale(1.1);
}

.star-rating i.hover {
    color: #fbbf24;
}

.star-rating i.selected {
    color: #fbbf24;
}

/* ========================================
   ПОЛЯ ОШИБОК И УСПЕХА
   ======================================== */

.field-error {
    color: #e01a3f;
    font-size: 12px;
    margin-top: 5px;
}

.field-success {
    color: #10b981;
    font-size: 12px;
    margin-top: 5px;
}

/* ========================================
   АНИМАЦИЯ ДЛЯ БАЛАНСА
   ======================================== */

.delete-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.delete-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    padding: 0;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: modalSlideIn 0.3s ease;
}

.delete-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fee2e2;
    border-radius: 16px 16px 0 0;
}

.delete-modal-header i {
    font-size: 24px;
    color: #e01a3f;
}

.delete-modal-header h3 {
    font-size: 18px;
    color: #1a2a3f;
    margin: 0;
}

.delete-modal-body {
    padding: 24px;
}

.delete-modal-body p {
    margin-bottom: 16px;
    color: #4a5a70;
    line-height: 1.6;
}

.delete-modal-body .warning-text {
    color: #e01a3f;
    font-weight: 600;
}

.delete-modal-body .message-preview {
    background: #f1f5f9;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    color: #1a2a3f;
    word-break: break-word;
}

.delete-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.delete-modal-footer .btn-cancel {
    padding: 8px 20px;
    background: #f1f5f9;
    color: #5a6a80;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.delete-modal-footer .btn-cancel:hover {
    background: #e2e8f0;
}

.delete-modal-footer .btn-confirm {
    padding: 8px 20px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.delete-modal-footer .btn-confirm:hover {
    background: #dc2626;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   ПАГИНАЦИЯ
   ============================================ */

.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
}

.pagination .page-link {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-decoration: none;
    color: #1a2a3f;
    font-size: 14px;
    transition: all 0.2s;
    background: white;
}

.pagination .page-link:hover {
    background: #f1f5f9;
    border-color: #e01a3f;
}

.pagination .page-link.active {
    background: #e01a3f;
    color: white;
    border-color: #e01a3f;
}

/* ============================================
   МОБИЛЬНАЯ АДАПТАЦИЯ (дополнительная)
   ============================================ */

@media (max-width: 480px) {
    .delete-modal-content {
        width: 95%;
        margin: 10px;
    }
}

/* ============================================
   АДМИН-ПАНЕЛЬ (дополнительные стили)
   ============================================ */

.admin-container {
    width: 100%;
}

/* Возврат в админ-панель. Одна кнопка на всех внутренних админских страницах,
   поэтому положение и вид не зависят от того, что ниже на странице. */
.admin-back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 11px 20px 11px 16px;
    border: 1px solid #ccd7e6;
    border-radius: 12px;
    background: #e7edf6;
    color: #5a6b85;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.admin-back i {
    font-size: 13px;
    transition: transform .2s ease;
}

.admin-back:hover {
    background: #dbe4f1;
    border-color: #b6c5da;
    color: #3d4c63;
    transform: translateY(-1px);
}

.admin-back:hover i {
    transform: translateX(-3px);
}

.admin-back:focus-visible {
    outline: 2px solid #e01a3f;
    outline-offset: 2px;
}

.admin-header {
    margin-bottom: 24px;
}

.admin-header h1 {
    font-size: 28px;
    color: #1a2a3f;
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-header h1 i {
    color: #e01a3f;
}

.admin-header p {
    color: #64748b;
    font-size: 14px;
}

.admin-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.admin-section {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.admin-section h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1a2a3f;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid #c5d0de;
}

.admin-section h2 i {
    color: #e01a3f;
}

.filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-row input,
.filter-row select {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

.filter-row input:focus,
.filter-row select:focus {
    outline: none;
    border-color: #e01a3f;
}

.btn-filter {
    padding: 8px 20px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.btn-filter:hover {
    background: #2563eb;
}

.btn-clear-filter {
    padding: 8px 16px;
    background: #f1f5f9;
    color: #5a6a80;
    text-decoration: none;
    border-radius: 8px;
}

.btn-add-item {
    padding: 10px 20px;
    background: linear-gradient(135deg, #e01a3f, #c41535);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-add-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(224, 26, 63, 0.3);
}

.btn-refresh {
    padding: 10px 20px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-refresh:hover {
    background: #1e2a36;
}

.rarity-badge {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.btn-grant {
    background: #48bb78;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-grant:hover {
    background: #38a169;
}

/* Модальные окна для админки */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    padding: 0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
}

.modal-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header h3 i {
    color: #e01a3f;
}

.modal-close {
    font-size: 24px;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #1a2a3f;
}

.modal-body {
    padding: 24px;
}

.modal-body p {
    color: #4a5a70;
    margin-bottom: 16px;
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1a2a3f;
    margin-bottom: 6px;
}

.modal-body .form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
}

.modal-body .form-group input:focus {
    outline: none;
    border-color: #e01a3f;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-radius: 0 0 16px 16px;
}

.btn-cancel {
    padding: 8px 20px;
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    color: #5a6a80;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #e2e8f0;
}

.btn-confirm {
    padding: 8px 20px;
    background: #e01a3f;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-confirm:hover {
    background: #c41535;
}

.error-text {
    color: #e01a3f;
    font-size: 12px;
    margin-top: 6px;
    display: none;
}

.modal .warning-text {
    color: #e01a3f;
    font-weight: 500;
    margin-top: 8px;
}

/* Адаптация для админки на мобильных */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }
    
    .filter-row input,
    .filter-row select {
        width: 100%;
    }
    
    .admin-actions {
        flex-direction: column;
    }
    
    .admin-actions a,
    .admin-actions button {
        width: 100%;
        justify-content: center;
    }
}

/* Rate Limit Page */
.rate-limit-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #1a2535 0%, #283852 100%);
}

.rate-limit-card {
    background: white;
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rate-limit-icon {
    font-size: 64px;
    color: #f59e0b;
    margin-bottom: 16px;
}

.rate-limit-icon i {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.rate-limit-title {
    font-size: 28px;
    font-weight: 800;
    color: #1a2a3f;
    margin-bottom: 12px;
}

.rate-limit-subtitle {
    font-size: 16px;
    color: #5a6a80;
    margin-bottom: 8px;
    line-height: 1.6;
}

.rate-limit-details {
    background: #f1f5f9;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 20px 0;
    text-align: left;
}

.rate-limit-details .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    border-bottom: 1px solid #e2e8f0;
}

.rate-limit-details .detail-row:last-child {
    border-bottom: none;
}

.rate-limit-details .detail-label {
    color: #5a6a80;
}

.rate-limit-details .detail-value {
    color: #1a2a3f;
    font-weight: 600;
}

.rate-limit-timer {
    font-size: 48px;
    font-weight: 800;
    color: #e01a3f;
    margin: 16px 0;
    font-variant-numeric: tabular-nums;
}

.rate-limit-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.btn-retry {
    padding: 12px 32px;
    background: linear-gradient(135deg, #e01a3f, #c41535);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-retry:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(224, 26, 63, 0.3);
}

.btn-retry:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-home {
    padding: 12px 32px;
    background: transparent;
    color: #5a6a80;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-home:hover {
    background: #f1f5f9;
    border-color: #e01a3f;
    color: #e01a3f;
}

.rate-limit-hint {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 20px;
}
/* Shared state utilities used by templates instead of inline display styles. */
.is-hidden { display: none !important; }
