/* База */
* {
    box-sizing: border-box;
}

:root {
    --bg: #0b0b0b;
    --panel: #141414;
    --panel-2: #1a1a1a;
    --border: #292929;
    --text: #e6e6e6;
    --muted: #b6b6b6;
    --accent: #c0392b;
    --accent-2: #e74c3c;
    --gold: #f7c76b;
    --success: #27ae60;
    --focus: #3b82f6;
    --shadow: 0 6px 18px rgba(0, 0, 0, .35);
    --radius: 12px;
    --radius-sm: 8px
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    letter-spacing: .2px;
    text-decoration: none
}

.brand-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0
}

.brand-text {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .2px
}

@media (max-width: 768px) {
    .brand-logo {
        height: 28px
    }

    .brand-text {
        font-size: 16px
    }
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 12px;
    line-height: 1.45;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    background:
        /* Диагональные темные полосы */
        linear-gradient(145deg, #1a1a1a 0%, #1a1a1a 15%, #2a2a2a 15%, #2a2a2a 20%, #1f1f1f 20%, #1f1f1f 35%, transparent 35%),
        /* Диагональные элементы справа внизу */
        linear-gradient(-45deg, transparent 0%, transparent 85%, #2a2a2a 85%, #2a2a2a 90%, #1f1f1f 90%, #1f1f1f 100%),
        /* Центральная тень */
        radial-gradient(ellipse at 50% 40%, rgba(26, 26, 26, 0.8) 0%, transparent 60%),
        /* Базовый темный градиент */
        linear-gradient(180deg, #0f0f0f 0%, #1a1a1a 50%, #0f0f0f 100%);
    background-attachment: fixed;
    background-size: 100% 100%;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background:
        /* Дополнительные диагональные линии */
        linear-gradient(120deg, transparent 0%, transparent 25%, rgba(42, 42, 42, 0.3) 25%, rgba(42, 42, 42, 0.3) 27%, transparent 27%, transparent 100%);
}

body::after {
    content: '';
    position: fixed;
    bottom: 0;
    right: 0;
    width: 40%;
    height: 30%;
    pointer-events: none;
    z-index: 0;
    background: transparent;
}

#content {
    position: relative;
    z-index: 1;
}

@supports (height:100svh) {
    body {
        min-height: 100svh
    }
}

a {
    color: inherit;
    text-decoration: none
}

.footer{
    max-width: 1200px;
    margin-inline: auto
}


.container-center {
    max-width: 1003px;
    min-width: 1003px;
    margin-inline: 20px;
}

#content {
    padding: 20px 0 28px;
    flex: 1 0 auto;
    width: 100%;
    max-width: 1600px;
    margin-inline: auto;
}

.content {
    /*padding: 20px 16px*/
}

.page-header .wrapper {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 16px
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
    background: rgba(20, 20, 20, .85);
    border-bottom: 1px solid var(--border);
    position: relative;
}

.site-header .header-row {
    max-width: 1200px;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0
}

.nav a {
    margin-left: 18px;
    opacity: .85
}

.nav a:hover {
    opacity: 1;
    color: var(--accent-2)
}

.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 28px;
    position: relative;
    z-index: 1;
}
/*.site-footer {*/
/*    margin-top: 0*/
/*}*/

.site-footer .footer {
    padding: 18px 0;
    color: var(--muted);
    font-size: 13px
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow)
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(71, 85, 105, 0.3);
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.4) 0%, rgba(30, 41, 59, 0.5) 100%);
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn:hover {
    border-color: rgba(139, 92, 246, 0.5);
    background: linear-gradient(135deg, rgba(71, 85, 105, 0.5) 0%, rgba(51, 65, 85, 0.6) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(139, 92, 246, 0.2);
}

.btn:hover::before {
    opacity: 1;
}

.btn.active {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15) 0%, rgba(255, 107, 53, 0.25) 100%);
    border-color: rgba(71, 85, 105, 0.4);
    color: #e2e8f0;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.15);
}

.btn--ghost {
    background: rgba(51, 65, 85, 0.5);
    color: #cbd5e1;
    border-color: rgba(71, 85, 105, 0.4);
}

