* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    background: #121212;
    color: #e0e0e0;
    line-height: 1.6;
}

h1, h2, h3, .logo, .btn {
    font-family: 'Cinzel', serif;
    font-weight: 700;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: #c9a84c;
    transition: color 0.3s;
}

a:hover {
    color: #e5c87b;
}

/* Header */
header {
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #2a2a2a;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.8rem;
    color: #c9a84c;
    letter-spacing: 2px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    font-family: 'Cinzel', serif;
    font-weight: 500;
    color: #ccc;
    font-size: 0.95rem;
}

nav a:hover {
    color: #c9a84c;
}

nav a.nav-highlight {
    color: #c9a84c;
}

.nav-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #121212;
    background: #c9a84c;
    border-radius: 10px;
    vertical-align: middle;
    animation: nav-badge-pulse 2s ease-in-out infinite;
}

@keyframes nav-badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.5); }
    50% { box-shadow: 0 0 0 5px rgba(201, 168, 76, 0); }
}

.cs-empty {
    color: #999;
    font-style: italic;
}

.article-body .cs-leaderboard {
    display: table;
    table-layout: fixed;
    width: 440px;
    margin: 20px auto;
}

.cs-leaderboard th:nth-child(1),
.cs-leaderboard td:nth-child(1) {
    width: 90px;
}

.cs-leaderboard th:nth-child(2),
.cs-leaderboard td:nth-child(2) {
    width: 260px;
}

.cs-leaderboard th:nth-child(3),
.cs-leaderboard td:nth-child(3) {
    width: 90px;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #d3cdcd 0%, #2c2416 100%);
    text-align: center;
    padding: 100px 20px 80px;
    border-bottom: 3px solid #c9a84c;

    background-image: linear-gradient(rgba(15,10,5,0.6), rgba(15,10,5,0.6)), url("../images/hero-bg.75a79f17a649.jpg");
    background-size: cover;
    background-position: center 45%;
    background-repeat: no-repeat;
    min-height: 480px;
}

/* The probe URL below points at a real file on purpose: collectstatic's
   manifest storage resolves every url() it finds, and a placeholder like
   'a.webp' breaks the production build. */
@supports (background-image: image-set(url("../images/hero-bg.c4e321781d7d.webp") type('image/webp'))) {
    .hero {
        background-image: linear-gradient(rgba(15,10,5,0.6), rgba(15,10,5,0.6)),
            image-set(url("../images/hero-bg.c4e321781d7d.webp") type('image/webp'), url("../images/hero-bg.75a79f17a649.jpg") type('image/jpeg'));
    }
}

@media (max-width: 768px) {
    .hero {
        background-image: linear-gradient(rgba(15,10,5,0.6), rgba(15,10,5,0.6)), url("../images/hero-bg-mobile.8d6fa7eb66a5.jpg");
        background-position: center;
        min-height: 380px;
    }

    @supports (background-image: image-set(url("../images/hero-bg.c4e321781d7d.webp") type('image/webp'))) {
        .hero {
            background-image: linear-gradient(rgba(15,10,5,0.6), rgba(15,10,5,0.6)),
                image-set(url("../images/hero-bg-mobile.e9d7374970df.webp") type('image/webp'), url("../images/hero-bg-mobile.8d6fa7eb66a5.jpg") type('image/jpeg'));
        }
    }
}

.hero h1 {
    font-size: 3.5rem;
    color: #c9a84c;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 35px;
    color: #ccc;
}

.btn {
    display: inline-block;
    background: #c9a84c;
    color: #121212;
    padding: 14px 35px;
    font-size: 1rem;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 1px;
    transition: background 0.3s, transform 0.2s;
}

.btn:hover {
    background: #e5c87b;
    color: #000;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 20px;
    font-size: 0.85rem;
    background: #2a2a2a;
    color: #c9a84c;
    border: 1px solid #c9a84c;
    display: inline-block;
}

.btn-sm:hover {
    background: #c9a84c;
    color: #121212;
}

/* Sections */
.section {
    padding: 80px 0;
}

.section-alt {
    background: #181818;
}

.section h2 {
    font-size: 2.2rem;
    color: #c9a84c;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: #c9a84c;
}

.subtitle {
    color: #aaa;
    margin-bottom: 30px;
}

/* News grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.news-card {
    background: #1e1e1e;
    border: 1px solid #2a2a2a;
    padding: 25px;
    border-radius: 6px;
    transition: border-color 0.3s;
    display: block;
    color: inherit;
}

.news-card:hover {
    border-color: #c9a84c;
}

.news-date {
    font-size: 0.85rem;
    color: #c9a84c;
    margin-bottom: 10px;
    font-weight: 600;
}

.news-card h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: #f0f0f0;
}

.news-card p {
    color: #b0b0b0;
    margin-bottom: 15px;
}

.read-more {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Materials */
.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.material-card {
    background: #1e1e1e;
    padding: 30px 20px;
    text-align: center;
    border-radius: 6px;
    border: 1px solid #2a2a2a;
    transition: border-color 0.3s, transform 0.2s;
    color: #ccc;
    display: block;
}

.material-card:hover {
    border-color: #c9a84c;
    transform: translateY(-5px);
    color: #f0f0f0;
}

.material-card i {
    font-size: 2.2rem;
    color: #c9a84c;
    margin-bottom: 15px;
}

.material-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #f0f0f0;
}

.material-card p {
    font-size: 0.9rem;
    color: #aaa;
}

/* Links */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.link-card {
    background: #1e1e1e;
    padding: 25px 15px;
    text-align: center;
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-weight: 500;
    letter-spacing: 1px;
    border: 1px solid #2a2a2a;
    transition: all 0.3s;
    color: #ccc;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.link-card i {
    font-size: 1.8rem;
    color: #c9a84c;
}

.link-card:hover {
    background: #2a2a2a;
    border-color: #c9a84c;
    color: #f0f0f0;
}

/* Footer */
footer {
    background: #0a0a0a;
    text-align: center;
    padding: 30px 20px;
    color: #666;
    font-size: 0.85rem;
    border-top: 1px solid #222;
}

footer p {
    margin-bottom: 5px;
}

/* Tournaments list */
.tournaments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.tournament-card {
    background: #1e1e1e;
    border: 1px solid #2a2a2a;
    padding: 25px;
    border-radius: 6px;
    transition: border-color 0.3s, transform 0.2s;
    color: #ccc;
    text-decoration: none;
    display: block;
}

.tournament-card:hover {
    border-color: #c9a84c;
    transform: translateY(-3px);
    color: #f0f0f0;
}

.tournament-date {
    font-size: 0.85rem;
    color: #c9a84c;
    font-weight: 600;
}

.tournament-card h3 {
    margin: 10px 0 5px;
    font-family: 'Cinzel', serif;
    color: #f0f0f0;
}

.badge {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 12px;
    background: #c9a84c;
    color: #121212;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 3px;
    text-transform: uppercase;
}

.upcoming {
    opacity: 0.7;
}

.upcoming-badge {
    background: #555;
}

/* Идёт регистрация — самые "горячие" карточки, полная яркость и зелёный акцент */
.tournament-card.registration {
    opacity: 1;
    border-color: #4caf50;
}

.tournament-card.registration:hover {
    border-color: #6fcf73;
}

.badge.registration-badge {
    background: #4caf50;
    color: #0d1f0d;
}

/* Планируются — приглушённые, без даты регистрации, пунктирная рамка */
.tournament-card.planned {
    border-style: dashed;
}

.badge.planned-badge {
    background: #555;
    color: #e0e0e0;
}

/* Tournament single page */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    font-weight: 600;
    color: #c9a84c;
}

.divider {
    border: none;
    border-top: 1px solid #2a2a2a;
    margin: 30px 0;
}

/* Player details (accordion) */
.player-details {
    background: #1e1e1e;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
}

.player-details summary {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.player-details summary::-webkit-details-marker {
    display: none;
}

.player-details summary:hover {
    background: #252525;
}

.player-summary {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-name {
    font-weight: 600;
    color: #f0f0f0;
}

.player-army {
    font-style: italic;
    color: #aaa;
    font-size: 0.9rem;
}

.roster {
    padding: 0 20px 20px;
    background: #181818;
    border-top: 1px solid #2a2a2a;
}

.roster h4 {
    margin: 15px 0 5px;
    color: #c9a84c;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
}

.roster pre {
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background: #111;
    padding: 10px;
    border-radius: 4px;
    color: #ccc;
    margin-top: 5px;
}

/* Results table */
.bcp-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
}

.bcp-table th {
    background: #2c2416;
    color: #c9a84c;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 2px solid #c9a84c;
}

.bcp-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #2a2a2a;
    color: #ddd;
}

.bcp-table .rank {
    font-weight: 700;
    font-size: 1.1rem;
    color: #c9a84c;
}

.bcp-table .points {
    font-weight: 700;
    color: #e5c87b;
}

.bcp-table tbody tr:hover {
    background: #2a2a2a;
}

.win {
    color: #4caf50;
    font-weight: 700;
}

.loss {
    color: #f44336;
    font-weight: 700;
}