.btn--ghost:hover {
    background: rgba(51, 65, 85, 0.7);
    color: #e2e8f0;
    border-color: rgba(255, 107, 53, 0.4);
    box-shadow: 0 0 6px rgba(255, 107, 53, 0.2);
}

.btn--accent {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    border-color: rgba(192, 57, 43, 0.6);
    color: white;
    box-shadow: 0 4px 8px rgba(192, 57, 43, 0.3);
}

.btn--accent:hover {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 6px 12px rgba(192, 57, 43, 0.4);
}

.btn--danger {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
    border-color: rgba(185, 28, 28, 0.6);
    color: white;
    box-shadow: 0 4px 8px rgba(185, 28, 28, 0.3);
    font-size: 0.875rem;
    padding: 8px 16px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn--danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    box-shadow: 0 6px 12px rgba(185, 28, 28, 0.4);
    transform: scale(1.05);
}

.btn--danger-sm {
    font-size: 0.75rem;
    padding: 4px 10px;
    line-height: 1.2;
}

.messages {
    margin: 8px 0 14px;
    display: grid;
    gap: 8px
}

.message {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #2c2c2c;
    background: #171717
}

.pagination {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap
}

.page-btn {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #191919
}

.page-state {
    color: var(--muted)
}

.form {
    display: grid;
    gap: 12px
}

.form-row {
    display: grid;
    gap: 12px
}

@media (min-width: 720px) {
    .form-row.grid-2 {
        grid-template-columns:1fr 1fr
    }

    .form-row.grid-3 {
        grid-template-columns:1fr 1fr 1fr
    }
}

.field {
    display: grid;
    gap: 6px
}

.field label {
    font-weight: 600;
    color: var(--muted)
}

.field .help-text {
    color: var(--muted);
    font-size: 12px
}

input[type="text"], input[type="number"], input[type="email"], input[type="search"], input[type="date"], select, textarea {
    width: 100%;
    padding: 9px 10px;
    border-radius: 8px;
    border: 1px solid #2f2f2f;
    background: #151515;
    color: #f0f0f0;
    outline: none;
    transition: border-color .12s ease, box-shadow .12s ease
}

textarea {
    min-height: 88px;
    resize: vertical
}

.field.is-error input, .field.is-error select, .field.is-error textarea {
    border-color: #6b1a1a;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, .2)
}

.field .error-text {
    color: #ffb3b3;
    font-size: 12px
}

@media (min-width: 900px) {
    .replays.detail .detail-body {
        grid-template-columns:460px 1fr;
        align-items: start
    }
}

.img-container--xl .map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover
}

.img-container--xl .tank {
    position: absolute;
    right: -8px;
    bottom: -8px;
    width: 260px;
    height: auto;
    filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .65))
}

.img-container--xl .mastery {
    position: absolute;
    left: 10px;
    bottom: 10px;
    width: 70px;
    height: 70px
}

.detail-stats .table {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px
}

.detail-stats .cell {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: #111;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm)
}

.detail-stats .cell img {
    width: 20px;
    height: 20px;
    object-fit: contain
}

.detail-stats .actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

.replays.filters #content .container {
    max-width: 900px
}

.filters-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px
}

@media (min-width: 720px) {
    .filters-row.grid-3 {
        grid-template-columns:1fr 1fr 1fr
    }
}

.mt-0 {
    margin-top: 0 !important
}

.mt-4 {
    margin-top: 4px !important
}

.mt-8 {
    margin-top: 8px !important
}

.mt-12 {
    margin-top: 12px !important
}

.mb-0 {
    margin-bottom: 0 !important
}

.mb-8 {
    margin-bottom: 8px !important
}

.mb-16 {
    margin-bottom: 16px !important
}

.mb-24 {
    margin-bottom: 24px !important
}

.grid {
    display: grid;
    gap: 12px
}

.grid-2 {
    grid-template-columns:1fr 1fr
}

.grid-3 {
    grid-template-columns:1fr 1fr 1fr
}

@media (max-width: 720px) {
    .grid-2, .grid-3 {
        grid-template-columns:1fr
    }
}

@media (max-width: 768px) {
    .page-header .wrapper {
        padding-left: 12px;
        padding-right: 12px
    }

    .content {
        padding-left: 12px;
        padding-right: 12px
    }
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease
}

.modal.active {
    opacity: 1;
    visibility: visible
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px)
}

.modal-content {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 520px;
    /*max-height: 90vh;*/
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal.active .modal-content {
    transform: scale(1) translateY(0)
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--panel-2)
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text)
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease
}

.modal-body {
    padding: 24px;
    flex: 1;                          /* ДОБАВИТЬ */
    overflow-y: auto;                 /* ДОБАВИТЬ */
    overflow-x: hidden;               /* ДОБАВИТЬ */
}

.upload-area {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    background: var(--bg);
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden
}

.upload-area.dragover {
    border-color: var(--accent);
    background: rgba(192, 57, 43, 0.1);
    transform: scale(1.02)
}

.upload-area:hover .upload-text strong {
    color: var(--accent-2)
}

.upload-area.dragover .upload-text strong {
    color: var(--accent-2)
}

.upload-area.dragover .upload-icon {
    transform: scale(1.1);
    transition: transform 0.3s ease
}

.upload-icon {
    margin-bottom: 16px;
    display: flex;
    justify-content: center
}

.file-desc {
    padding: 0 0 12px;
    border-bottom: 1px dashed var(--muted);
}
.upload-text {
    margin: 0;
    color: var(--text);
    line-height: 1.5
}

.upload-text strong {
    color: var(--accent);
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
    transition: color 0.2s ease
}

.file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer
}

.selected-file {
    margin-top: 20px;
    padding: 16px;
    background: var(--panel-2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    max-height: 400px;                /* ДОБАВИТЬ */
    overflow-y: auto;                 /* ДОБАВИТЬ */
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 100%;
}

.file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.selected-file h3 {
    margin: 0 0 12px;
    font-size: 16px;
    color: var(--text)
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    flex-direction: column;
}

.file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* НОВЫЙ класс для размера файла */
.file-size {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

/* НОВЫЙ класс для кнопки удаления */
.file-remove {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(192, 57, 43, 0.2);
    color: var(--accent);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.file-remove:hover {
    background: var(--accent);
    color: white;
}

/* НОВЫЙ класс для общей информации */
.file-total {
    /*margin-top: 12px;*/
    /*padding-top: 12px;*/
    /*border-top: 1px solid var(--border);*/
    color: var(--muted);
    font-size: 12px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    background: var(--panel-2);
    flex-shrink: 0;
}

.upload-status {
    display: flex;
    align-items: center;
    gap: 8px
}

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

@media (max-width: 768px) {
    .modal {
        padding: 8px
    }

    .modal-content {
        max-width: 100%
    }

    .modal-header, .modal-body, .modal-footer {
        padding-left: 16px;
        padding-right: 16px
    }

    .upload-area {
        padding: 32px 16px
    }

    .upload-btn {
        font-size: 13px;
        padding: 6px 10px
    }

    .upload-btn span {
        display: none
    }

    .selected-file {
        padding: 12px
    }

    .file-info {
        padding: 10px;
        gap: 10px
    }

    .file-icon {
        font-size: 20px
    }

    .file-name {
        font-size: 13px
    }

    .file-size {
        font-size: 11px
    }

    .file-remove {
        width: 24px;
        height: 24px;
        font-size: 14px
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px)
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0)
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0)
    }
    to {
        opacity: 0;
        transform: scale(0.9) translateY(20px)
    }
}

.big-red-button {
    width: 152px;
    height: 44px;
    line-height: 42px;
    background: url("../style/images/wot/buttons/red-button-sprite.58abaac05503.png");
    border: none;
    border-radius: 4px;
    font-family: "Oswald", sans-serif;
    font-size: 20px;
    color: #F2F2F2;
    text-shadow: 0px 0px 10px black, 0px 0px 10px black, 0px 0px 1px black, 0px 0px 2px black
}

.big-red-button.inactive, .big-red-button.inactive:hover {
    background-size: 100% 400%;
    background-position: 0% 200%
}