.draw {
    color: #ffb300;
    font-weight: 700;
}

.result-cell {
    width: 40px;
    text-align: center;
}

/* Unified participants+results table */
.player-name--toggle {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: #f0f0f0;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.player-name--toggle:hover {
    color: #c9a84c;
}

.roster-toggle-icon {
    font-size: 0.7rem;
    color: #c9a84c;
    transition: transform 0.2s;
}

.player-name--toggle[aria-expanded="true"] .roster-toggle-icon {
    transform: rotate(180deg);
}

.roster-row td {
    padding: 0;
    border-bottom: 1px solid #2a2a2a;
}

.roster-row .roster {
    padding: 15px 20px 20px;
    background: #181818;
}

.games-cell {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.game-score {
    font-weight: 700;
}

.record-cell {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: #ddd;
}

.team-cell {
    color: #c9a84c;
    font-weight: 600;
}

.bcp-table tr.team-group-start td {
    border-top: 2px solid #c9a84c;
}

/* Статистика по фракциям */
.stats-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 25px 0;
}

.stats-tab {
    background: #2a2a2a;
    color: #c9a84c;
    border: 1px solid #c9a84c;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.stats-tab:hover {
    background: rgba(201, 168, 76, 0.15);
}

.stats-tab.active {
    background: #c9a84c;
    color: #121212;
    font-weight: 600;
}

.stats-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.stat-bar-row {
    display: grid;
    grid-template-columns: 180px 1fr 110px;
    align-items: center;
    gap: 14px;
}

.stat-bar-label {
    font-size: 0.9rem;
    color: #ddd;
    text-align: right;
}

.stat-bar-track {
    background: #2a2a2a;
    border-radius: 4px;
    height: 20px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #8a6d1f, #c9a84c);
    transition: width 0.5s ease;
}

.stat-bar-value {
    font-size: 0.85rem;
    color: #c9a84c;
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .stat-bar-row {
        grid-template-columns: 100px 1fr 90px;
        gap: 8px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        height: auto;
        padding: 15px 0;
        gap: 10px;
    }
    nav ul {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    .hero h1 {
        font-size: 2.5rem;
    }
}

/* ===== Development Banner ===== */

.dev-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #d97706;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 20px;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
    animation: slideDown .35s ease;
}

.dev-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 auto;
}

.dev-banner-content i {
    font-size: 1.2rem;
}

.dev-banner-close {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    opacity: .85;
    transition: opacity .2s ease, transform .2s ease;
}

.dev-banner-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

.dev-banner.hidden {
    display: none;
}

body.banner-visible {
    padding-top: 58px;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .dev-banner {
        padding: 10px 15px;
    }

    .dev-banner-content {
        font-size: .9rem;
    }
}

.tournaments-section-title{
    color: #c9a84c;
    font-size: 1.3rem;
    margin: 40px 0 15px;
}

.tournaments-section-title:first-child{
    margin-top: 10px;
}
.rules-details{
    width: 100%;
    box-sizing: border-box;
    background: #1e1e1e;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    margin: 20px 0;
    overflow: hidden;
}

.rules-details summary{
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #c9a84c;
    font-weight: 600;
    transition: background .2s;
}

.rules-details summary::-webkit-details-marker{
    display: none;
}

.rules-details summary:hover{
    background: #252525;
}

.rules-details .toggle-icon{
    transition: transform .25s;
    font-size: .85rem;
}

.rules-details[open] .toggle-icon{
    transform: rotate(180deg);
}

.rules-body{
    width: 100%;
    box-sizing: border-box;
    padding: 5px 20px 20px;
    background: #181818;
    border-top: 1px solid #2a2a2a;
    color: #ddd;
    line-height: 1.7;
    overflow-x: auto;
}

.rules-body h2,
.rules-body h3{
    color: #c9a84c;
    margin: 20px 0 10px;
}

.rules-body ul,
.rules-body ol{
    margin: 0 0 15px 20px;
}

.rules-body p{
    margin-bottom: 12px;
}

.rules-body table{
    width: 100%;
    box-sizing: border-box;
    border-collapse: collapse;
    margin: 20px 0;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
}

.rules-body th{
    background: #2c2416;
    color: #c9a84c;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    padding: 10px 15px;
    text-align: center;
    border-bottom: 2px solid #c9a84c;
    white-space: nowrap;
}

.rules-body td{
    padding: 8px 15px;
    border-bottom: 1px solid #2a2a2a;
    color: #ddd;
}

.rules-body img{
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.rules-body tbody tr:hover{
    background: #212121;
}

.video-embed {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
}
.video-embed iframe {
  width: 100%;
  height: 100%;
  display: block;
}