.text-muted-sm {
    color: var(--muted);
    font-size: 0.9rem
}

.contact-list {
    list-style: none;
    padding-left: 0;
    display: grid;
    gap: 8px
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: 8px
}

.icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: .9
}

svg.icon {
    width: 18px !important;
    height: 18px !important;
    flex: 0 0 18px;
    display: inline-block;
    max-width: none;
    vertical-align: middle
}

.replay-filter.active {
    display: block
}

.replay-filter .col .title {
    font-weight: 700;
    margin-bottom: 8px
}

.replay-filter .tank-list {
    grid-column: 1 / -1
}

.replay-filter .tank-list .list {
    margin-top: 8px;
    max-height: 360px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px;
    background: var(--panel-2)
}

.replay-filter label .checkbox {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin: 0 8px 0 6px;
    border: 1px solid var(--border);
    border-radius: 3px;
    vertical-align: -2px;
    background: #111
}

.replay-filter input[type="checkbox"]:checked + .checkbox {
    background: var(--accent);
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .35)
}

@media (max-width: 980px) {
    .replay-filter .rf-grid {
        grid-template-columns:1fr 1fr
    }
}

@media (max-width: 640px) {
    .replay-filter .rf-grid {
        grid-template-columns:1fr
    }
}

.card {
    background: var(--panel);
    border-color: var(--border);
    box-shadow: var(--shadow)
}

.site-header {
    background: color-mix(in oklab, var(--panel) 85%, transparent);
    border-bottom: 1px solid var(--border)
}

.site-footer {
    border-top: 1px solid var(--border)
}

.btn {
    background: var(--panel-2);
    color: var(--text);
    border-color: var(--border)
}

.btn--ghost {
    background: rgba(20, 20, 20, 0.85);
    border: 1px solid #2a2a2a;
    color: #e6e6e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn--ghost:hover {
    background: #1a1a1a;
    border-color: #404040;
    color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

.btn--accent {
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
    border: none;
    color: white
}

/*input[type="text"], input[type="number"], input[type="email"], input[type="search"], input[type="date"], select, textarea {*/
/*    background: var(--input-bg);*/
/*    color: var(--text);*/
/*    border-color: var(--border)*/
/*}*/

.content.content--with-aside .container .page-with-aside {
    display: grid;
    grid-template-columns:1fr 300px;
    gap: 20px
}

.sidebar.sidebar--ads .card {
    background: #111519;
    border: 1px solid #232a31;
    border-radius: 10px;
    padding: 14px 16px;
    position: sticky;
    top: 16px
}

.social-links .icon {
    display: inline-block;
    flex: 0 0 auto
}

.sidebar.sidebar--ads .card {
    background: #111519;
    border: 1px solid #232a31;
    border-radius: 10px;
    padding: 14px 16px;
    position: sticky;
    top: 16px
}

.social-links .icon {
    display: inline-block;
    flex: 0 0 auto
}

@media (max-width: 980px) {
    .page-with-aside {
        grid-template-columns:1fr
    }

    .sidebar.sidebar--ads .card {
        position: static
    }
}

.content.with-friends {
    display: grid;
    grid-template-columns:minmax(0, 1fr) 300px;
    gap: 20px
}

.sidebar.sidebar--ads .card,
.sidebar-container .friends-card {
    background: rgba(20, 20, 20, 0.85);
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 14px 16px;
    position: sticky;
    top: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.friends-card__title {
    font-weight: 700;
    margin-bottom: 10px;
    justify-content: center;
    font-size: 22px
}

.sidebar-container .friends-links {
    list-style: none;
    margin: 0;
    padding: 0
}

.sidebar-container .friends-links li + li {
    margin-top: 8px
}

.sidebar-container .friends-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none
}

.sidebar-container .friends-links .icon {
    display: inline-block;
    flex: 0 0 auto
}

@media (max-width: 980px) {
    .content.with-friends {
        grid-template-columns:1fr
    }

    .sidebar-container .friends-card {
        position: static
    }
}

.changelog-summary {
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: .4rem
}

.changelog-entry ul {
    padding-left: 1.2rem
}

.changelog-entry ul ul {
    margin-top: 4px;
    padding-left: 1.5rem;
}

.changelog-entry code {
    background: var(--panel-2);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 11px;
    border: 1px solid var(--border);
}

.upload-progress .bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #5cb85c, #2e8b57);
    border-radius: 6px;
    transition: width .2s ease
}

.upload-progress .label {
    position: absolute;
    top: -22px;
    right: 0;
    font-size: 12px;
    opacity: 0.7
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success {
    background: var(--success);
    color: white;
}

.ml-8 {
    margin-left: 8px;
}

/* ==============================================
   New Filters Page Styles (Redesign)
   ============================================== */

.filters-card {
    padding: 24px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.filters-title h1 {
    margin: 0 0 4px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.filters-actions-top {
    display: flex;
    gap: 10px;
}

.filter-section {
    margin-bottom: 24px;
}

.filter-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.9;
}

.filter-section-title i {
    color: var(--accent);
    opacity: 0.8;
}

.filter-divider {
    border: 0;
    border-top: 1px dashed var(--border);
    margin: 24px 0;
    opacity: 0.5;
}

.filter-grid {
    display: grid;
    gap: 16px;
}

.filter-grid.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.filter-grid.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-group.span-3 {
    grid-column: 1 / -1;
}

.field-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 12px;
    color: var(--muted);
    opacity: 0.5;
    pointer-events: none;
    font-size: 14px;
}

.input-wrapper input[type="search"],
.input-wrapper input[type="text"],
.input-wrapper input[type="date"],
.input-wrapper input[type="number"] {
    width: 100%;
    padding: 10px 12px 10px 36px; /* Space for icon */
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    transition: all 0.2s ease;
}

.pagination-link {
    padding: 8px 12px;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    background: rgba(20, 20, 20, 0.85);
    color: #e6e6e6;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pagination-link:hover {
    background: #1a1a1a;
    border-color: #404040;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.pagination-link--active {
    background: rgba(192, 57, 43, 0.15);
    border-color: rgba(192, 57, 43, 0.4);
    color: #e6e6e6;
    box-shadow: none;
    cursor: default;
    pointer-events: none;
}

.input-wrapper input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
    background: var(--bg);
}

.input-wrapper input[type="date"] {
    padding-left: 12px; /* No icon usually for date or custom styling */
}
/* If date has no icon in HTML, remove padding */
.input-wrapper input:not([type="search"]):not(#owner_nick):not(#participant_nick):not(#owner_clan):not(#short_description) {
     padding-left: 12px;
}
/* Specific fix for inputs with icons */
#map_search, #owner_nick, #participant_nick, #owner_clan, #short_description, #tank-search, #gv-search {
    padding-left: 36px !important;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.range-inputs input {
    width: 100%;
    padding: 8px 10px;
    text-align: center;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
}

.range-inputs .separator {
    color: var(--muted);
}

/* Chips */
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip-radio, .chip-check {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.chip-radio input, .chip-check input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.chip-radio span, .chip-check span {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text);
    transition: all 0.2s ease;
}

.chip-radio input:checked + span,
.chip-check input:checked + span {
    background: rgba(192, 57, 43, 0.15);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.2);
}

.chip-radio.win input:checked + span {
    background: rgba(39, 174, 96, 0.15);
    border-color: var(--success);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.2);
}

.chip-radio.loss input:checked + span {
    background: rgba(192, 57, 43, 0.15);
    border-color: var(--accent);
}

.chip-check:hover span {
    background: var(--bg);
    border-color: var(--muted);
}

/* Search Widget Lists */
.search-list-container {
    margin-top: 8px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.list-header {
    padding: 8px 12px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
}

.search-list {
    max-height: 240px;
    overflow-y: auto;
    padding: 4px;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.1s;
}

.search-item:hover {
    background: rgba(255,255,255,0.05);
}

.search-item input {
    margin: 0;
}

.search-item .item-name {
    flex: 1;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item .item-meta {
    font-size: 11px;
    color: var(--muted);
    background: rgba(0,0,0,0.3);
    padding: 2px 4px;
    border-radius: 3px;
}

.filters-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn--lg {
    padding: 10px 24px;
    font-size: 15px;
}

@media (max-width: 768px) {
    .filters-card {
        padding: 16px;
    }
    .filters-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .filters-actions-top {
        justify-content: stretch;
    }
    .filters-actions-top .btn {
        flex: 1;
    }
    .filter-grid.grid-3, .filter-grid.grid-2 {
        grid-template-columns: 1fr;
    }
    .filters-footer {
        flex-direction: column-reverse;
    }
    .filters-footer .btn {
        width: 100%;
    }
}

/* ==============================================
   Replay Card Redesign (Premium - Fixed)
   ============================================== */

.replay-card {
    display: block;
    position: relative;
    width: 100%;
    background: #141414; /* Fallback */
    background: rgba(20, 20, 20, 0.85);
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.replay-card:hover {
    transform: translateY(-2px);
    border-color: #404040;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.replay-card .wrapper {
    display: flex;
    flex-direction: row; /* Explicitly row */
    align-items: stretch;
    /* min-height removed to let image define height */
}

/* Image Container */
.replay-card .img-container {
    position: relative;
    width: 260px; /* Fixed width */
    flex-shrink: 0;
    overflow: hidden;
    background: #000;
    border-right: 1px solid #2a2a2a;
    aspect-ratio: 16 / 9; /* Enforce map aspect ratio */
}

.replay-card .img-container .map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: opacity 0.3s ease, transform 0.5s ease;
    display: block;
}

.replay-card:hover .img-container .map {
    opacity: 1;
    transform: scale(1.05);
}

.replay-card .img-container .tank {
    position: absolute;
    right: 5px;
    bottom: 5px;
    width: 140px; /* Slightly smaller to fit better */
    height: auto;
    object-fit: contain;
    z-index: 2;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
}

/* Badges */
.replay-card .img-container .map-name {
    position: absolute;
    top: 8px;
    left: 8px;
    background: transparent !important;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 0 !important;
    border-radius: 0;
    z-index: 3;
    text-transform: uppercase;
    pointer-events: none;
    border: none !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    -webkit-font-smoothing: antialiased;
}

.replay-card .img-container .name {
    position: absolute;
    bottom: 8px;
    left: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
    z-index: 3;
    background: transparent !important;
    padding: 0 !important;
    pointer-events: none;
}

/* Details Section */
.replay-card .details {
    flex: 1;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0; /* Prevent flex child overflow */
}

.replay-card .title {
    font-size: 16px;
    font-weight: 700;
    color: #f0f0f0;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.replay-card .upload-info {
    font-size: 12px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

/* Stats Grid */
.replay-card .table {
    display: flex; /* Changed from grid to flex for better control */
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.replay-card .cell {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 32px;
}

.replay-card .cell img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.replay-card .cell span {
    font-family: monospace;
    font-size: 13px;
    color: #ccc;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .replay-card .wrapper {
        flex-direction: column;
        min-height: auto;
    }
    
    .replay-card .img-container {
        width: 100%;
        height: 140px;
        border-right: none;
        border-bottom: 1px solid #2a2a2a;
    }
    
    .replay-card .details {
        padding: 12px;
    }
    
    .replay-card .table {
        gap: 6px;
    }
    
    .replay-card .cell {
        flex: 1 0 auto; /* Grow to fill space */
        justify-content: center;
    }
}

/* Sorting Buttons (Matching Card Design) */
.sorters .btn {
    background: rgba(20, 20, 20, 0.85);
    border: 1px solid #2a2a2a;
    color: #e6e6e6;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.sorters .btn:hover {
    background: #1a1a1a;
    border-color: #404040;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    color: #fff;
}

.sorters .btn.active {
    background: rgba(255, 107, 53, 0.15); /* Orange tint background */
    border-color: #ff6b35; /* Orange border */
    color: #fff;
    box-shadow: 0 0 0 1px #ff6b35, 0 4px 8px rgba(0, 0, 0, 0.3);
}

.sorters .btn img {
    opacity: 0.8;
    transition: opacity 0.2s;
}

.sorters .btn:hover img,
.sorters .btn.active img {
    opacity: 1;
}