:root {
    --bg-main: #0f1419;
    --bg-panel: #1a2332;
    --bg-panel-soft: #232f42;
    --border-color: #2d3a4f;
    --text-main: #e8edf4;
    --text-muted: #a8b8d0;
    --text-subtle: #8b9cb3;
    --accent: #5b8def;
    --accent-hover: #7aa3f5;
    --success: #3dd68c;
    --warning: #f5a623;
    --danger: #ef5350;
    --gold: #d4a843;
    --sidebar-width: 280px;
    --topbar-height: 56px;
}

*, *::before, *::after { box-sizing: border-box; }

body.app-body {
    margin: 0;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    color-scheme: dark;
    --bs-body-color: var(--text-main);
    --bs-secondary-color: var(--text-muted);
    --bs-tertiary-color: var(--text-subtle);
    --bs-emphasis-color: var(--text-main);
}

body.app-body .text-muted {
    color: var(--text-muted) !important;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* Sidebar */
.app-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform .2s;
}
.app-sidebar-brand {
    padding: 0.55rem 0.7rem 1.15rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
}

/* App logo */
.app-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    max-width: 100%;
}
.app-logo {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}
.app-sidebar-brand .app-logo-link {
    width: 100%;
}
.app-logo--sidebar {
    margin: 0;
}

/* Pulsing live logo — auth + sidebar */
.auth-logo-stage {
    position: relative;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
}

.auth-brand .auth-logo-stage {
    max-width: min(240px, 68vw);
    padding: 0.35rem 0 0.65rem;
}

.app-sidebar-brand .auth-logo-stage {
    max-width: 88%;
    padding: 0.1rem 0 0.55rem;
    overflow: hidden;
}

.app-sidebar-brand .auth-logo-core {
    animation: none;
}

.app-sidebar-brand .auth-logo-core .app-logo {
    max-height: 86px;
    animation: auth-logo-heartbeat-sidebar 3s ease-in-out infinite;
}

.app-sidebar-brand .auth-logo-aura {
    filter: blur(16px);
}

.app-sidebar-brand .auth-logo-aura--gold {
    width: 64%;
}

.app-sidebar-brand .auth-logo-aura--blue {
    width: 76%;
}

.app-sidebar-brand .auth-logo-ring--outer {
    width: 86%;
    border-width: 1px;
}

.app-sidebar-brand .auth-logo-ring--mid {
    width: 72%;
}

.app-sidebar-brand .auth-logo-ring--inner {
    width: 58%;
}

.app-sidebar-brand .auth-logo-orbit {
    width: 90%;
    opacity: 0.5;
}

.app-sidebar-nav { flex: 1; overflow-y: auto; padding: 0.5rem 0 0.75rem; }
.app-logo-text {
    font-weight: 700;
    font-size: .95rem;
    color: var(--gold);
    letter-spacing: .03em;
}
.app-sidebar-nav .nav-link {
    color: var(--text-muted);
    padding: .55rem 1.25rem;
    font-size: .875rem;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.app-sidebar-nav .nav-link:hover { color: var(--text-main); background: var(--bg-panel-soft); }
.app-sidebar-nav .nav-link.active {
    color: var(--accent);
    background: rgba(91, 141, 239, .08);
    border-left-color: var(--accent);
    font-weight: 600;
}
.nav-icon { opacity: .7; width: 1.1rem; text-align: center; }
.nav-section {
    padding: .85rem 1.25rem .35rem;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-subtle);
}

/* Main wrapper */
.app-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.app-topbar {
    height: var(--topbar-height);
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}
.app-topbar-user { color: var(--text-muted); font-size: .875rem; }
.app-topbar-actions { display: flex; align-items: center; gap: .75rem; }

.lang-switcher { margin: 0; }
.lang-switcher-flags {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-panel-soft);
}
.lang-switcher-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.35rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.72;
    transition: opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.lang-switcher-flag:hover {
    opacity: 1;
    background: rgba(91, 141, 239, 0.08);
    border-color: rgba(91, 141, 239, 0.25);
}
.lang-switcher-flag.is-active {
    opacity: 1;
    border-color: var(--accent);
    background: rgba(91, 141, 239, 0.16);
    box-shadow: 0 0 0 1px rgba(91, 141, 239, 0.2);
}
.lang-switcher-flag:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(91, 141, 239, 0.35);
}

/* Content */
.app-content { padding: 1.5rem; flex: 1; }
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; margin: 0; }
.page-header .subtitle { color: var(--text-muted); font-size: .875rem; margin-top: .25rem; }

/* Panels & cards */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}
.panel-header {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: .9rem;
    color: var(--text-main);
}
.panel-header .panel-hint,
.panel-header small {
    color: var(--text-muted);
    font-weight: 400;
    font-size: .8rem;
    opacity: 1;
}
.panel-body { padding: 1rem; }

.stat-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    height: 100%;
}
.stat-card-value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; color: var(--text-main); }
.stat-card-label { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; text-transform: uppercase; letter-spacing: .04em; }
.stat-card-meta { font-size: .75rem; color: var(--text-muted); margin-top: .5rem; }
a .stat-card { transition: border-color .15s ease, transform .15s ease; }
a:hover .stat-card { border-color: var(--accent); transform: translateY(-1px); }
a .stat-card-label, a .stat-card-meta { color: var(--text-muted); }

a.stat-card, a.stat-card--link { display: block; text-decoration: none; color: inherit; }
.stat-card--link { transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; cursor: pointer; }
.stat-card--link:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
.stat-card--link .stat-card-value { color: var(--text-main); }

.stat-card--banner {
    position: relative;
    background-size: cover;
    background-position: center;
    border-color: rgba(255, 255, 255, 0.12);
    overflow: hidden;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.stat-card--banner .stat-card-value { font-size: 2.4rem; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65); }
.stat-card--banner .stat-card-label { color: rgba(255, 255, 255, 0.85); font-weight: 600; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }
.stat-card--win { border-color: rgba(80, 200, 120, 0.55); }
.stat-card--loss { border-color: rgba(239, 83, 80, 0.55); }
.stat-card--win .stat-card-value { color: #7ee2a8; }
.stat-card--loss .stat-card-value { color: #ff8a86; }

.chart-card { background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 8px; padding: 1rem; }
.chart-card-title { font-size: .9rem; font-weight: 600; margin-bottom: .75rem; }
.chart-card-hint {
    min-height: 0;
    margin: -0.35rem 0 0.5rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.chart-card--clickable .chart-card-hint:not(:empty) {
    display: block;
}
.chart-card-hint:empty {
    display: none;
}
.chart-card--clickable canvas {
    cursor: pointer;
}
.chart-empty { color: var(--text-muted); font-size: .875rem; text-align: center; padding: 2rem; }

/* Tables — dark theme with high contrast */
.table-dark-custom {
    --bs-table-bg: var(--bg-panel);
    --bs-table-color: var(--text-main);
    --bs-table-border-color: var(--border-color);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.045);
    --bs-table-striped-color: var(--text-main);
    --bs-table-hover-bg: rgba(91, 141, 239, 0.12);
    --bs-table-hover-color: var(--text-main);
    --bs-table-active-bg: rgba(91, 141, 239, 0.18);
    --bs-table-active-color: var(--text-main);
    color: var(--text-main);
    background-color: var(--bg-panel);
    margin-bottom: 0;
    font-size: .875rem;
}

.table-dark-custom > :not(caption) > * > * {
    color: var(--text-main) !important;
    border-color: var(--border-color);
    box-shadow: none;
    padding: .65rem .85rem;
    vertical-align: middle;
}

.table-dark-custom thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.table-dark-custom thead th {
    background-color: var(--bg-panel-soft) !important;
    color: var(--text-muted) !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .05em;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    padding: .75rem .85rem;
}

.table-dark-custom tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color .15s ease;
}

.table-dark-custom.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255, 255, 255, 0.045) !important;
    color: var(--text-main) !important;
}

.table-dark-custom.table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: var(--bg-panel) !important;
    color: var(--text-main) !important;
}

.table-dark-custom.table-hover > tbody > tr:hover > * {
    background-color: rgba(91, 141, 239, 0.12) !important;
    color: var(--text-main) !important;
}

.table-dark-custom a:not(.btn) {
    color: var(--accent);
    font-weight: 500;
}

.table-dark-custom a:not(.btn):hover {
    color: var(--accent-hover);
}

.table-dark-custom .text-muted-cell {
    color: var(--text-muted) !important;
}

.table-responsive-panel {
    max-height: 70vh;
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-panel);
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-panel);
}

.table-responsive-panel::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-responsive-panel::-webkit-scrollbar-track {
    background: var(--bg-panel);
}

.table-responsive-panel::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.table-responsive-panel::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Bootstrap list-group on dark bg */
.list-group-item.bg-transparent {
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

.list-group-item-action:hover {
    background-color: rgba(91, 141, 239, 0.1) !important;
    color: var(--text-main) !important;
}

/* Rating badges */
.rating-badge {
    display: inline-block;
    padding: .2em .55em;
    border-radius: 4px;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.rating-elite { background: rgba(212,168,67,.2); color: var(--gold); border: 1px solid rgba(212,168,67,.4); }
.rating-very_good { background: rgba(61,214,140,.15); color: var(--success); border: 1px solid rgba(61,214,140,.3); }
.rating-average { background: rgba(91,141,239,.15); color: var(--accent); border: 1px solid rgba(91,141,239,.3); }
.rating-weak { background: rgba(245,166,35,.15); color: var(--warning); border: 1px solid rgba(245,166,35,.3); }
.rating-very_weak { background: rgba(239,83,80,.15); color: var(--danger); border: 1px solid rgba(239,83,80,.3); }

.result-win { color: var(--success); }
.result-loss { color: var(--danger); }
.result-draw { color: var(--text-muted); }

/* War mode filter chips */
.war-mode-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.war-mode-filters-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    flex-shrink: 0;
}

.war-mode-filters-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.war-mode-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-panel-soft);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.war-mode-chip:hover {
    color: var(--text-main);
    border-color: rgba(91, 141, 239, 0.45);
    background: rgba(91, 141, 239, 0.08);
}

.war-mode-chip.is-active {
    color: var(--accent);
    border-color: rgba(91, 141, 239, 0.65);
    background: rgba(91, 141, 239, 0.14);
    box-shadow: 0 0 0 1px rgba(91, 141, 239, 0.2);
}

.war-mode-chip--table {
    padding: 0.15rem 0.55rem;
    font-size: 0.72rem;
}

.war-mode-icon {
    width: 1.15em;
    height: 1.15em;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.war-mode-chip--table {
    gap: 0.5rem;
}

.war-mode-chip--table .war-mode-icon {
    width: 35px;
    height: 35px;
}

.war-attack-type {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.war-attack-type--incoming {
    color: #f0b27a;
    background: rgba(240, 178, 122, 0.12);
    border: 1px solid rgba(240, 178, 122, 0.35);
}

.war-attack-type--outgoing {
    color: #7dcea0;
    background: rgba(125, 206, 160, 0.12);
    border: 1px solid rgba(125, 206, 160, 0.35);
}

.alliance-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
.alliance-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}
.player-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
.player-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}
.player-row--archived td {
    color: var(--text-muted);
}
.player-row--archived .player-link {
    color: var(--text-muted);
}
.player-row--archived .player-link:hover {
    color: var(--text-main);
}
.player-status-badge {
    display: inline-block;
    margin-left: 0.45rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
}
.player-status-badge--active {
    color: #7dcea0;
    background: rgba(125, 206, 160, 0.12);
    border: 1px solid rgba(125, 206, 160, 0.35);
}
.player-status-badge--archived {
    color: var(--text-muted);
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid var(--border-color);
}
.alliance-link--table {
    font-weight: 500;
}
h1 .alliance-link {
    color: var(--text-main);
}
h1 .alliance-link:hover {
    color: var(--accent);
}

/* ===== Alliances index (gaming redesign) ===== */
.alliance-stat {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    height: 100%;
    background:
        radial-gradient(circle at top right, rgba(91, 141, 239, 0.12), transparent 60%),
        var(--bg-panel);
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.alliance-stat:hover {
    border-color: rgba(91, 141, 239, 0.45);
    transform: translateY(-2px);
}
.alliance-stat__icon {
    font-size: 1.6rem;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}
.alliance-stat__body {
    min-width: 0;
    flex: 1;
}
.alliance-stat__value {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-main);
}
.alliance-stat__value--sm {
    font-size: 1.05rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.alliance-stat__label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-top: 0.15rem;
}
.alliance-stat__meta {
    margin-top: 0.4rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}
.alliance-stat--rate .alliance-stat__value {
    color: var(--gold);
}

.alliance-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.7rem;
    border: 1px solid var(--border-color);
}
.alliance-chip--win { color: #7ee2a8; border-color: rgba(80, 200, 120, 0.4); background: rgba(80, 200, 120, 0.1); }
.alliance-chip--loss { color: #ff8a86; border-color: rgba(239, 83, 80, 0.4); background: rgba(239, 83, 80, 0.1); }
.alliance-chip--draw { color: var(--text-muted); background: rgba(148, 163, 184, 0.1); }

/* Roster panel */
.alliance-roster__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}
.alliance-roster__title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
}
.alliance-roster__search {
    max-width: 240px;
    width: 100%;
}
.alliance-roster__table {
    border: none;
    border-radius: 0;
    max-height: none;
}

.alliance-roster-table__rank { width: 3rem; text-align: center; }
.alliance-roster-table__actions { width: 1%; white-space: nowrap; text-align: right; }
.alliance-roster-table td { vertical-align: middle; }

.alliance-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6rem;
    height: 1.6rem;
    padding: 0 0.35rem;
    border-radius: 6px;
    background: var(--bg-panel-soft);
    border: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.alliance-roster-table tbody tr:nth-child(1) .alliance-rank { color: var(--gold); border-color: rgba(212, 168, 67, 0.5); }
.alliance-roster-table tbody tr:nth-child(2) .alliance-rank { color: #cdd6e4; border-color: rgba(205, 214, 228, 0.4); }
.alliance-roster-table tbody tr:nth-child(3) .alliance-rank { color: #d8a273; border-color: rgba(216, 162, 115, 0.45); }

.alliance-identity {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}
.alliance-emblem {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    flex: 0 0 auto;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1rem;
    color: #fff;
    background: linear-gradient(145deg, hsl(var(--emblem-hue, 220), 55%, 45%), hsl(var(--emblem-hue, 220), 55%, 30%));
    border: 1px solid hsla(var(--emblem-hue, 220), 60%, 60%, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.alliance-identity__body { min-width: 0; }
.alliance-identity__name {
    display: block;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 22ch;
}
.alliance-identity:hover .alliance-identity__name { color: var(--accent); }
.alliance-identity__notes {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 26ch;
}

.alliance-wars-count {
    display: inline-block;
    min-width: 2rem;
    font-weight: 700;
    color: var(--text-main);
}

.alliance-record {
    display: inline-flex;
    gap: 0.25rem;
}
.alliance-record__seg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6rem;
    padding: 0.1rem 0.35rem;
    border-radius: 5px;
    font-weight: 700;
    font-size: 0.75rem;
}
.alliance-record__seg--win { color: #7ee2a8; background: rgba(80, 200, 120, 0.14); }
.alliance-record__seg--loss { color: #ff8a86; background: rgba(239, 83, 80, 0.14); }
.alliance-record__seg--draw { color: var(--text-muted); background: rgba(148, 163, 184, 0.12); }

.alliance-winrate {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
}
.alliance-winbar {
    position: relative;
    display: flex;
    flex: 1;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(239, 83, 80, 0.25);
}
.alliance-winbar--sm { margin-top: 0.5rem; background: rgba(255, 255, 255, 0.08); }
.alliance-winbar__fill { height: 100%; }
.alliance-winbar__fill--win,
.alliance-winbar--sm .alliance-winbar__fill { background: linear-gradient(90deg, #3dd68c, #7ee2a8); }
.alliance-winbar__fill--loss { background: linear-gradient(90deg, #ef5350, #ff8a86); }
.alliance-winrate__value {
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--text-main);
    min-width: 2.6rem;
    text-align: right;
}

.alliance-score { font-variant-numeric: tabular-nums; font-size: 0.85rem; }
.alliance-score__ours { color: #7ee2a8; font-weight: 700; }
.alliance-score__theirs { color: #ff8a86; font-weight: 700; }
.alliance-score__sep { color: var(--text-muted); margin: 0 0.15rem; }

.alliance-actions {
    display: inline-flex;
    gap: 0.3rem;
    align-items: center;
    justify-content: flex-end;
}
.alliance-actions .btn { padding: 0.2rem 0.5rem; line-height: 1.2; }

.alliance-merge-arrow {
    text-align: center;
    font-size: 1.2rem;
    color: var(--accent);
    margin: 0.35rem 0;
}
.alliance-merge-warning {
    color: #ff8a86;
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    background: rgba(239, 83, 80, 0.1);
    border: 1px solid rgba(239, 83, 80, 0.25);
}

@media (max-width: 720px) {
    .alliance-identity__name { max-width: 14ch; }
    .alliance-roster__search { max-width: 100%; }
}

/* Hero thumbnails */
.hero-thumb-cell {
    width: 52px;
    padding-right: 0 !important;
}
.hero-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-panel-soft);
    display: inline-block;
    vertical-align: middle;
}
.hero-thumb--lg {
    width: clamp(56px, 12vw, 80px);
    height: clamp(56px, 12vw, 80px);
}
.hero-thumb--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-muted);
}
.hero-thumb-cell .hero-thumb--placeholder {
    width: 40px;
    height: 40px;
}

/* Hero pair cards (hero detail) */
.hero-pairs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: 0.85rem;
}

.hero-pair-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.9rem 0.85rem 0.8rem;
    background: linear-gradient(160deg, var(--bg-panel-soft) 0%, var(--bg-panel) 100%);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.hero-pair-card:hover {
    border-color: rgba(91, 141, 239, 0.45);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    transform: translateY(-1px);
}

.hero-pair-rank {
    position: absolute;
    top: 0.55rem;
    right: 0.65rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-subtle);
}

.hero-pair-heroes {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0.4rem;
    padding-top: 0.15rem;
}

.hero-pair-slot {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    max-width: 46%;
}

.hero-profile-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.hero-profile-slot.hero-pair-slot {
    flex: 1 1 0;
    max-width: 46%;
}

.hero-profile-slot.hero-team-slot {
    flex: 0 0 auto;
    width: clamp(54px, 17%, 76px);
}

.hero-profile-slot__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    min-width: 0;
    color: inherit;
    text-decoration: none;
    border-radius: 8px;
    padding: 0.15rem;
    transition: color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.hero-profile-slot__link:hover,
.hero-profile-slot__link:focus-visible {
    color: var(--accent);
    background: rgba(91, 141, 239, 0.08);
    transform: translateY(-2px);
    outline: none;
}

.hero-profile-slot__link:hover .hero-thumb,
.hero-profile-slot__link:focus-visible .hero-thumb {
    box-shadow: 0 6px 18px rgba(91, 141, 239, 0.35);
}

.hero-profile-slot__label {
    width: 100%;
    text-align: center;
    word-break: break-word;
}

.hero-thumb--pair {
    width: clamp(48px, 14vw, 64px);
    height: clamp(48px, 14vw, 64px);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.hero-pair-slot .hero-thumb--placeholder {
    width: clamp(48px, 14vw, 64px);
    height: clamp(48px, 14vw, 64px);
    font-size: 1.35rem;
}

.hero-pair-label {
    width: 100%;
    text-align: center;
    font-size: 0.72rem;
    line-height: 1.25;
    word-break: break-word;
}

.hero-pair-label .hero-tip-label {
    border-bottom: none;
}

.hero-pair-plus {
    flex-shrink: 0;
    align-self: center;
    margin-top: clamp(14px, 4vw, 22px);
    color: var(--gold);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 0 12px rgba(212, 168, 67, 0.35);
}

.hero-pair-footer {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.35rem;
    padding-top: 0.55rem;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

.hero-pair-count {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.hero-pair-count-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

@media (max-width: 480px) {
    .hero-pairs-grid {
        grid-template-columns: 1fr;
    }
}

/* Best team cards (hero detail) */
.hero-teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 0.85rem;
}

.hero-team-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 0.9rem 0.85rem 0.8rem;
    background: linear-gradient(160deg, var(--bg-panel-soft) 0%, var(--bg-panel) 100%);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.hero-team-card:hover {
    border-color: rgba(91, 141, 239, 0.45);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    transform: translateY(-1px);
}

.hero-team-heroes {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
    gap: 0.2rem 0.15rem;
    padding: 0.15rem 0.25rem 0;
}

.hero-team-slot {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    gap: 0.32rem;
    width: clamp(54px, 17%, 76px);
    min-width: 0;
}

.hero-thumb--team {
    width: clamp(42px, 11vw, 54px);
    height: clamp(42px, 11vw, 54px);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.hero-team-slot .hero-thumb--placeholder {
    width: clamp(42px, 11vw, 54px);
    height: clamp(42px, 11vw, 54px);
    font-size: 1.1rem;
}

.hero-team-label {
    width: 100%;
    text-align: center;
    font-size: 0.68rem;
    line-height: 1.2;
    word-break: break-word;
}

.hero-team-label .hero-tip-label {
    border-bottom: none;
}

.hero-team-plus {
    flex-shrink: 0;
    align-self: center;
    margin-top: clamp(10px, 3vw, 16px);
    color: var(--gold);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 0 12px rgba(212, 168, 67, 0.35);
}

.hero-team-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding-top: 0.55rem;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

.hero-team-meta {
    min-width: 0;
}

.hero-team-score-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

.hero-team-score {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.hero-team-score-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

@media (max-width: 480px) {
    .hero-teams-grid {
        grid-template-columns: 1fr;
    }
}

.hero-add-preview {
    display: inline-flex;
    padding: 0.5rem;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    background: var(--bg-panel-soft);
}

/* Hero add form */
.hero-form .form-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
}

.hero-form .input-group > .form-select {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.hero-form .input-group > .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding-inline: 0.75rem;
}

.hero-form-section {
    padding-top: 0.35rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--border-color);
}

.hero-form-actions {
    padding-top: 0.5rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--border-color);
}

.hero-image-upload__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hero-image-upload__zone {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 168px;
    padding: 1.25rem;
    border: 1px dashed rgba(91, 141, 239, 0.45);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(35, 47, 66, 0.95) 0%, rgba(26, 35, 50, 0.98) 100%);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.hero-image-upload__zone:hover,
.hero-image-upload__zone:focus-visible {
    border-color: var(--accent);
    background: rgba(35, 47, 66, 1);
    box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.12);
    outline: none;
}

.hero-image-upload__zone.is-dragover {
    border-color: var(--accent-hover);
    background: rgba(91, 141, 239, 0.08);
    box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.2);
}

.hero-image-upload__zone.is-filled {
    min-height: auto;
    padding: 1rem;
    border-style: solid;
    border-color: var(--border-color);
    cursor: default;
}

.hero-image-upload__zone.is-filled:hover {
    box-shadow: none;
}

.hero-image-upload__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    text-align: center;
    max-width: 28rem;
}

.hero-image-upload__icon {
    font-size: 1.75rem;
    line-height: 1;
    opacity: 0.9;
}

.hero-image-upload__title {
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 600;
}

.hero-image-upload__hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.hero-image-upload__browse {
    margin-top: 0.35rem;
    pointer-events: none;
}

.hero-image-upload__preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.hero-image-upload__preview .hero-thumb--lg {
    flex-shrink: 0;
    width: 96px;
    height: 96px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    object-fit: cover;
    background: var(--bg-main);
}

.hero-image-upload__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    min-width: 0;
}

.hero-image-upload__filename {
    color: var(--text-main);
    font-size: 0.875rem;
    font-weight: 500;
    word-break: break-all;
}

@media (max-width: 576px) {
    .hero-image-upload__preview {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Generic file upload (import etc.) */
.file-upload__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.file-upload__zone {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 148px;
    padding: 1.15rem;
    border: 1px dashed rgba(91, 141, 239, 0.45);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(35, 47, 66, 0.95) 0%, rgba(26, 35, 50, 0.98) 100%);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.file-upload__zone:hover,
.file-upload__zone:focus-visible {
    border-color: var(--accent);
    background: rgba(35, 47, 66, 1);
    box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.12);
    outline: none;
}

.file-upload__zone.is-dragover {
    border-color: var(--accent-hover);
    background: rgba(91, 141, 239, 0.08);
    box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.2);
}

.file-upload__zone.is-filled {
    min-height: auto;
    padding: 0.9rem 1rem;
    border-style: solid;
    border-color: var(--border-color);
    cursor: default;
}

.file-upload__zone.is-filled:hover {
    box-shadow: none;
}

.file-upload__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    text-align: center;
}

.file-upload__icon {
    font-size: 1.65rem;
    line-height: 1;
}

.file-upload__title {
    color: var(--text-main);
    font-size: 0.92rem;
    font-weight: 600;
}

.file-upload__hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.file-upload__browse {
    margin-top: 0.3rem;
    pointer-events: none;
}

.file-upload__selected {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.file-upload__file-icon {
    font-size: 1.35rem;
    line-height: 1;
    opacity: 0.9;
}

.file-upload__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    min-width: 0;
}

.file-upload__filename {
    color: var(--text-main);
    font-size: 0.875rem;
    font-weight: 500;
    word-break: break-all;
}

.form-control[type="file"] {
    color: var(--text-muted);
}

.form-control[type="file"]::file-selector-button {
    margin-right: 0.75rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-panel-soft);
    color: var(--text-main);
    cursor: pointer;
}

.form-control[type="file"]::file-selector-button:hover {
    border-color: var(--accent);
    background: rgba(91, 141, 239, 0.1);
}

/* Hero team pills */
.hero-team { display: flex; flex-wrap: wrap; gap: .25rem; }

.hero-team-heroes--inline {
    justify-content: flex-start;
    padding: 0;
    gap: 0.12rem 0.1rem;
}

.hero-team-slot--inline {
    width: clamp(44px, 12vw, 58px);
    gap: 0.22rem;
}

.hero-thumb--inline {
    width: clamp(34px, 9vw, 42px);
    height: clamp(34px, 9vw, 42px);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero-team-slot--inline .hero-thumb--placeholder {
    width: clamp(34px, 9vw, 42px);
    height: clamp(34px, 9vw, 42px);
    font-size: 0.95rem;
}

.hero-team-label--inline {
    font-size: 0.62rem;
    line-height: 1.15;
}

.hero-team-plus--inline {
    margin-top: clamp(8px, 2.5vw, 12px);
    font-size: 0.8rem;
}

/* Compact hero strip for war top-defense tables */
.hero-team-heroes.hero-team-heroes--table {
    display: inline-flex;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.1rem;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.05rem 0 !important;
    scrollbar-width: none;
}

.hero-team-formation {
    display: inline-grid;
    gap: 0.08rem;
    width: fit-content;
    max-width: 100%;
    line-height: 0;
}

.hero-team-formation__row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.08rem;
}

.hero-team-formation__row--solo {
    padding: 0;
}

.hero-team-slot.hero-team-slot--table {
    display: inline-flex;
    flex-direction: row;
    width: auto !important;
    flex: 0 0 auto;
    gap: 0;
    min-width: 0;
}

.hero-thumb--table {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    display: block;
}

.hero-team-slot--table .hero-thumb--placeholder {
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
}

.hero-team-plus.hero-team-plus--table {
    margin-top: 0 !important;
    align-self: center;
    font-size: 0.55rem;
    opacity: 0.55;
    flex-shrink: 0;
    line-height: 1;
}

.hero-tip--thumb {
    display: inline-flex;
    line-height: 0;
}

.hero-tip-popup-name {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
    line-height: 1.2;
}

/* Flat hero row for war top-defense tables (no formation, same row height as text) */
.war-defense-heroes {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0;
    max-width: 100%;
    min-height: 24px;
    height: auto;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 0.15rem 0;
}

.war-defense-heroes::-webkit-scrollbar {
    display: none;
}

.war-defense-heroes__item {
    display: block;
    flex: 0 0 auto;
    line-height: 0;
    margin: 0 0.5rem 0 0;
}

.war-defense-heroes__item:last-child {
    margin-right: 0;
}

.war-defense-heroes .hero-tip--war-defense {
    display: inline-block;
    cursor: pointer;
    line-height: 0;
    border-radius: 4px;
    transition: transform 0.12s ease;
}

.war-defense-heroes .hero-tip--war-defense:hover,
.war-defense-heroes .hero-tip--war-defense:focus-visible {
    transform: translateY(-1px);
}

.war-defense-heroes__thumb {
    display: block;
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.35);
    transition: box-shadow 0.12s ease;
}

.war-defense-heroes .hero-tip--war-defense:hover .war-defense-heroes__thumb,
.war-defense-heroes .hero-tip--war-defense:focus-visible .war-defense-heroes__thumb {
    box-shadow: 0 0 0 1px rgba(91, 141, 239, 0.55), 0 2px 8px rgba(0, 0, 0, 0.4);
}

.war-defense-heroes__thumb--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
    background: var(--bg-panel-soft);
    border: 1px solid var(--border-color);
    font-size: 0.6rem;
}

.war-top-defenses-table {
    width: 100%;
    table-layout: auto;
}

.war-top-defenses-table thead th {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.5rem 0.4rem;
    vertical-align: bottom;
    white-space: nowrap;
}

.war-top-defenses-table tbody td {
    padding: 0.45rem 0.4rem;
}

.war-top-defenses-table tbody tr {
    vertical-align: middle;
}

.war-top-defenses-table--best {
    table-layout: fixed;
}

.war-top-defenses-table--best tbody td {
    padding: 0.35rem 0.3rem;
}

.war-top-defenses-table__defender {
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.war-top-defenses-table__defender-link {
    color: var(--text-main);
    text-decoration: none;
}

.war-top-defenses-table__defender-link:hover {
    color: var(--accent);
}

.war-top-defenses-table__rank {
    width: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.war-top-defenses-table__name {
    min-width: 5.5rem;
    max-width: 9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.war-top-defenses-table__name a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.war-top-defenses-table__heroes {
    width: 6.5rem;
    text-align: left;
    padding-top: 0;
    padding-bottom: 0;
    vertical-align: middle;
}

.war-top-defenses-table--best .war-top-defenses-table__heroes {
    width: 32%;
}

.war-top-defenses-table--best .war-top-defenses-table__defender {
    width: 18%;
}

.war-top-defenses-table--best .war-top-defenses-table__score {
    width: 22%;
}

.war-top-defenses-table--best .war-top-defenses-table__num {
    width: 11%;
}

.war-top-defenses-table__num {
    width: 4rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.war-top-defenses-table__score {
    min-width: 5.5rem;
    white-space: nowrap;
}

.war-defense-score {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.3rem;
}

.war-defense-score__value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-main);
    font-size: 0.9rem;
}

.war-defense-score .rating-badge {
    font-size: 0.58rem;
    padding: 0.1rem 0.35rem;
    white-space: nowrap;
    line-height: 1.2;
}

@media (min-width: 1400px) {
    .war-defense-heroes__thumb,
    .war-defense-heroes__thumb--placeholder {
        width: 26px;
        height: 26px;
        max-width: 26px;
        max-height: 26px;
    }

    .war-defense-heroes__item {
        margin-right: 0.45rem;
    }
}

.hero-team-heroes.hero-team-heroes--table::-webkit-scrollbar {
    display: none;
}

.war-attacks-table__defender {
    min-width: 12rem;
}

/* War detail page — gaming header & arena */
.war-show-eyebrow {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.war-show-header h1 {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.war-show-hero.panel {
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(91, 141, 239, 0.28);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.35) inset,
        0 8px 32px rgba(0, 0, 0, 0.35),
        0 0 40px rgba(91, 141, 239, 0.08);
    position: relative;
}

.war-show-hero--win.panel {
    border-color: rgba(212, 168, 67, 0.45);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.35) inset,
        0 8px 32px rgba(0, 0, 0, 0.35),
        0 0 48px rgba(212, 168, 67, 0.12);
}

.war-show-hero--loss.panel {
    border-color: rgba(156, 80, 200, 0.45);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.35) inset,
        0 8px 32px rgba(0, 0, 0, 0.35),
        0 0 48px rgba(156, 80, 200, 0.12);
}

.war-show-arena__banner {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    width: min(340px, 72%);
    height: auto;
    transform: translate(-50%, -52%);
    pointer-events: none;
    object-fit: contain;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.55));
}

.war-show-hero--win .war-show-arena {
    background:
        linear-gradient(180deg, rgba(212, 168, 67, 0.1) 0%, transparent 50%),
        linear-gradient(90deg, rgba(91, 141, 239, 0.12) 0%, transparent 30%, transparent 70%, rgba(220, 90, 70, 0.14) 100%),
        rgba(0, 0, 0, 0.25);
}

.war-show-hero--loss .war-show-arena {
    background:
        linear-gradient(180deg, rgba(156, 80, 200, 0.1) 0%, transparent 50%),
        linear-gradient(90deg, rgba(91, 141, 239, 0.12) 0%, transparent 30%, transparent 70%, rgba(220, 90, 70, 0.14) 100%),
        rgba(0, 0, 0, 0.25);
}

.war-show-arena {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
    gap: 0;
    padding: 0;
    background:
        linear-gradient(180deg, rgba(91, 141, 239, 0.09) 0%, transparent 45%),
        linear-gradient(90deg, rgba(91, 141, 239, 0.12) 0%, transparent 30%, transparent 70%, rgba(220, 90, 70, 0.14) 100%),
        rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.war-show-arena::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.014) 10px,
        rgba(255, 255, 255, 0.014) 11px
    );
    pointer-events: none;
}

.war-show-arena__side {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 1.15rem 0.85rem;
    text-align: center;
    min-width: 0;
}

.war-show-arena__side--us {
    border-right: 1px solid rgba(91, 141, 239, 0.18);
}

.war-show-arena__side--enemy {
    border-left: 1px solid rgba(220, 90, 70, 0.2);
}

.war-show-arena__side--has-emblem {
    overflow: hidden;
}

.war-show-arena__side-bg {
    position: absolute;
    inset: -28%;
    z-index: 0;
    background-image: var(--arena-emblem-url);
    background-size: cover;
    background-position: center;
    opacity: 0.34;
    filter: blur(2px) saturate(1.2);
    pointer-events: none;
}

.war-show-arena__side-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(8, 10, 16, 0.5) 0%, rgba(220, 90, 70, 0.32) 100%),
        linear-gradient(90deg, transparent 0%, rgba(8, 10, 16, 0.5) 100%);
}

.war-show-arena__side--has-emblem > *:not(.war-show-arena__side-bg) {
    position: relative;
    z-index: 1;
}

.war-show-arena__emblem {
    font-size: 1.5rem;
    line-height: 1;
    filter: drop-shadow(0 0 10px rgba(91, 141, 239, 0.5));
}

.war-show-arena__emblem--enemy {
    filter: drop-shadow(0 0 10px rgba(220, 90, 70, 0.5));
}

.war-show-arena__tag {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.war-show-arena__score {
    font-size: 2rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: #9ec0ff;
    text-shadow: 0 0 20px rgba(91, 141, 239, 0.4);
}

.war-show-arena__score--enemy {
    color: #ffb09a;
    text-shadow: 0 0 20px rgba(220, 90, 70, 0.35);
}

.war-show-arena__result {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.war-show-arena__opponent {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
    max-width: 100%;
}

.war-show-arena__alliance-link {
    color: #ffb09a;
    text-decoration: none;
    text-shadow: 0 0 18px rgba(220, 90, 70, 0.35);
}

.war-show-arena__alliance-link:hover {
    color: #ffd0c4;
}

.war-show-arena__center {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1rem 1.25rem;
    min-width: 8rem;
}

.war-show-arena__vs {
    font-size: 1.85rem;
    font-weight: 900;
    font-style: italic;
    letter-spacing: 0.1em;
    line-height: 1;
    color: var(--gold);
    text-shadow:
        0 0 14px rgba(212, 168, 67, 0.55),
        0 2px 0 rgba(0, 0, 0, 0.5);
    animation: defense-vs-pulse 2.5s ease-in-out infinite;
}

.war-show-arena__mode {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.7rem;
    border-radius: 4px;
    border: 1px solid rgba(212, 168, 67, 0.45);
    background: linear-gradient(180deg, rgba(212, 168, 67, 0.22) 0%, rgba(212, 168, 67, 0.08) 100%);
    color: #f5d78a;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 0 0 12px rgba(212, 168, 67, 0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.war-show-arena__mode:hover {
    color: #fff0c8;
    transform: translateY(-1px);
    box-shadow: 0 0 16px rgba(212, 168, 67, 0.3);
}

.war-mode-info {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.war-mode-info:hover {
    border-color: rgba(212, 168, 67, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 40px rgba(212, 168, 67, 0.08);
}

.war-mode-info__icon {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: radial-gradient(ellipse at center, rgba(212, 168, 67, 0.14) 0%, transparent 70%);
}

.war-mode-info__icon img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5));
}

.war-mode-info__body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    flex: 1;
}

.war-mode-info__eyebrow {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 700;
}

.war-mode-info__title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #f5d78a;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.war-mode-info__raw {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

.war-mode-info__desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.war-mode-info__cta {
    flex-shrink: 0;
    align-self: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

@media (max-width: 640px) {
    .war-mode-info {
        flex-wrap: wrap;
    }
    .war-mode-info__cta {
        width: 100%;
    }
}

.war-show-arena__date,
.war-show-arena__attacks {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.war-show-arena__attacks {
    font-variant-numeric: tabular-nums;
    color: var(--text-main);
    opacity: 0.85;
}

@media (max-width: 767.98px) {
    .war-show-arena {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .war-show-arena__side--us {
        border-right: 0;
        border-bottom: 1px solid rgba(91, 141, 239, 0.18);
    }

    .war-show-arena__side--enemy {
        border-left: 0;
        border-top: 1px solid rgba(220, 90, 70, 0.2);
    }

    .war-show-arena__center {
        border-top: 1px solid rgba(212, 168, 67, 0.15);
        border-bottom: 1px solid rgba(212, 168, 67, 0.15);
        padding: 0.75rem 1rem;
    }

    .war-show-arena__score {
        font-size: 1.65rem;
    }
}

/* War detail panels */
.war-show-panel.panel {
    border: 1px solid rgba(91, 141, 239, 0.18);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.war-show-panel__head {
    padding: 0.85rem 1rem 0.65rem;
    border-bottom: 1px solid rgba(91, 141, 239, 0.12);
    background: linear-gradient(180deg, rgba(91, 141, 239, 0.06) 0%, transparent 100%);
}

.war-show-panel__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.war-show-panel__hint {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.war-show-panel__table {
    padding: 0;
}

.war-top-defenses-panels .war-show-panel {
    height: 100%;
}

.war-top-defenses-table__name .attacker-link {
    color: #ffb09a;
    font-weight: 600;
}

.war-top-defenses-table__name .attacker-link:hover {
    color: #ffd0c4;
}

/* Rich hero strip (defenses table) */
.war-defense-heroes--rich {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5rem 0.65rem;
    min-height: 52px;
    padding: 0.35rem 0;
    overflow: visible;
}

.war-defense-heroes--rich .war-defense-heroes__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    margin: 0;
    flex: 0 0 auto;
    max-width: 3.5rem;
}

.war-defense-heroes--rich .war-defense-heroes__thumb,
.war-defense-heroes--rich .war-defense-heroes__thumb--placeholder {
    width: 36px;
    height: 36px;
    max-width: 36px;
    max-height: 36px;
    border-radius: 6px;
}

.war-defense-heroes--rich .hero-tip--war-rich .war-defense-heroes__thumb {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4);
}

.war-defense-heroes--rich .hero-tip--war-rich:hover .war-defense-heroes__thumb,
.war-defense-heroes--rich .hero-tip--war-rich:focus-visible .war-defense-heroes__thumb {
    box-shadow: 0 0 0 1px rgba(91, 141, 239, 0.6), 0 4px 12px rgba(0, 0, 0, 0.45);
}

.war-defense-heroes__name {
    display: block;
    max-width: 100%;
    font-size: 0.58rem;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.war-defense-heroes__name .hero-tip-label,
.war-defense-heroes__name a {
    color: inherit;
    text-decoration: none;
}

.war-defense-heroes__name a:hover .hero-tip-label,
.war-defense-heroes__name a:focus-visible .hero-tip-label {
    color: var(--accent);
}

.war-defense-heroes__item--dragon {
    line-height: 0;
}

.war-defense-heroes__thumb--dragon {
    box-shadow: 0 0 0 1px rgba(255, 140, 60, 0.4), 0 1px 4px rgba(0, 0, 0, 0.35);
}

.war-defense-heroes__thumb--dragon.war-defense-heroes__thumb--placeholder {
    font-size: 0.65rem;
    color: #ffd4b8;
    background: linear-gradient(135deg, rgba(255, 120, 40, 0.2), rgba(255, 77, 77, 0.1));
    border-color: rgba(255, 140, 60, 0.35);
}

.war-defense-heroes--rich .war-defense-heroes__thumb--dragon {
    box-shadow: 0 0 0 1px rgba(255, 140, 60, 0.45), 0 2px 6px rgba(0, 0, 0, 0.4);
}

.war-defense-heroes__name--dragon {
    color: #ffb89a;
}

.defense-dragon-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 140, 60, 0.35);
    background: linear-gradient(135deg, rgba(255, 120, 40, 0.16), rgba(255, 77, 77, 0.08));
    color: #ffd4b8;
    line-height: 1.2;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.defense-dragon-badge__icon {
    flex-shrink: 0;
    line-height: 1;
}

.defense-dragon-badge__thumb {
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(255, 140, 60, 0.45);
    background: rgba(0, 0, 0, 0.35);
}

.defense-dragon-badge--compact .defense-dragon-badge__thumb {
    width: 1.35rem;
    height: 1.35rem;
}

.defense-dragon-badge--rich .defense-dragon-badge__thumb {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 8px;
}

.defense-dragon-badge--showcase .defense-dragon-badge__thumb {
    width: 3rem;
    height: 3rem;
    border-radius: 10px;
}

.dragon-thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dragon-thumb--placeholder {
    line-height: 1;
}

.defense-dragon-badge__name {
    font-weight: 700;
    white-space: nowrap;
}

.defense-dragon-badge--compact {
    padding: 0.28rem 0.5rem;
    font-size: 0.68rem;
}

.defense-dragon-badge--compact .defense-dragon-badge__icon {
    font-size: 0.85rem;
}

.defense-dragon-badge--rich {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    width: 3.5rem;
    min-height: 3.25rem;
    padding: 0.35rem 0.25rem;
    text-align: center;
}

.defense-dragon-badge--rich .defense-dragon-badge__icon {
    font-size: 1.15rem;
}

.defense-dragon-badge--rich .defense-dragon-badge__name {
    font-size: 0.58rem;
    line-height: 1.15;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.defense-dragon-badge--showcase {
    padding: 0.55rem 0.75rem;
    font-size: 0.82rem;
    border-radius: 10px;
    box-shadow: 0 0 18px rgba(255, 120, 40, 0.18);
}

.defense-dragon-badge--showcase .defense-dragon-badge__icon {
    font-size: 1.2rem;
}

.defense-showcase__slot--dragon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* War defenses main table */
.war-defenses-table thead th {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.55rem 0.5rem;
    vertical-align: bottom;
    white-space: nowrap;
}

.war-defenses-table tbody td {
    padding: 0.55rem 0.5rem;
    vertical-align: middle;
}

.war-defenses-table__defender-link {
    color: var(--text-main);
    font-weight: 600;
    text-decoration: none;
}

.war-defenses-table__defender-link:hover {
    color: var(--accent);
}

.war-defenses-table__heroes {
    min-width: 14rem;
    width: 28%;
}

.war-defenses-table__num {
    width: 4rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.war-defenses-table__score {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.war-defenses-table__action {
    width: 5rem;
    text-align: right;
    white-space: nowrap;
}

.war-attacks-table thead th {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.war-attacks-table tbody td {
    vertical-align: middle;
    padding: 0.45rem 0.4rem;
}

.war-attacks-table tbody td {
    font-size: 0.95rem;
}

.war-attacks-table .attacker-link,
.war-attacks-table .enemy-link,
.war-attacks-table .opponent-link,
.war-attacks-table .player-link {
    font-weight: 600;
    font-size: 0.95rem;
}

/* War attack showcase — avg attack stats */
.war-attack-showcase {
    position: relative;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(91, 141, 239, 0.24);
    background:
        radial-gradient(ellipse 70% 80% at 0% 50%, rgba(91, 141, 239, 0.12), transparent 55%),
        radial-gradient(ellipse 50% 60% at 100% 20%, rgba(212, 168, 67, 0.08), transparent 50%),
        rgba(0, 0, 0, 0.2);
}

.war-attack-showcase__glow {
    position: absolute;
    inset: -40% auto auto 10%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(91, 141, 239, 0.18), transparent 70%);
    pointer-events: none;
    animation: war-attack-glow-drift 8s ease-in-out infinite alternate;
}

@keyframes war-attack-glow-drift {
    from { transform: translate(0, 0); opacity: 0.7; }
    to { transform: translate(24px, 12px); opacity: 1; }
}

.war-attack-showcase__layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(14rem, 1fr) minmax(0, 2fr);
    gap: 1rem 1.5rem;
    padding: 1rem 1.25rem;
}

.war-attack-showcase__hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
}

.war-attack-showcase__eyebrow {
    margin: 0 0 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
}

.war-attack-showcase__score-ring {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    margin-bottom: 0.25rem;
}

.war-attack-showcase__score-value {
    font-size: 2.25rem;
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: #b8d4ff;
    text-shadow:
        0 0 24px rgba(91, 141, 239, 0.55),
        0 2px 0 rgba(0, 0, 0, 0.45);
}

.war-attack-showcase__score-unit {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.war-attack-showcase__title {
    margin: 0 0 0.2rem;
    font-size: 0.95rem;
    font-weight: 800;
}

.war-attack-showcase__hint {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    max-width: 18rem;
    line-height: 1.3;
}

.war-attack-showcase__delta {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    border: 1px solid transparent;
}

.war-attack-showcase__delta--up {
    color: #3dd68c;
    background: rgba(61, 214, 140, 0.1);
    border-color: rgba(61, 214, 140, 0.25);
}

.war-attack-showcase__delta--down {
    color: #ef5350;
    background: rgba(239, 83, 80, 0.1);
    border-color: rgba(239, 83, 80, 0.25);
}

.war-attack-showcase__delta--even {
    color: var(--gold);
    background: rgba(212, 168, 67, 0.1);
    border-color: rgba(212, 168, 67, 0.25);
}

.war-attack-showcase__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.4rem;
    align-content: center;
}

.war-attack-showcase__stat {
    position: relative;
    padding: 0.5rem 0.5rem 0.5rem 2rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: border-color 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.war-attack-showcase__stat:hover {
    border-color: rgba(91, 141, 239, 0.28);
    transform: translateY(-1px);
}

.war-attack-showcase__stat-icon {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    line-height: 1;
    opacity: 0.85;
}

.war-attack-showcase__stat-value {
    display: block;
    font-size: 1rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    color: #e8eef7;
}

.war-attack-showcase__stat-label {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.war-attack-showcase__stat-meta {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    margin-top: 0;
    font-size: 0.65rem;
    font-weight: 700;
    color: #ffb09a;
}

.war-attack-showcase__trend {
    grid-column: 1 / -1;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.war-attack-showcase__trend-head {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}

.war-attack-showcase__trend-title {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.war-attack-showcase__trend-legend {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.war-attack-showcase__legend-dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 2px;
    background: #5b8def55;
    border: 1px solid #5b8def;
}

.war-attack-showcase__legend-dot--current {
    background: #d4a843cc;
    border-color: #d4a843;
    box-shadow: 0 0 10px rgba(212, 168, 67, 0.45);
}

.war-attack-showcase__trend .chart-card {
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin: 0;
}

@media (max-width: 992px) {
    .war-attack-showcase__layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .war-attack-showcase__stats {
        grid-template-columns: 1fr;
    }

    .war-attack-showcase__score-value {
        font-size: 2.4rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .war-attack-showcase__glow {
        animation: none;
    }

    .war-attack-showcase__stat:hover {
        transform: none;
    }
}

.war-attack-showcase__layout--detail {
    grid-template-columns: minmax(12rem, 1fr) minmax(0, 1.4fr);
}

.wars-attack-trend {
    padding: 1.1rem 1.2rem 1.15rem;
    border: 1px solid rgba(91, 141, 239, 0.22);
    background:
        radial-gradient(ellipse 60% 70% at 100% 0%, rgba(91, 141, 239, 0.1), transparent 55%),
        rgba(0, 0, 0, 0.18);
}

.wars-attack-trend__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.wars-attack-trend__eyebrow {
    margin: 0 0 0.2rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
}

.wars-attack-trend__title {
    margin: 0 0 0.3rem;
    font-size: 1.15rem;
    font-weight: 800;
}

.wars-attack-trend__hint {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    max-width: 36rem;
}

.wars-attack-trend__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.wars-attack-trend__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.wars-attack-trend__dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 2px;
    border: 1px solid transparent;
}

.wars-attack-trend__dot--attack {
    background: #5b8def99;
    border-color: #5b8def;
}

.wars-attack-trend__dot--defense {
    background: #d4a84399;
    border-color: #d4a843;
    box-shadow: 0 0 8px rgba(212, 168, 67, 0.35);
}

.wars-attack-trend__dot--win {
    background: #3dd68c55;
    border-color: #3dd68c;
}

.wars-attack-trend__dot--loss {
    background: #ef535055;
    border-color: #ef5350;
}

.wars-attack-trend__dot--other {
    background: #5b8def55;
    border-color: #5b8def;
}

.wars-attack-trend .chart-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin: 0;
}

.wars-attack-trend .chart-card > div[style] {
    height: 240px !important;
}

@media (max-width: 768px) {
    .wars-attack-trend__head {
        flex-direction: column;
    }
}

/* War timeline — score progression module */
.war-timeline {
    padding: 1.25rem 1.35rem 1.35rem;
    border: 1px solid rgba(91, 141, 239, 0.22);
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(91, 141, 239, 0.1), transparent 70%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, transparent 40%);
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.war-timeline--ready {
    opacity: 1;
    transform: translateY(0);
}

.war-timeline__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.war-timeline__eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.2rem;
}

.war-timeline__title {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0 0 0.35rem;
    letter-spacing: -0.02em;
}

.war-timeline__hint {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-muted);
    max-width: 42rem;
}

.war-timeline__head-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.war-timeline__badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    letter-spacing: 0.03em;
}

.war-timeline__badge--us {
    background: rgba(91, 141, 239, 0.18);
    color: #9ec0ff;
    border: 1px solid rgba(91, 141, 239, 0.35);
}

.war-timeline__badge--enemy {
    background: rgba(224, 112, 85, 0.16);
    color: #ffb09a;
    border: 1px solid rgba(224, 112, 85, 0.35);
}

.war-timeline__race {
    display: grid;
    grid-template-columns: minmax(5rem, 1fr) minmax(0, 3fr) minmax(5rem, 1fr);
    gap: 0.85rem;
    align-items: center;
    margin-bottom: 1rem;
}

.war-timeline__score {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.15rem;
}

.war-timeline__score-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.war-timeline__score-value {
    font-size: 1.65rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    transition: color 0.25s ease, text-shadow 0.25s ease;
}

.war-timeline__score--us .war-timeline__score-value {
    color: #9ec0ff;
    text-shadow: 0 0 16px rgba(91, 141, 239, 0.35);
}

.war-timeline__score--enemy .war-timeline__score-value {
    color: #ffb09a;
    text-shadow: 0 0 16px rgba(224, 112, 85, 0.3);
}

.war-timeline--playing .war-timeline__score-value {
    animation: war-timeline-score-pulse 0.45s ease;
}

@keyframes war-timeline-score-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.war-timeline__bar-zone {
    min-width: 0;
}

.war-timeline__bar {
    position: relative;
    display: flex;
    height: 1.1rem;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.war-timeline__bar-us,
.war-timeline__bar-enemy {
    height: 100%;
    transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.war-timeline__bar-us {
    background: linear-gradient(90deg, rgba(91, 141, 239, 0.55), #5b8def);
    box-shadow: 0 0 18px rgba(91, 141, 239, 0.45);
}

.war-timeline__bar-enemy {
    background: linear-gradient(90deg, #e07055, rgba(224, 112, 85, 0.55));
    box-shadow: 0 0 18px rgba(224, 112, 85, 0.35);
}

.war-timeline__bar-marker {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 3px;
    margin-left: -1.5px;
    background: var(--gold);
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(212, 168, 67, 0.8);
    transition: left 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.war-timeline__gap {
    margin: 0.45rem 0 0;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: color 0.25s ease;
}

.war-timeline__gap--us { color: #3dd68c; }
.war-timeline__gap--enemy { color: #ef5350; }
.war-timeline__gap--even { color: var(--gold); }

.war-timeline__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 1.15rem;
}

.war-timeline__stat {
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.war-timeline__stat-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.war-timeline__stat-value {
    font-size: 0.95rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.war-timeline__stat-value--us { color: #9ec0ff; }
.war-timeline__stat-value--enemy { color: #ffb09a; }

.war-timeline__chart-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
    padding: 0.2rem;
    border-radius: 0.55rem;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.war-timeline__chart-tab {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 0.45rem;
    padding: 0.38rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-muted, #9aa0a6);
    background: transparent;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.war-timeline__chart-tab:hover {
    color: #d8e2f0;
    background: rgba(255, 255, 255, 0.04);
}

.war-timeline__chart-tab.is-active {
    color: #e8edf5;
    background: rgba(91, 141, 239, 0.18);
    border-color: rgba(91, 141, 239, 0.35);
    box-shadow: 0 0 0 1px rgba(91, 141, 239, 0.12) inset;
}

.war-timeline__chart-tab:focus-visible {
    outline: 2px solid var(--accent, #5b8def);
    outline-offset: 2px;
}

.war-timeline__chart-panels {
    margin-bottom: 0.15rem;
}

.war-timeline__chart-panel {
    display: none;
}

.war-timeline__chart-panel.is-active {
    display: block;
}

.war-timeline__chart-card {
    padding: 0.85rem 0.9rem 0.75rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    height: 100%;
}

.war-timeline__chart-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.55rem;
}

.war-timeline__chart-wrap {
    position: relative;
    height: 220px;
}

.war-timeline__chart-wrap--gap {
    height: 180px;
}

.war-timeline__chart-wrap--momentum {
    height: 120px;
}

.war-timeline__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem;
    margin-top: 1.15rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.war-timeline__controls-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.war-timeline__btn--play {
    min-width: 6.5rem;
}

.war-timeline__scrubber-wrap {
    flex: 1;
    min-width: 12rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.war-timeline__scrubber {
    flex: 1;
    accent-color: var(--gold);
    cursor: pointer;
}

.war-timeline__scrub-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 6rem;
    text-align: right;
}

.war-timeline__attack-card {
    margin-top: 1rem;
    padding: 0;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.war-timeline__attack-card-inner {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    gap: 0.65rem 0.85rem;
    align-items: center;
    padding: 0.85rem 1rem;
}

.war-timeline__attack-order {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
}

.war-timeline__attack-line {
    margin: 0;
    font-weight: 700;
    font-size: 0.95rem;
}

.war-timeline__attack-meta {
    margin: 0.15rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.war-timeline__attack-points {
    font-size: 1.15rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
}

.war-timeline__attack-points--us {
    color: #9ec0ff;
    background: rgba(91, 141, 239, 0.15);
}

.war-timeline__attack-points--enemy {
    color: #ffb09a;
    background: rgba(224, 112, 85, 0.14);
}

.war-timeline__attack-card--pulse .war-timeline__attack-card-inner {
    animation: war-timeline-attack-in 0.35s ease;
}

@keyframes war-timeline-attack-in {
    from {
        opacity: 0.4;
        transform: translateX(8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    .war-timeline__race {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .war-timeline__stats {
        grid-template-columns: 1fr;
    }

    .war-timeline__attack-card-inner {
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }

    .war-timeline__scrubber-wrap {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .war-timeline,
    .war-timeline__bar-us,
    .war-timeline__bar-enemy,
    .war-timeline__bar-marker,
    .war-timeline--playing .war-timeline__score-value,
    .war-timeline__attack-card--pulse .war-timeline__attack-card-inner {
        animation: none !important;
        transition: none !important;
    }
}

/* Defense detail page */
.defense-show-eyebrow {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.defense-show-header h1 .player-link {
    color: var(--text-main);
    text-decoration: none;
    font-size: inherit;
    font-weight: inherit;
}

.defense-show-header h1 .player-link:hover {
    color: var(--accent);
}

.defense-show-war-link {
    color: var(--accent);
    text-decoration: none;
}

.defense-show-war-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.defense-war-banner {
    padding: 1rem 1.1rem;
}

/* Gaming-style war arena strip (inside defense showcase) */
.defense-showcase__arena {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
    gap: 0;
    padding: 0;
    border-bottom: 1px solid rgba(91, 141, 239, 0.22);
    background:
        linear-gradient(180deg, rgba(91, 141, 239, 0.07) 0%, transparent 42%),
        linear-gradient(90deg, rgba(91, 141, 239, 0.1) 0%, transparent 28%, transparent 72%, rgba(220, 90, 70, 0.12) 100%),
        rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.defense-showcase__arena::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 8px,
        rgba(255, 255, 255, 0.012) 8px,
        rgba(255, 255, 255, 0.012) 9px
    );
    pointer-events: none;
}

.defense-showcase__arena-side {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 1rem 0.75rem;
    text-align: center;
    min-width: 0;
}

.defense-showcase__arena-side--ally {
    border-right: 1px solid rgba(91, 141, 239, 0.15);
}

.defense-showcase__arena-side--enemy {
    border-left: 1px solid rgba(220, 90, 70, 0.18);
}

.defense-showcase__arena-emblem {
    font-size: 1.35rem;
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(91, 141, 239, 0.45));
}

.defense-showcase__arena-emblem--enemy {
    filter: drop-shadow(0 0 8px rgba(220, 90, 70, 0.45));
}

.defense-showcase__arena-tag {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.defense-showcase__arena-name {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.defense-showcase__arena-name .player-link {
    color: #9ec0ff;
    text-decoration: none;
}

.defense-showcase__arena-name .player-link:hover {
    color: #c5d9ff;
}

.defense-showcase__arena-name--enemy .defense-showcase__alliance-link {
    color: #ffb09a;
    font-size: 1.05rem;
    font-weight: 800;
    text-decoration: none;
    text-shadow: 0 0 18px rgba(220, 90, 70, 0.35);
}

.defense-showcase__arena-name--enemy .defense-showcase__alliance-link:hover {
    color: #ffd0c4;
}

.defense-showcase__arena-center {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.85rem 1.1rem;
    min-width: 7.5rem;
}

.defense-showcase__arena-vs {
    font-size: 1.65rem;
    font-weight: 900;
    font-style: italic;
    letter-spacing: 0.08em;
    line-height: 1;
    color: var(--gold);
    text-shadow:
        0 0 12px rgba(212, 168, 67, 0.55),
        0 2px 0 rgba(0, 0, 0, 0.5);
    animation: defense-vs-pulse 2.5s ease-in-out infinite;
}

@keyframes defense-vs-pulse {
    0%, 100% { transform: scale(1); opacity: 0.92; }
    50% { transform: scale(1.06); opacity: 1; }
}

.defense-showcase__mode-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 4px;
    border: 1px solid rgba(212, 168, 67, 0.45);
    background: linear-gradient(180deg, rgba(212, 168, 67, 0.22) 0%, rgba(212, 168, 67, 0.08) 100%);
    color: #f5d78a;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 0 0 12px rgba(212, 168, 67, 0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.defense-showcase__mode-badge {
    gap: 0.4rem;
}

.defense-showcase__mode-badge:hover {
    color: #fff0c8;
    transform: translateY(-1px);
    box-shadow: 0 0 16px rgba(212, 168, 67, 0.3);
}

.defense-showcase__mode-icon {
    width: 34px;
    height: 34px;
}

.defense-showcase__banner {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    z-index: 3;
    width: min(200px, 42%);
    height: auto;
    pointer-events: none;
    object-fit: contain;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.6));
}

.defense-showcase--win {
    border-color: rgba(80, 200, 120, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 42px rgba(80, 200, 120, 0.1);
}

.defense-showcase--loss {
    border-color: rgba(239, 83, 80, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 42px rgba(239, 83, 80, 0.1);
}

@media (max-width: 576px) {
    .defense-showcase__banner {
        position: static;
        display: block;
        width: 160px;
        margin: 1rem auto 0;
    }
}

.defense-showcase__war-pill {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.5rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(91, 141, 239, 0.35);
    background: rgba(91, 141, 239, 0.1);
    color: var(--text-main);
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.defense-showcase__war-pill:hover {
    background: rgba(91, 141, 239, 0.18);
    border-color: rgba(91, 141, 239, 0.55);
    color: #fff;
}

.defense-showcase__war-score {
    font-variant-numeric: tabular-nums;
    opacity: 0.9;
}

.defense-showcase__war-result {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

@media (max-width: 767.98px) {
    .defense-showcase__arena {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .defense-showcase__arena-side--ally {
        border-right: 0;
        border-bottom: 1px solid rgba(91, 141, 239, 0.15);
    }

    .defense-showcase__arena-side--enemy {
        border-left: 0;
        border-top: 1px solid rgba(220, 90, 70, 0.18);
    }

    .defense-showcase__arena-center {
        padding: 0.65rem 0.75rem;
        flex-direction: row;
        flex-wrap: wrap;
        min-width: 0;
    }

    .defense-showcase__arena-vs {
        font-size: 1.25rem;
    }
}

.defense-war-banner__grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem 1.5rem;
}

.defense-war-banner__item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.defense-war-banner__item--action {
    margin-left: auto;
}

.defense-war-banner__label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.defense-war-banner__value {
    font-size: 1rem;
    font-weight: 600;
}

.defense-war-banner__value .alliance-link {
    color: var(--text-main);
    text-decoration: none;
}

.defense-war-banner__value .alliance-link:hover {
    color: var(--accent);
}

.defense-showcase {
    position: relative;
    overflow: hidden;
    padding: 0;
}

.defense-showcase__glow {
    position: absolute;
    inset: -30% -10% auto;
    height: 70%;
    background: radial-gradient(ellipse at center, rgba(91, 141, 239, 0.14) 0%, transparent 68%);
    pointer-events: none;
    animation: defense-glow-pulse 4s ease-in-out infinite;
}

@keyframes defense-glow-pulse {
    0%, 100% { opacity: 0.65; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.04); }
}

.defense-showcase__inner {
    position: relative;
    padding: 1.75rem 1rem 1.25rem;
    text-align: center;
}

.defense-showcase__title {
    margin: 0 0 1rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.defense-showcase__formation {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
    gap: 0.25rem 0;
    max-width: 100%;
    overflow: visible;
    padding: 0 0.25rem;
    animation: defense-formation-in 0.55s ease-out both;
}

.defense-showcase__formation::-webkit-scrollbar {
    display: none;
}

@keyframes defense-formation-in {
    from { opacity: 0; transform: translateY(14px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.defense-showcase__slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
    width: clamp(64px, 12vw, 84px);
    animation: defense-slot-in 0.45s ease both;
    animation-delay: var(--slot-delay, 0s);
}

@keyframes defense-slot-in {
    from { opacity: 0; transform: translateY(10px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.defense-showcase__plus {
    align-self: flex-start;
    margin: calc(clamp(52px, 11vw, 68px) * 0.5 - 0.55em) 0.25rem 0;
    color: var(--gold);
    font-size: 1rem;
    font-weight: 700;
    opacity: 0.85;
    flex-shrink: 0;
    line-height: 1;
    text-shadow: 0 0 10px rgba(212, 168, 67, 0.35);
}

.defense-showcase__thumb-wrap {
    display: inline-block;
    line-height: 0;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    text-decoration: none;
    color: inherit;
}

.defense-showcase__thumb-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.hero-tip--showcase .hero-tip-popup {
    padding: 6px;
}

.hero-tip--showcase .hero-tip-popup img {
    width: 88px;
    height: 88px;
}

.defense-showcase__thumb {
    width: clamp(52px, 11vw, 68px);
    height: clamp(52px, 11vw, 68px);
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.defense-showcase__thumb-wrap:hover .defense-showcase__thumb,
.defense-showcase__thumb-wrap:focus-visible .defense-showcase__thumb,
.defense-showcase__thumb-wrap.is-tip-visible .defense-showcase__thumb {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 28px rgba(91, 141, 239, 0.35);
    filter: brightness(1.08);
}

.defense-showcase__thumb--empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-panel-soft);
    border: 1px dashed var(--border-color);
    color: var(--text-muted);
    font-size: 1.1rem;
}

.defense-showcase__label {
    width: 100%;
    text-align: center;
    font-size: 0.68rem;
    line-height: 1.2;
}

.defense-showcase__label .hero-tip-label {
    border-bottom: none;
    transition: color 0.15s ease;
}

.defense-showcase__label.hero-name-link:hover .hero-tip-label,
.defense-showcase__label.hero-name-link:focus-visible .hero-tip-label {
    color: var(--accent);
}

.defense-showcase__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.12);
}

@media (min-width: 768px) {
    .defense-showcase__stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.defense-showcase__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.85rem 0.5rem;
    text-align: center;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

@media (min-width: 768px) {
    .defense-showcase__stat {
        border-bottom: 0;
    }

    .defense-showcase__stat:last-child {
        border-right: 0;
    }
}

@media (max-width: 767.98px) {
    .defense-showcase__stat:nth-child(2n) {
        border-right: 0;
    }

    .defense-showcase__stat:nth-last-child(-n+2) {
        border-bottom: 0;
    }
}

.defense-showcase__stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.defense-showcase__stat-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.defense-showcase__stat-badge {
    margin-top: 0.15rem;
}

.attacker-link,
.enemy-link,
.opponent-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.attacker-link:hover,
.enemy-link:hover,
.opponent-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.defense-attacks-table thead th {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.defense-attacks-table tbody tr {
    vertical-align: middle;
}

.defense-attacks-table__order {
    width: 2.5rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.defense-attacks-table__points {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.defense-attacks-table__points-value {
    font-weight: 600;
}

.defense-attacks-table__points-value--high {
    color: #f0a060;
}

.defense-attacks-table__fail {
    text-align: center;
    width: 4.5rem;
}

.defense-attacks-table__fail-badge {
    display: inline-block;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: rgba(168, 184, 208, 0.12);
    color: var(--text-muted);
}

.defense-attacks-table__fail-badge--yes {
    background: rgba(220, 80, 80, 0.18);
    color: #f08080;
    border: 1px solid rgba(220, 80, 80, 0.35);
}

.defense-attacks-table__row--fail {
    background: rgba(220, 80, 80, 0.04) !important;
}

/* Defense stats legend / glossary */
.stats-legend-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.stats-legend-btn__icon {
    font-size: 0.95rem;
    line-height: 1;
}
.stats-legend-modal-body {
    padding-top: 0.25rem;
}
.stats-legend-modal-body .stats-legend__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 767px) {
    .stats-legend-modal-body .stats-legend__list {
        grid-template-columns: 1fr;
    }
    .stats-legend-btn__label {
        display: none;
    }
}
.stats-legend__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.stats-legend__icon {
    font-size: 1rem;
    line-height: 1;
}
.stats-legend__intro {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.stats-legend__list {
    display: grid;
    gap: 0.85rem;
    margin: 0;
}
@media (min-width: 768px) {
    .stats-legend__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem 1.5rem;
    }
    .stats-legend--compact .stats-legend__list {
        grid-template-columns: 1fr;
    }
}
.stats-legend__item {
    margin: 0;
    padding: 0.75rem 0.85rem;
    border-radius: 8px;
    background: var(--bg-panel-soft);
    border: 1px solid var(--border-color);
}
.stats-legend__item dt {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text-main);
    margin-bottom: 0.35rem;
}
.stats-legend__item dd {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-muted);
}
.stats-legend__formula {
    display: block;
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    font-size: 0.76rem;
    color: var(--accent);
    word-break: break-word;
}

.hero-pill {
    background: var(--bg-panel-soft);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: .1rem .4rem;
    font-size: .75rem;
    color: var(--text-main);
}

.hero-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: default;
}

.hero-name-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.hero-tip.hero-name-link {
    cursor: pointer;
}

.hero-name-link:hover .hero-tip-label,
.hero-name-link:focus-visible .hero-tip-label {
    color: var(--accent);
}

.hero-pill.hero-name-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.hero-tip-label {
    border-bottom: 1px dotted rgba(168, 184, 208, 0.45);
}

.hero-tip:hover .hero-tip-label,
.hero-tip:focus-visible .hero-tip-label {
    border-bottom-color: var(--accent-gold);
    color: var(--accent-gold);
}

.hero-tip-popup {
    position: fixed;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 10000;
    padding: 4px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
    transition: opacity .15s ease, visibility .15s ease;
}

.hero-tip-popup img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.hero-tip.is-tip-visible .hero-tip-popup,
.hero-tip-popup.is-tip-visible {
    opacity: 1;
    visibility: visible;
}

.hero-name-inline {
    background: transparent;
    border: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
    border-radius: 0;
}

.hero-name-title {
    background: transparent;
    border: none;
    padding: 0;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    border-radius: 0;
}

.hero-name-title .hero-tip-label {
    font-size: inherit;
    font-weight: inherit;
}

/* Forms */
.form-control, .form-select {
    background: var(--bg-panel-soft);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}
.form-control:focus, .form-select:focus {
    background: var(--bg-panel-soft);
    border-color: var(--accent);
    color: var(--text-main);
    box-shadow: 0 0 0 .2rem rgba(91,141,239,.2);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control[type="date"]::-webkit-calendar-picker-indicator,
.form-control[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(0.85);
    cursor: pointer;
}
.form-select option {
    background: var(--bg-panel);
    color: var(--text-main);
}

.filter-bar {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-outline-accent { border-color: var(--accent); color: var(--accent); background: transparent; }
.btn-outline-accent:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-outline-secondary { border-color: var(--border-color); color: var(--text-muted); background: transparent; }
.btn-outline-secondary:hover { background: var(--bg-panel-soft); border-color: var(--text-muted); color: var(--text-main); }
.btn-outline-danger { border-color: var(--danger); color: var(--danger); background: transparent; }

.badge-role { font-size: .7rem; text-transform: uppercase; }
.badge-admin { background: rgba(212,168,67,.2); color: var(--gold); }
.badge-mod { background: rgba(91,141,239,.2); color: var(--accent); }
.badge-user { background: rgba(139,156,179,.2); color: var(--text-muted); }

.status-completed { color: var(--success); }
.status-failed { color: var(--danger); }
.status-pending { color: var(--warning); }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state-icon { font-size: 2.5rem; opacity: .4; margin-bottom: .75rem; }

.search-highlight { background: rgba(212,168,67,.35); color: inherit; padding: 0 .1em; border-radius: 2px; }

.alert { border-radius: 8px; }
.alert-success { background: rgba(61,214,140,.1); border-color: rgba(61,214,140,.3); color: var(--success); }
.alert-danger { background: rgba(239,83,80,.1); border-color: rgba(239,83,80,.3); color: var(--danger); }

/* Auth layout — gaming portal */
.auth-body {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow-x: hidden;
    overflow-y: auto;
    background: #080b10;
    color: var(--text-main);
    color-scheme: dark;
    --bs-body-color: var(--text-main);
    --bs-secondary-color: var(--text-muted);
    --bs-tertiary-color: var(--text-subtle);
    --bs-emphasis-color: var(--text-main);
}

.auth-bg-glow {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(80px);
    opacity: 0.55;
}

@keyframes auth-pulse-blue {
    from { opacity: 0.4; transform: translateX(-50%) scale(1); }
    to { opacity: 0.65; transform: translateX(-50%) scale(1.08); }
}

@keyframes auth-pulse-gold {
    from { opacity: 0.28; transform: scale(1); }
    to { opacity: 0.48; transform: scale(1.1); }
}

.auth-bg-glow--blue {
    width: 420px;
    height: 420px;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(91, 141, 239, 0.35);
    animation: auth-pulse-blue 8s ease-in-out infinite alternate;
}

.auth-bg-glow--gold {
    width: 320px;
    height: 320px;
    bottom: -80px;
    right: -60px;
    background: rgba(212, 168, 67, 0.18);
    animation: auth-pulse-gold 8s ease-in-out infinite alternate;
    animation-delay: -4s;
}

.auth-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(91, 141, 239, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(91, 141, 239, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 15%, transparent 70%);
}

.auth-body .text-muted {
    color: var(--text-muted) !important;
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
}

.auth-card {
    position: relative;
    background: linear-gradient(160deg, rgba(22, 30, 44, 0.97) 0%, rgba(12, 16, 22, 0.99) 100%);
    border: 1px solid rgba(212, 168, 67, 0.45);
    border-radius: 6px;
    padding: 1.5rem 2rem 1.75rem;
    width: 100%;
    box-shadow:
        0 0 0 1px rgba(91, 141, 239, 0.12),
        0 0 48px rgba(91, 141, 239, 0.15),
        0 0 100px rgba(212, 168, 67, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.auth-corner {
    position: absolute;
    width: 18px;
    height: 18px;
    border-color: var(--gold);
    border-style: solid;
    opacity: 0.85;
    pointer-events: none;
}

.auth-corner--tl { top: 10px; left: 10px; border-width: 2px 0 0 2px; }
.auth-corner--tr { top: 10px; right: 10px; border-width: 2px 2px 0 0; }
.auth-corner--bl { bottom: 10px; left: 10px; border-width: 0 0 2px 2px; }
.auth-corner--br { bottom: 10px; right: 10px; border-width: 0 2px 2px 0; }

.app-logo--auth {
    margin: 0;
}

.auth-brand {
    text-align: center;
    margin-bottom: 0.35rem;
    padding-bottom: 0;
}

.auth-logo-core {
    position: relative;
    z-index: 4;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: auth-logo-float 5.5s ease-in-out infinite;
}

.auth-logo-core .app-logo-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0 auto;
}

.auth-logo-core .app-logo {
    width: auto;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    animation: auth-logo-heartbeat 2.8s ease-in-out infinite;
    will-change: transform, filter;
}

.auth-brand .auth-logo-core .app-logo {
    max-height: min(168px, 24vh);
}

.auth-logo-aura {
    position: absolute;
    left: 50%;
    top: 50%;
    translate: -50% -50%;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(28px);
}

.auth-logo-aura--gold {
    width: 72%;
    aspect-ratio: 1;
    background: radial-gradient(circle, rgba(212, 168, 67, 0.55) 0%, rgba(212, 168, 67, 0.15) 42%, transparent 72%);
    animation: auth-logo-aura-gold 3.2s ease-in-out infinite;
}

.auth-logo-aura--blue {
    width: 88%;
    aspect-ratio: 1;
    background: radial-gradient(circle, rgba(91, 141, 239, 0.35) 0%, rgba(91, 141, 239, 0.08) 45%, transparent 75%);
    animation: auth-logo-aura-blue 4.1s ease-in-out infinite;
    animation-delay: -1.4s;
}

.auth-logo-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    translate: -50% -50%;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    background: transparent;
}

.auth-logo-ring--outer {
    width: 94%;
    aspect-ratio: 1;
    border-width: 2px;
    border-color: rgba(212, 168, 67, 0.22);
    box-shadow:
        0 0 24px rgba(212, 168, 67, 0.12),
        inset 0 0 30px rgba(91, 141, 239, 0.06);
    animation: auth-logo-ring-pulse 3.6s ease-in-out infinite;
}

.auth-logo-ring--mid {
    width: 78%;
    aspect-ratio: 1;
    border-width: 1px;
    border-color: rgba(91, 141, 239, 0.35);
    animation: auth-logo-ring-pulse 2.6s ease-in-out infinite reverse;
    animation-delay: -0.8s;
}

.auth-logo-ring--inner {
    width: 62%;
    aspect-ratio: 1;
    border-width: 1px;
    border-style: dashed;
    border-color: rgba(212, 168, 67, 0.4);
    animation: auth-logo-ring-spin 18s linear infinite;
}

.auth-logo-orbit {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 102%;
    aspect-ratio: 1;
    translate: -50% -50%;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        transparent 300deg,
        rgba(212, 168, 67, 0.85) 318deg,
        rgba(91, 141, 239, 0.9) 336deg,
        transparent 360deg
    );
    mask: radial-gradient(circle, transparent 62%, #000 63%, #000 66%, transparent 67%);
    -webkit-mask: radial-gradient(circle, transparent 62%, #000 63%, #000 66%, transparent 67%);
    opacity: 0.75;
    animation: auth-logo-orbit-spin 6s linear infinite;
}

.auth-logo-shimmer {
    position: absolute;
    inset: 8% 6%;
    z-index: 5;
    pointer-events: none;
    overflow: hidden;
    border-radius: 12px;
    mask-image: radial-gradient(ellipse 72% 68% at 50% 50%, #000 35%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse 72% 68% at 50% 50%, #000 35%, transparent 78%);
}

.auth-logo-shimmer::after {
    content: '';
    position: absolute;
    top: -20%;
    left: -60%;
    width: 42%;
    height: 140%;
    background: linear-gradient(
        105deg,
        transparent 0%,
        rgba(255, 255, 255, 0.03) 35%,
        rgba(255, 255, 255, 0.22) 50%,
        rgba(212, 168, 67, 0.18) 55%,
        rgba(255, 255, 255, 0.03) 70%,
        transparent 100%
    );
    transform: skewX(-18deg);
    animation: auth-logo-shimmer-sweep 4.5s ease-in-out infinite;
}

@keyframes auth-logo-heartbeat {
    0%, 100% {
        transform: scale(1);
        filter:
            drop-shadow(0 0 16px rgba(212, 168, 67, 0.35))
            drop-shadow(0 0 36px rgba(91, 141, 239, 0.2))
            drop-shadow(0 6px 18px rgba(0, 0, 0, 0.55));
    }
    18% {
        transform: scale(1.035);
        filter:
            drop-shadow(0 0 28px rgba(212, 168, 67, 0.6))
            drop-shadow(0 0 52px rgba(91, 141, 239, 0.32))
            drop-shadow(0 0 72px rgba(212, 168, 67, 0.18))
            drop-shadow(0 8px 22px rgba(0, 0, 0, 0.5));
    }
    36% {
        transform: scale(1);
        filter:
            drop-shadow(0 0 18px rgba(212, 168, 67, 0.4))
            drop-shadow(0 0 40px rgba(91, 141, 239, 0.22))
            drop-shadow(0 6px 18px rgba(0, 0, 0, 0.55));
    }
    54% {
        transform: scale(1.045);
        filter:
            drop-shadow(0 0 32px rgba(212, 168, 67, 0.7))
            drop-shadow(0 0 64px rgba(91, 141, 239, 0.36))
            drop-shadow(0 0 88px rgba(212, 168, 67, 0.22))
            drop-shadow(0 8px 24px rgba(0, 0, 0, 0.45));
    }
    72% {
        transform: scale(1.015);
        filter:
            drop-shadow(0 0 22px rgba(212, 168, 67, 0.5))
            drop-shadow(0 0 46px rgba(91, 141, 239, 0.26))
            drop-shadow(0 6px 18px rgba(0, 0, 0, 0.55));
    }
}

@keyframes auth-logo-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes auth-logo-heartbeat-sidebar {
    0%, 100% {
        transform: scale(1);
        filter:
            drop-shadow(0 0 12px rgba(212, 168, 67, 0.3))
            drop-shadow(0 0 24px rgba(91, 141, 239, 0.16));
    }
    50% {
        transform: scale(1.02);
        filter:
            drop-shadow(0 0 18px rgba(212, 168, 67, 0.45))
            drop-shadow(0 0 32px rgba(91, 141, 239, 0.22));
    }
}

@keyframes auth-logo-aura-gold {
    0%, 100% { opacity: 0.45; scale: 0.92; }
    50% { opacity: 0.9; scale: 1.08; }
}

@keyframes auth-logo-aura-blue {
    0%, 100% { opacity: 0.35; scale: 1.05; }
    50% { opacity: 0.7; scale: 0.94; }
}

@keyframes auth-logo-ring-pulse {
    0%, 100% {
        opacity: 0.35;
        scale: 0.96;
    }
    50% {
        opacity: 0.85;
        scale: 1.04;
    }
}

@keyframes auth-logo-ring-spin {
    from { rotate: 0deg; }
    to { rotate: 360deg; }
}

@keyframes auth-logo-orbit-spin {
    from { rotate: 0deg; }
    to { rotate: 360deg; }
}

@keyframes auth-logo-shimmer-sweep {
    0%, 18% {
        left: -65%;
        opacity: 0;
    }
    28% {
        opacity: 1;
    }
    52% {
        left: 125%;
        opacity: 1;
    }
    62%, 100% {
        left: 125%;
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-logo-core,
    .auth-logo-core .app-logo,
    .app-sidebar-brand .auth-logo-core .app-logo,
    .auth-logo-aura,
    .auth-logo-ring,
    .auth-logo-orbit,
    .auth-logo-shimmer::after {
        animation: none !important;
    }

    .auth-logo-core .app-logo {
        filter:
            drop-shadow(0 0 24px rgba(212, 168, 67, 0.45))
            drop-shadow(0 0 48px rgba(91, 141, 239, 0.25));
    }
}

.auth-content {
    position: relative;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0 1.5rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 168, 67, 0.55), transparent);
}

.auth-divider span {
    color: var(--gold);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-shadow: 0 0 14px rgba(212, 168, 67, 0.45);
    white-space: nowrap;
}

.auth-message {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1.25rem;
}

.auth-footer-link {
    text-align: center;
    margin: 1.25rem 0 0;
    font-size: .875rem;
}

.auth-footer-link a {
    color: var(--accent);
}

.auth-body .form-label {
    color: var(--gold);
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-bottom: .45rem;
}

.auth-body .form-control {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(45, 58, 79, 0.95);
    border-left: 3px solid rgba(212, 168, 67, 0.55);
    color: var(--text-main);
    padding: .7rem .9rem;
    border-radius: 4px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.auth-body .form-control:focus {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(91, 141, 239, 0.7);
    border-left-color: var(--gold);
    color: var(--text-main);
    box-shadow: 0 0 0 1px rgba(91, 141, 239, 0.35), 0 0 20px rgba(91, 141, 239, 0.2);
}

.auth-body .form-control::placeholder {
    color: var(--text-subtle);
}

.btn-auth-enter {
    background: linear-gradient(180deg, #5f8deb 0%, #3d6fd4 45%, #2f5fbf 100%);
    border: 1px solid rgba(122, 163, 245, 0.65);
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 0.9rem 1rem;
    border-radius: 4px;
    box-shadow:
        0 0 24px rgba(91, 141, 239, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.btn-auth-enter:hover,
.btn-auth-enter:focus {
    color: #fff;
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow:
        0 0 36px rgba(91, 141, 239, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn-auth-secondary {
    background: transparent;
    border: 1px solid rgba(212, 168, 67, 0.45);
    color: var(--gold);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.8rem;
    padding: 0.75rem 1rem;
    border-radius: 4px;
}

.btn-auth-secondary:hover {
    background: rgba(212, 168, 67, 0.08);
    border-color: var(--gold);
    color: var(--gold);
}

.auth-body .alert {
    font-size: .875rem;
    margin-bottom: 1.25rem;
    border-radius: 4px;
}

.auth-body .alert-success {
    background: rgba(61, 214, 140, 0.12);
    border-color: rgba(61, 214, 140, 0.35);
    color: #7ae8b8;
}

.auth-body .alert-danger {
    background: rgba(239, 83, 80, 0.12);
    border-color: rgba(239, 83, 80, 0.35);
    color: #ff9a98;
}

.auth-body .btn-close {
    filter: invert(1) grayscale(1) brightness(1.4);
    opacity: .7;
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.25rem 1.25rem 1.5rem;
    }

    .auth-shell {
        max-width: 100%;
    }

    .auth-brand .auth-logo-stage {
        max-width: min(200px, 62vw);
        padding-bottom: 0.5rem;
    }

    .auth-brand .auth-logo-core .app-logo {
        max-height: min(140px, 22vh);
    }

    .app-sidebar-brand .auth-logo-core .app-logo {
        max-height: 76px;
    }
}

.permission-denied { text-align: center; padding: 4rem 2rem; }

/* Admin users */
.admin-users-table td {
    vertical-align: middle;
}

.admin-user-form .form-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-user-form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.permission-check {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-panel-soft);
    cursor: pointer;
    min-height: 100%;
}

.permission-check input {
    margin-top: 0.15rem;
    accent-color: var(--accent);
}

.permission-check span {
    font-size: 0.85rem;
    color: var(--text-main);
    line-height: 1.35;
}

.permission-group .panel-header {
    font-size: 0.85rem;
}

.pagination-bar .pagination .page-link {
    background: var(--bg-panel-soft);
    border-color: var(--border-color);
    color: var(--text-main);
}

.pagination-bar .pagination .page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.pagination-bar .pagination .page-link:hover {
    background: rgba(91, 141, 239, 0.12);
    border-color: var(--accent);
    color: var(--text-main);
}

.app-modal {
    background: var(--bg-panel);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.modal-backdrop.show {
    opacity: 0.72;
}

/* Player avatar */
.player-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    background: var(--bg-panel-soft);
    color: var(--text-main);
    font-weight: 700;
    line-height: 1;
    user-select: none;
}

.player-avatar--profile {
    width: 72px;
    height: 72px;
    font-size: 1.35rem;
}

.player-avatar--history {
    width: 44px;
    height: 44px;
    font-size: 0.85rem;
    border-width: 1px;
}

.player-avatar--initials {
    background:
        radial-gradient(circle at 30% 25%, hsla(var(--player-avatar-hue), 58%, 58%, 0.45), transparent 58%),
        linear-gradient(145deg, hsl(var(--player-avatar-hue), 42%, 34%), hsl(calc(var(--player-avatar-hue) + 24), 36%, 22%));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.player-show-identity {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
}

.player-show-name {
    margin: 0;
    line-height: 1.15;
}

.player-defense-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}

.player-defense-history-identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    min-width: 5.5rem;
    padding: 0.55rem 0.65rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(35, 47, 66, 0.95), rgba(26, 35, 50, 0.98));
}

.player-defense-history-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
    line-height: 1.2;
    max-width: 7rem;
    word-break: break-word;
}

/* Players war board — Excel-style attack matrix */
.players-war-board {
    padding: 1.1rem 1.15rem 1.2rem;
    border: 1px solid rgba(91, 141, 239, 0.22);
    background:
        radial-gradient(ellipse 70% 50% at 0% 0%, rgba(91, 141, 239, 0.1), transparent 55%),
        rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.players-war-board__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}

.players-war-board__eyebrow {
    margin: 0 0 0.2rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
}

.players-war-board__title {
    margin: 0 0 0.3rem;
    font-size: 1.15rem;
    font-weight: 800;
}

.players-war-board__hint {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    max-width: 40rem;
}

.players-war-board__meta {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.25);
    white-space: nowrap;
}

.players-war-board__scroll {
    overflow-x: auto;
    margin: 0 -0.25rem;
    padding: 0 0.25rem 0.15rem;
    -webkit-overflow-scrolling: touch;
}

.players-war-board__table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.82rem;
}

.players-war-board__row--meta th {
    vertical-align: bottom;
    padding-bottom: 0.55rem;
}

.players-war-board__sticky {
    position: sticky;
    z-index: 2;
    background: #121a28;
}

.players-war-board__sticky--rank {
    left: 0;
    min-width: 2.2rem;
    width: 2.2rem;
    text-align: center;
    z-index: 4;
}

.players-war-board__sticky--name {
    left: 2.2rem;
    min-width: 8.5rem;
    max-width: 11rem;
    z-index: 3;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.35);
}

.players-war-board__sticky--avg {
    left: calc(2.2rem + 8.5rem);
    min-width: 4.5rem;
    width: 4.5rem;
    text-align: center;
    z-index: 3;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.35);
}

.players-war-board__war-col {
    min-width: 5.5rem;
    max-width: 6.5rem;
    padding: 0.35rem 0.4rem;
    text-align: center;
}

.players-war-board__war-link {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding: 0.35rem 0.25rem;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.players-war-board__war-link:hover {
    background: rgba(91, 141, 239, 0.12);
    color: #b8d4ff;
}

.players-war-board__war-date {
    font-weight: 800;
    font-size: 0.78rem;
    color: #e8eef7;
}

.players-war-board__war-opponent {
    font-size: 0.68rem;
    font-weight: 600;
    color: #ffb09a;
    line-height: 1.2;
    max-width: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.players-war-board__war-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    justify-content: center;
}

.players-war-board__war-mode {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.players-war-board__war-result {
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.players-war-board__row td,
.players-war-board__row th {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.45rem 0.35rem;
}

.players-war-board__row:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.players-war-board__row:hover .players-war-board__sticky {
    background: #161f30;
}

.players-war-board__rank {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}

.players-war-board__rank--gold { color: var(--gold); text-shadow: 0 0 10px rgba(212, 168, 67, 0.45); }
.players-war-board__rank--silver { color: #c8d0dc; }
.players-war-board__rank--bronze { color: #d4956a; }

.players-war-board__name {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 11rem;
}

.players-war-board__name .player-link {
    font-weight: 700;
}

.players-war-board__avg {
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    font-size: 0.95rem;
    color: var(--gold);
}

.players-war-board__cell {
    text-align: center;
    font-variant-numeric: tabular-nums;
    border-radius: 4px;
    transition: transform 0.15s ease;
}

.players-war-board__row:hover .players-war-board__cell:not(.players-war-board__cell--empty) {
    transform: scale(1.02);
}

.players-war-board__cell--empty {
    color: rgba(139, 156, 179, 0.35);
}

.players-war-board__score {
    font-weight: 800;
    font-size: 0.88rem;
}

.players-war-board__score--empty {
    font-weight: 500;
}

.players-war-board__cell--heat-1 { background: rgba(91, 141, 239, 0.08); }
.players-war-board__cell--heat-2 { background: rgba(91, 141, 239, 0.14); color: #b8d4ff; }
.players-war-board__cell--heat-3 { background: rgba(91, 141, 239, 0.22); color: #c8deff; }
.players-war-board__cell--heat-4 { background: rgba(212, 168, 67, 0.18); color: #ffe2a8; }
.players-war-board__cell--heat-5 {
    background: rgba(212, 168, 67, 0.28);
    color: #fff0c8;
    box-shadow: inset 0 0 0 1px rgba(212, 168, 67, 0.35);
}

/* Mobile */
.sidebar-toggle { display: none; }
@media (max-width: 992px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.open { transform: translateX(0); }
    .app-main { margin-left: 0; }
    .sidebar-toggle { display: inline-flex; }
    .app-content { padding: 1rem .75rem; }
    .filter-bar { padding: .75rem; }
    .panel-body { padding: .75rem; }
    .app-topbar { padding: 0 .75rem; }
    .app-topbar-actions { gap: .4rem; }
    .app-topbar-actions .btn { padding: .25rem .45rem; }
    .app-topbar-actions .badge-role { display: none; }
    .lang-switcher-flag { min-width: 1.75rem; height: 1.75rem; font-size: 1rem; }

    .table-responsive-panel {
        max-height: none;
        overflow: visible;
        border: none;
        background: transparent;
    }
    .table-responsive-panel table,
    .table-responsive-panel thead,
    .table-responsive-panel tbody,
    .table-responsive-panel th,
    .table-responsive-panel td,
    .table-responsive-panel tr {
        display: block !important;
        width: 100% !important;
    }
    .table-responsive-panel thead {
        display: none !important;
    }
    .table-responsive-panel tbody tr {
        margin-bottom: .75rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        overflow: hidden;
        background: var(--bg-panel);
    }
    .table-responsive-panel tbody td {
        display: grid !important;
        grid-template-columns: minmax(110px, 40%) 1fr;
        gap: .5rem;
        align-items: start;
        white-space: normal !important;
        word-break: break-word;
        padding: .5rem .6rem !important;
        border-bottom: 1px solid var(--border-color);
        min-height: 2.35rem;
    }
    .table-responsive-panel tbody td:last-child {
        border-bottom: 0;
    }
    .table-responsive-panel tbody td::before {
        content: attr(data-label);
        color: var(--text-muted);
        font-size: .68rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .04em;
        line-height: 1.25;
    }
    .table-responsive-panel tbody td.text-end,
    .table-responsive-panel tbody td.text-center {
        text-align: left !important;
    }
    .table-responsive-panel .hero-team {
        gap: .15rem;
    }
    .table-responsive-panel .war-defense-heroes {
        max-width: 100%;
    }

    .war-top-defenses-table__name,
    .war-top-defenses-table__name a,
    .war-top-defenses-table__defender,
    .war-top-defenses-table__defender-link {
        white-space: normal;
        max-width: none;
        overflow: visible;
        text-overflow: unset;
    }

    .war-top-defenses-table__heroes {
        width: auto;
    }

    .war-top-defenses-table__num {
        text-align: left !important;
    }
    .war-defense-score {
        justify-content: flex-start;
    }
    .table-responsive-panel .hero-pill {
        font-size: .68rem;
        padding: .08rem .35rem;
    }
    .table-responsive-panel .war-mode-chip--table {
        font-size: .66rem;
        padding: .1rem .45rem;
    }
    .table-responsive-panel .btn-sm {
        width: auto;
    }
}

.app-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 1035;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}
.app-sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}
body.sidebar-open {
    overflow: hidden;
}

/* Loading overlay */
.import-loading {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15,20,25,.85);
    z-index: 9999;
    align-items: center; justify-content: center;
    flex-direction: column; gap: 1rem;
}
.import-loading.active { display: flex; }

.import-progress-panel { max-width: 720px; }
.import-upload-panel { border-top: 1px solid rgba(255,255,255,.08); padding-top: 1rem; }
.import-progress__status { font-size: 1.05rem; }
.import-progress__bar { height: 1.25rem; background: rgba(255,255,255,.08); }
.import-progress__bar .progress-bar { background: var(--accent, #e8a838); }

.sortable th[data-sort] { cursor: pointer; user-select: none; }
.sortable th[data-sort]:hover { color: var(--accent); }

.sortable-th {
    position: relative;
    padding-right: 1.35rem;
    white-space: nowrap;
}

.sortable-th::after {
    content: '⇅';
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.72rem;
    opacity: 0.35;
    color: var(--text-muted);
    transition: opacity .15s ease, color .15s ease;
}

.sortable-th:hover::after,
.sortable-th.is-sorted-asc::after,
.sortable-th.is-sorted-desc::after {
    opacity: 1;
    color: var(--accent);
}

.sortable-th.is-sorted-asc::after { content: '↑'; }
.sortable-th.is-sorted-desc::after { content: '↓'; }

.sortable-th.is-sorted-asc,
.sortable-th.is-sorted-desc {
    color: var(--accent);
}

.war-import-match-table__excel {
    font-weight: 600;
    font-size: 0.92rem;
    min-width: 9rem;
}

.war-import-heroes {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.war-import-select {
    min-width: 12rem;
    max-width: 18rem;
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-main);
    font-size: 0.82rem;
}

.war-import-status {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.war-import-match--exact {
    background: rgba(80, 200, 120, 0.06);
}

.war-import-match--exact .war-import-status {
    color: #7ee2a8;
}

.war-import-match--fuzzy {
    background: rgba(212, 168, 67, 0.08);
}

.war-import-match--fuzzy .war-import-status {
    color: #f5d78a;
}

.war-import-match--unknown {
    background: rgba(239, 83, 80, 0.06);
}

.war-import-match--unknown .war-import-status {
    color: #ff8a86;
}

.war-import-scope-options {
    margin-bottom: 0;
}

.war-import-scope-option {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.18);
    cursor: pointer;
    margin: 0;
    font-size: 0.88rem;
}

.war-import-scope-option input {
    margin-top: 0.15rem;
    accent-color: var(--accent);
}

.war-import-scope-badge {
    background: rgba(212, 168, 67, 0.15);
    color: #f5d78a;
    border: 1px solid rgba(212, 168, 67, 0.35);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Admin settings tabs */
.admin-settings-nav__list {
    gap: 0.35rem;
}

.admin-settings-nav .nav-link {
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.admin-settings-nav .nav-link:hover {
    color: var(--text-main);
    border-color: rgba(91, 141, 239, 0.35);
}

.admin-settings-nav .nav-link.active {
    color: #fff;
    background: rgba(91, 141, 239, 0.22);
    border-color: rgba(91, 141, 239, 0.55);
}

/* ===== War rotation ===== */
.rotation-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.rotation-play {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.rotation-play__icon {
    font-size: 0.8rem;
}

.rotation-stage {
    position: relative;
    padding: 1.5rem 0 2.5rem;
}

.rotation-track {
    position: relative;
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

/* Central glowing spine + travelling pulse */
.rotation-track::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    background: linear-gradient(180deg,
        rgba(91, 141, 239, 0.05),
        rgba(91, 141, 239, 0.55) 12%,
        rgba(255, 45, 133, 0.55) 88%,
        rgba(255, 45, 133, 0.05));
    border-radius: 3px;
}

.rotation-track::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    width: 12px;
    height: 12px;
    margin-left: -6px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 12px 4px rgba(91, 141, 239, 0.85), 0 0 22px 8px rgba(255, 45, 133, 0.5);
    animation: rotation-pulse 6.5s linear infinite;
}

@keyframes rotation-pulse {
    0% { top: 0; opacity: 0; }
    8% { opacity: 1; }
    92% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.rotation-step {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0;
    opacity: 0;
    transform: translateY(18px);
    animation: rotation-in 0.55s ease forwards;
    animation-delay: calc(var(--step-index) * 90ms);
}

@keyframes rotation-in {
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .rotation-step { opacity: 1; transform: none; animation: none; }
    .rotation-track::after { animation: none; display: none; }
}

/* Node badge on the spine */
.rotation-node {
    grid-column: 2;
    justify-self: center;
    position: relative;
    z-index: 2;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-panel-soft);
    border: 2px solid rgba(91, 141, 239, 0.5);
    color: var(--text-main);
    font-weight: 800;
    font-size: 0.9rem;
    box-shadow: 0 0 0 5px rgba(15, 20, 25, 0.9);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.rotation-node__num { line-height: 1; }

/* The card holding icon + text; alternate sides on wide screens */
.rotation-card {
    grid-column: 1;
    justify-self: end;
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    max-width: 440px;
    padding: 0.85rem 1rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-align: left;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

a.rotation-card--link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

a.rotation-card--link:hover {
    border-color: rgba(91, 141, 239, 0.65);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(91, 141, 239, 0.3);
    transform: translateY(-2px);
    color: inherit;
}

.rotation-step:nth-child(even) .rotation-card {
    grid-column: 3;
    justify-self: start;
    flex-direction: row-reverse;
    text-align: right;
}

.rotation-badge {
    flex-shrink: 0;
    width: 62px;
    height: 62px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.35));
    border: 1px solid var(--border-color);
}

.rotation-badge img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
    transition: transform 0.35s ease;
}

.rotation-card__title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
}

.rotation-card__desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0.35rem 0 0;
    line-height: 1.45;
}

.rotation-card__cta {
    display: inline-block;
    margin-top: 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--accent);
    opacity: 0.85;
}

a.rotation-card--link:hover .rotation-card__cta {
    opacity: 1;
}

.rotation-card__body {
    min-width: 0;
    flex: 1;
}

/* Hover / active emphasis */
.rotation-step:hover .rotation-card,
.rotation-step.is-active .rotation-card {
    border-color: rgba(91, 141, 239, 0.6);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(91, 141, 239, 0.25);
    transform: translateY(-2px);
}

.rotation-step:hover .rotation-node,
.rotation-step.is-active .rotation-node {
    transform: scale(1.15);
    border-color: var(--accent-hover);
    box-shadow: 0 0 0 5px rgba(15, 20, 25, 0.9), 0 0 16px 3px rgba(91, 141, 239, 0.7);
}

.rotation-step:hover .rotation-badge img,
.rotation-step.is-active .rotation-badge img {
    transform: scale(1.08) rotate(-4deg);
}

/* Branch step (A / B alternatives) */
.rotation-step--branch {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0.75rem;
}

.rotation-node--branch {
    grid-column: 1;
    border-color: var(--gold);
    box-shadow: 0 0 0 5px rgba(15, 20, 25, 0.9), 0 0 14px 2px rgba(212, 168, 67, 0.6);
}

.rotation-branch {
    grid-column: 1;
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.rotation-card--option {
    position: relative;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 300px;
    padding-top: 1.4rem;
}

.rotation-card--option .rotation-card__body { text-align: center; }

.rotation-card__tag {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
    color: #1a1204;
    background: var(--gold);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.rotation-branch__vs {
    align-self: center;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gold);
    padding: 0.25rem 0.5rem;
}

/* Loop indicator */
.rotation-loop {
    position: relative;
    z-index: 2;
    justify-self: center;
    align-self: center;
    margin: 0.5rem auto 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    background: var(--bg-panel-soft);
    border: 1px solid rgba(255, 45, 133, 0.45);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 0 0 5px rgba(15, 20, 25, 0.9);
}

.rotation-loop__arrow {
    font-size: 1.1rem;
    color: #ff2d85;
    animation: rotation-spin 4s linear infinite;
}

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

@media (max-width: 640px) {
    .rotation-track { max-width: 100%; }
    .rotation-track::before,
    .rotation-track::after { left: 28px; }
    .rotation-step,
    .rotation-step:nth-child(even) {
        grid-template-columns: 40px 1fr;
        gap: 0.75rem;
    }
    .rotation-node,
    .rotation-node--branch { grid-column: 1; justify-self: center; }
    .rotation-card,
    .rotation-step:nth-child(even) .rotation-card {
        grid-column: 2;
        justify-self: stretch;
        flex-direction: row;
        text-align: left;
        max-width: none;
    }
    .rotation-step--branch { grid-template-columns: 40px 1fr; }
    .rotation-branch { grid-column: 2; justify-content: flex-start; }
    .rotation-loop { margin-left: 0; }
    .rotation-infobar { flex-direction: column; }
    .rotation-infobar__arrow { transform: rotate(90deg); }
}

/* Infobar: current / next mode */
.rotation-infobar {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(91, 141, 239, 0.12), rgba(255, 45, 133, 0.08));
    border: 1px solid rgba(91, 141, 239, 0.35);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.rotation-infobar__item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.rotation-infobar__label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.rotation-infobar__value {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.05rem;
}

.rotation-infobar__icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.rotation-infobar__meta {
    font-size: 0.78rem;
    color: var(--text-subtle);
}

.rotation-infobar__arrow {
    align-self: center;
    font-size: 1.4rem;
    color: var(--accent);
    opacity: 0.8;
}

.rotation-infobar__item--current .rotation-infobar__value strong {
    color: var(--success);
}

.rotation-infobar__item--next .rotation-infobar__value strong {
    color: var(--accent-hover);
}

.rotation-infobar__link {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.15s ease;
}

.rotation-infobar__link:hover {
    opacity: 0.85;
    color: inherit;
}

.rotation-infobar__item--current .rotation-infobar__link strong {
    color: var(--success);
}

.rotation-infobar__item--next .rotation-infobar__link strong {
    color: var(--accent-hover);
}

/* Current / next step highlights on the timeline */
.rotation-step.is-current .rotation-card,
.rotation-step.is-current a.rotation-card--link,
a.rotation-card--link.is-current-branch {
    border-color: rgba(61, 214, 140, 0.75);
    box-shadow: 0 0 0 1px rgba(61, 214, 140, 0.35), 0 8px 28px rgba(61, 214, 140, 0.15);
    animation: rotation-current-pulse 2.4s ease-in-out infinite;
}

.rotation-step.is-current .rotation-node {
    border-color: var(--success);
    box-shadow: 0 0 0 5px rgba(15, 20, 25, 0.9), 0 0 18px 4px rgba(61, 214, 140, 0.65);
    animation: rotation-node-pulse 2.4s ease-in-out infinite;
}

.rotation-step.is-next .rotation-card,
.rotation-step.is-next a.rotation-card--link,
a.rotation-card--link.is-next-branch {
    border-color: rgba(91, 141, 239, 0.55);
    box-shadow: 0 0 0 1px rgba(91, 141, 239, 0.25);
}

.rotation-step.is-next .rotation-node {
    border-color: var(--accent);
}

@keyframes rotation-current-pulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(61, 214, 140, 0.35), 0 8px 28px rgba(61, 214, 140, 0.12); }
    50% { box-shadow: 0 0 0 2px rgba(61, 214, 140, 0.55), 0 10px 32px rgba(61, 214, 140, 0.22); }
}

@keyframes rotation-node-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

/* Admin war-mode icon upload cards */
.war-mode-icon-admin-card__preview {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-panel-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.war-mode-icon-admin-card__preview img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

/* YouTube creators — unified hub */
.yt-hub {
    margin: -0.25rem 0 1rem;
}

.yt-hub__hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
    padding: 1.15rem 1.25rem 1.25rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 77, 77, 0.22);
    background:
        radial-gradient(ellipse 90% 120% at 0% 0%, rgba(255, 77, 77, 0.14), transparent 55%),
        radial-gradient(ellipse 70% 80% at 100% 100%, rgba(91, 141, 239, 0.12), transparent 50%),
        linear-gradient(135deg, rgba(26, 35, 50, 0.95), rgba(15, 20, 25, 0.98));
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.yt-hub__hero--compact .yt-hub__badge {
    margin-bottom: 0.45rem;
}

.yt-hub__hero--compact .yt-hub__title {
    font-size: clamp(1.25rem, 2.5vw, 1.65rem);
    margin-bottom: 0.25rem;
}

.yt-hub__hero--compact .yt-hub__subtitle {
    font-size: 0.88rem;
    line-height: 1.45;
}

.yt-hub__hero-bg {
    position: absolute;
    inset: -30%;
    background:
        conic-gradient(from 210deg at 50% 50%, rgba(255, 77, 77, 0.08), transparent 25%, rgba(91, 141, 239, 0.1), transparent 55%, rgba(212, 168, 67, 0.06), transparent 80%);
    animation: yt-hub-rotate 22s linear infinite;
    pointer-events: none;
}

@keyframes yt-hub-rotate {
    to { transform: rotate(360deg); }
}

.yt-hub__hero-content {
    position: relative;
    z-index: 1;
    max-width: 42rem;
}

.yt-hub__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 77, 77, 0.35);
    background: rgba(255, 77, 77, 0.1);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ff8a8a;
}

.yt-hub__badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff4d4d;
    box-shadow: 0 0 8px rgba(255, 77, 77, 0.9);
    animation: yt-hub-pulse 1.8s ease-in-out infinite;
}

@keyframes yt-hub-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.85); }
}

.yt-hub__title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.02em;
    background: linear-gradient(120deg, #fff 20%, #ffb4b4 55%, #b8d4ff 90%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.yt-hub__subtitle {
    margin: 0;
    font-size: 1rem;
    line-height: 1.55;
    color: var(--text-muted);
    max-width: 36rem;
}

.yt-hub__empty {
    text-align: center;
    padding: 3rem 1.5rem;
    border-style: dashed;
}

.yt-hub__empty-icon {
    display: inline-flex;
    margin-bottom: 0.85rem;
    color: #ff4d4d;
    opacity: 0.75;
}

/* Unified console — one player, creator rail */
.yt-hub__console {
    display: grid;
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
    align-items: stretch;
    gap: 0;
    padding: 0;
    overflow: visible;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    background:
        radial-gradient(ellipse 50% 40% at 100% 0%, rgba(255, 77, 77, 0.08), transparent 50%),
        linear-gradient(165deg, rgba(26, 35, 50, 0.98), rgba(15, 20, 25, 0.99));
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.yt-hub__creators-rail {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.85rem 0.75rem;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.18);
    border-radius: 14px 0 0 14px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.yt-hub__creator-tab {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.55rem 0.6rem;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.yt-hub__creator-tab:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
}

.yt-hub__creator-tab.is-active {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: inset 3px 0 0 #ff4d4d;
}

.yt-hub__creator-tab.is-active .yt-hub__creator-name {
    color: #fff;
}

.yt-hub__creator-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

.yt-hub__creator-tab.is-active .yt-hub__creator-avatar {
    border-color: rgba(255, 77, 77, 0.45);
}

.yt-hub__creator-avatar--initials {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
    background: hsl(var(--yt-accent-hue, 210), 55%, 42%);
}

.yt-hub__creator-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

.yt-hub__creator-name {
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s ease;
}

.yt-hub__creator-handle {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.yt-hub__stage {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0.85rem 1rem 1.1rem;
    border-radius: 0 14px 14px 0;
}

.yt-hub__creator-bar {
    display: flex;
    align-items: center;
    gap: 0.85rem 1rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background:
        linear-gradient(135deg, rgba(255, 77, 77, 0.08), rgba(91, 141, 239, 0.05)),
        rgba(0, 0, 0, 0.22);
}

.yt-hub__creator-bar-avatar {
    flex-shrink: 0;
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 77, 77, 0.45);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.yt-hub__creator-bar-avatar:hover {
    transform: scale(1.05);
    border-color: #ff4d4d;
}

.yt-hub__creator-bar-avatar-img,
.yt-hub__creator-bar-avatar-fallback {
    width: 100%;
    height: 100%;
    display: block;
}

.yt-hub__creator-bar-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    background: hsl(var(--yt-accent-hue, 210), 55%, 42%);
}

.yt-hub__creator-bar-avatar-fallback[hidden] {
    display: none;
}

.yt-hub__creator-bar-body {
    flex: 1;
    min-width: 0;
}

.yt-hub__creator-bar-name {
    display: inline-block;
    margin: 0 0 0.1rem;
    font-size: 1.15rem;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: #fff !important;
    text-decoration: none;
    transition: color 0.15s ease;
}

.yt-hub__creator-bar-name:hover {
    color: #ffb4b4 !important;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.yt-hub__creator-bar-handle {
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #ff8a8a !important;
    text-decoration: none;
}

.yt-hub__creator-bar-handle:hover {
    color: #ffb4b4 !important;
    text-decoration: underline;
}

.yt-hub__creator-bar-handle[hidden] {
    display: none;
}

.yt-hub__creator-bar-desc {
    margin: 0.25rem 0 0;
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yt-hub__creator-bar-desc[hidden] {
    display: none;
}

.yt-hub__creator-bar-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.95rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 77, 77, 0.5);
    background: linear-gradient(135deg, #ff4d4d, #cc0000);
    color: #fff !important;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 4px 18px rgba(255, 77, 77, 0.28);
    transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.yt-hub__creator-bar-btn:hover {
    color: #fff !important;
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 77, 77, 0.38);
}

.yt-hub__theater {
    margin-bottom: 0.55rem;
}

.yt-hub__screen {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    border: 1px solid rgba(255, 77, 77, 0.28);
    box-shadow: 0 0 24px rgba(255, 77, 77, 0.1), 0 12px 32px rgba(0, 0, 0, 0.45);
}

.yt-hub__hud {
    position: absolute;
    width: 16px;
    height: 16px;
    z-index: 3;
    pointer-events: none;
    border-color: rgba(255, 77, 77, 0.55);
    border-style: solid;
    border-width: 0;
}

.yt-hub__hud--tl { top: 8px; left: 8px; border-top-width: 2px; border-left-width: 2px; }
.yt-hub__hud--tr { top: 8px; right: 8px; border-top-width: 2px; border-right-width: 2px; }
.yt-hub__hud--bl { bottom: 8px; left: 8px; border-bottom-width: 2px; border-left-width: 2px; }
.yt-hub__hud--br { bottom: 8px; right: 8px; border-bottom-width: 2px; border-right-width: 2px; }

.yt-hub__iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.yt-hub__theater.is-switching .yt-hub__screen {
    animation: yt-screen-flash 0.35s ease;
}

@keyframes yt-screen-flash {
    0%, 100% { box-shadow: 0 0 24px rgba(255, 77, 77, 0.1), 0 12px 32px rgba(0, 0, 0, 0.45); }
    50% { box-shadow: 0 0 36px rgba(255, 77, 77, 0.28), 0 12px 32px rgba(0, 0, 0, 0.45); }
}

.yt-hub__now-playing {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
    min-width: 0;
}

.yt-hub__now-label {
    flex-shrink: 0;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #ff8a8a;
}

.yt-hub__now-title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yt-hub__videos {
    min-height: 0;
}

.yt-hub__video-panel {
    display: none;
}

.yt-hub__video-panel.is-active {
    display: block;
}

.yt-hub__videos-empty {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 0.5rem 0;
}

.yt-hub__filmstrip-track {
    display: flex;
    gap: 0.55rem;
    overflow-x: auto;
    overflow-y: visible;
    padding: 3px 3px 6px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.yt-hub__filmstrip-track::-webkit-scrollbar {
    height: 4px;
}

.yt-hub__filmstrip-track::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
}

.yt-hub__thumb {
    position: relative;
    flex: 0 0 108px;
    scroll-snap-align: start;
    padding: 0;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    cursor: pointer;
    aspect-ratio: 16 / 9;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: box-shadow 0.15s ease;
}

.yt-hub__thumb:hover {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.yt-hub__thumb.is-active {
    box-shadow: 0 0 0 2px #ff4d4d;
}

.yt-hub__thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.yt-hub__thumb-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.yt-hub__thumb:hover .yt-hub__thumb-play,
.yt-hub__thumb.is-active .yt-hub__thumb-play {
    opacity: 1;
}

@media (max-width: 767.98px) {
    .yt-hub__console {
        grid-template-columns: 1fr;
    }

    .yt-hub__creators-rail {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 14px 14px 0 0;
        padding: 0.65rem;
    }

    .yt-hub__creator-tab {
        flex: 0 0 auto;
        width: auto;
        max-width: 200px;
    }

    .yt-hub__stage {
        border-radius: 0 0 14px 14px;
    }

    .yt-hub__creator-bar {
        flex-wrap: wrap;
    }

    .yt-hub__creator-bar-btn {
        width: 100%;
        justify-content: center;
    }

    .yt-hub__screen {
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .yt-hub__hero-bg,
    .yt-hub__badge-dot {
        animation: none;
    }
}

/* YouTube channels — admin sortable list */
.yt-admin-help {
    border-left: 3px solid #ff4d4d;
    background: linear-gradient(90deg, rgba(255, 77, 77, 0.08), transparent);
}

.yt-admin-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.yt-admin-item {
    padding: 1rem 1.25rem 1.15rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-panel);
    transition: background 0.15s ease;
}

.yt-admin-item:last-child {
    border-bottom: none;
}

.yt-admin-item--ghost {
    opacity: 0.45;
    background: var(--bg-panel-soft);
}

.yt-admin-item--chosen {
    background: var(--bg-panel-soft);
}

.yt-admin-item__toolbar {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.yt-admin-item__drag {
    cursor: grab;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1;
    padding: 0.45rem 0.35rem;
    user-select: none;
    flex-shrink: 0;
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    background: var(--bg-panel-soft);
    appearance: none;
}

.yt-admin-item__drag:active {
    cursor: grabbing;
}

.yt-admin-item__identity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1 1 220px;
}

.yt-admin-item__preview {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 77, 77, 0.35);
    background: var(--bg-panel-soft);
}

.yt-admin-item__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.yt-admin-item__initials {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    background: hsl(var(--yt-avatar-hue, 210), 55%, 42%);
}

.yt-admin-item__meta {
    min-width: 0;
}

.yt-admin-item__name {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.25;
}

.yt-admin-item__handle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.yt-admin-item__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: auto;
}

.yt-admin-item__form {
    padding: 0.85rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-panel-soft);
}

.yt-admin-reorder-status.text-success {
    color: var(--success) !important;
}

@media (max-width: 767.98px) {
    .yt-admin-item__toolbar {
        align-items: flex-start;
    }

    .yt-admin-item__actions {
        width: 100%;
        margin-left: 2.2rem;
    }
}

/* War attack creator */
.war-attack-creator__type {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
    border-radius: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.war-attack-creator__type:has(input:checked) {
    border-color: var(--accent, #c9a227);
    background: rgba(201, 162, 39, 0.12);
}

.war-attack-creator-preview__list {
    max-height: 32rem;
    overflow: auto;
    padding: 0.75rem 1rem 1rem;
    position: relative;
}

.war-attack-creator-preview__drop-line {
    height: 3px;
    margin: 0.15rem 0;
    border-radius: 999px;
    background: var(--accent, #c9a227);
    box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.35);
    pointer-events: none;
}

.war-attack-creator-preview__item {
    display: grid;
    grid-template-columns: 1.25rem 2.5rem auto 1fr auto;
    gap: 0.5rem 0.75rem;
    align-items: center;
    padding: 0.55rem 0.65rem;
    border-radius: 0.45rem;
    border: 1px solid transparent;
    margin-bottom: 0.35rem;
}

.war-attack-creator-preview__item--existing {
    cursor: pointer;
}

.war-attack-creator-preview__item--existing:hover {
    background: rgba(255, 255, 255, 0.04);
}

.war-attack-creator-preview__item--new {
    cursor: grab;
}

.war-attack-creator-preview__item--dragging {
    opacity: 0.55;
    cursor: grabbing;
}

.war-attack-creator-preview__drag {
    color: var(--text-muted, #9aa0a6);
    font-size: 0.95rem;
    line-height: 1;
    user-select: none;
}

.war-attack-creator-preview__drag--spacer {
    visibility: hidden;
}

.war-attack-creator-preview__item--highlight {
    border-color: var(--accent, #c9a227);
    background: rgba(201, 162, 39, 0.1);
}

.war-attack-creator-preview__item--drop-before {
    box-shadow: inset 0 2px 0 var(--accent, #c9a227);
}

.war-attack-creator-preview__item--drop-after {
    box-shadow: inset 0 -2px 0 var(--accent, #c9a227);
}

.war-attack-creator-preview__num {
    font-variant-numeric: tabular-nums;
    color: var(--text-muted, #9aa0a6);
    font-size: 0.85rem;
}

.war-attack-creator-preview__names {
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.war-attack-creator-preview__pts {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 991.98px) {
    .war-attack-creator-preview__item {
        grid-template-columns: 1rem 2rem 1fr;
        grid-template-rows: auto auto;
    }

    .war-attack-creator-preview__drag {
        display: none;
    }

    .war-attack-creator-preview__pts {
        grid-column: 3;
    }
}

/* Alliance emblem badges */
.alliance-emblem-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 2px 8px rgba(0, 0, 0, 0.25);
}
.alliance-emblem-badge--sm { width: 1.65rem; height: 1.65rem; border-radius: 6px; }
.alliance-emblem-badge--md { width: 2.2rem; height: 2.2rem; }
.alliance-emblem-badge--lg { width: 3.25rem; height: 3.25rem; border-radius: 12px; }
.alliance-emblem-badge--xl { width: 4.75rem; height: 4.75rem; border-radius: 14px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(201, 162, 39, 0.22); }
.alliance-emblem-badge--link { text-decoration: none; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.alliance-emblem-badge--link:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(201, 162, 39, 0.25); }
.alliance-emblem-badge__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.alliance-emblem-badge__letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(145deg, hsl(var(--emblem-hue, 220), 55%, 45%), hsl(var(--emblem-hue, 220), 55%, 28%));
}
.war-opponent-cell { display: inline-flex; align-items: center; gap: 0.45rem; }
.war-show-arena__emblem-wrap,
.defense-showcase__arena-emblem-wrap { display: flex; justify-content: center; margin-bottom: 0.35rem; }

/* Alliance emblem crop modal */
.alliance-emblem-dropzone {
    border: 2px dashed rgba(201, 162, 39, 0.45);
    border-radius: 0.75rem;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    transition: border-color 0.15s ease, background 0.15s ease;
}
.alliance-emblem-dropzone:focus,
.alliance-emblem-dropzone--active,
.alliance-emblem-dropzone:hover {
    border-color: var(--accent, #c9a227);
    background: rgba(201, 162, 39, 0.08);
    outline: none;
}
.alliance-emblem-dropzone__title { font-weight: 700; margin-bottom: 0.35rem; }
.alliance-emblem-dropzone__hint { color: var(--text-muted, #9aa0a6); font-size: 0.85rem; margin: 0; }
.alliance-emblem-crop__stage-wrap { border-radius: 0.65rem; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.1); background: #0d1016; }
.alliance-emblem-crop__stage { display: block; width: 100%; cursor: grab; }
.alliance-emblem-crop__preview-wrap { display: flex; align-items: center; gap: 0.75rem; }
.alliance-emblem-crop__preview,
.alliance-emblem-crop__preview-lg {
    border-radius: 10px;
    border: 2px solid var(--accent, #c9a227);
    background: #12151c;
    image-rendering: auto;
}
.alliance-emblem-crop__preview-lg { border-radius: 12px; }

.alliance-profile-hero {
    position: relative;
    overflow: hidden;
    min-height: 168px;
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(91, 141, 239, 0.22);
    background: linear-gradient(135deg, rgba(15, 18, 28, 0.98), rgba(8, 10, 16, 0.92));
}

.alliance-profile-hero--has-emblem {
    border-color: rgba(201, 162, 39, 0.3);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.35) inset,
        0 8px 32px rgba(0, 0, 0, 0.35),
        0 0 48px rgba(201, 162, 39, 0.06);
}

.alliance-profile-hero__bg {
    position: absolute;
    inset: -18%;
    background-image: var(--alliance-emblem-url);
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    filter: blur(2px) saturate(1.15);
    transform: scale(1.06);
    pointer-events: none;
}

.alliance-profile-hero__overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(105deg, rgba(8, 10, 16, 0.95) 0%, rgba(8, 10, 16, 0.55) 38%, rgba(220, 90, 70, 0.16) 100%),
        radial-gradient(ellipse at 88% 50%, rgba(201, 162, 39, 0.14), transparent 58%),
        linear-gradient(0deg, rgba(0, 0, 0, 0.35), transparent 68%);
    pointer-events: none;
}

.alliance-profile-hero__watermark {
    position: absolute;
    right: 2%;
    top: 50%;
    transform: translateY(-50%);
    width: min(148px, 30vw);
    height: min(148px, 30vw);
    background-image: var(--alliance-emblem-url);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.13;
    filter: drop-shadow(0 0 40px rgba(201, 162, 39, 0.18));
    pointer-events: none;
}

.alliance-profile-hero__content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.alliance-profile-hero__title {
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
}

.alliance-profile-hero__subtitle {
    color: var(--text-muted, #9aa0a6);
    font-size: 0.9rem;
}

.alliance-profile-hero__actions {
    align-self: center;
}

@media (max-width: 575.98px) {
    .alliance-profile-hero__watermark {
        opacity: 0.08;
        width: min(100px, 36vw);
        height: min(100px, 36vw);
    }
}

/* Defense battle log panels */
.defense-showcase__inner-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.defense-showcase__power-badge {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(201, 162, 39, 0.35);
    color: var(--accent, #c9a227);
    background: rgba(201, 162, 39, 0.1);
}
.defense-battle-panel {
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    overflow: hidden;
}
.defense-battle-panel--outgoing {
    border-color: rgba(61, 214, 140, 0.18);
    box-shadow: inset 0 1px 0 rgba(61, 214, 140, 0.08);
}
.defense-battle-panel__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0;
    padding: 1rem 1rem 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.defense-battle-panel__title { font-size: 1rem; font-weight: 700; margin: 0; }
.defense-battle-panel__hint { font-size: 0.8rem; color: var(--text-muted, #9aa0a6); }
.defense-battle-panel__mini-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
    font-size: 0.78rem;
    color: var(--text-muted, #9aa0a6);
    white-space: nowrap;
}
.defense-battle-log__empty {
    padding: 0.75rem 1rem 1rem;
}
.defense-battle-log-table-wrap {
    max-height: 26rem;
    overflow: auto;
    padding: 0;
}
.defense-battle-log-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.defense-battle-log-table tbody td {
    vertical-align: middle;
    padding: 0.42rem 0.5rem;
    font-size: 0.88rem;
}
.defense-battle-log-table__order {
    width: 2rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.defense-battle-log-table__target {
    min-width: 6.5rem;
    max-width: 9rem;
}
.defense-battle-log-table__attacker {
    min-width: 7rem;
}
.defense-battle-log-table__heroes {
    min-width: 8.5rem;
}
.defense-battle-log-table__power {
    width: 3.5rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-size: 0.82rem !important;
}
.defense-battle-log-table__points {
    width: 3.25rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}
.defense-battle-log-table__points--high { color: #ffb74d; }
.defense-battle-log-table__points--oneshot { color: #3dd68c; }
.defense-battle-log-table__fail {
    width: 2.75rem;
    text-align: center;
    font-size: 0.82rem !important;
}
.defense-battle-log-table__row--fail td {
    background: rgba(239, 83, 80, 0.06) !important;
}
.defense-battle-log-table .war-top-defenses-table__defender-link {
    font-weight: 600;
    font-size: 0.88rem;
}
.defense-battle-log-table .attacker-link,
.defense-battle-log-table .enemy-link,
.defense-battle-log-table .opponent-link {
    font-weight: 600;
    font-size: 0.88rem;
}
.defense-battle-log-table .war-defense-heroes {
    flex-wrap: nowrap;
}

.war-attack-chrono-upload-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
}
.war-attack-chrono-upload__hint {
    font-size: 0.68rem;
    color: var(--text-muted, #9aa0a6);
    text-align: right;
    max-width: 11rem;
    line-height: 1.2;
}
.war-attack-chrono-upload__btn {
    cursor: pointer;
    margin: 0;
}

/* War attack manage panel */
.war-attack-manage__timeline {
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.war-attack-manage__timeline-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.war-attack-manage__list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-height: 36rem;
    overflow: auto;
}
.war-attack-manage__item {
    display: grid;
    grid-template-columns: 1.25rem 2.5rem auto 1fr auto auto;
    gap: 0.5rem 0.65rem;
    align-items: center;
    padding: 0.6rem 0.7rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
    cursor: grab;
}
.war-attack-manage__item--dragging { opacity: 0.55; }
.war-attack-manage__item--drop-before { box-shadow: inset 0 2px 0 var(--accent, #c9a227); }
.war-attack-manage__drag { color: var(--text-muted, #9aa0a6); user-select: none; }
.war-attack-manage__num { font-variant-numeric: tabular-nums; color: var(--text-muted, #9aa0a6); font-size: 0.85rem; }
.war-attack-manage__names {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
}
.war-attack-manage__pts { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.war-attack-manage__actions { display: inline-flex; gap: 0.25rem; }
.war-attack-manage__add { border: 1px solid rgba(255, 255, 255, 0.08); }

@media (max-width: 991.98px) {
    .war-attack-manage__item {
        grid-template-columns: 1rem 2rem 1fr auto;
        grid-template-rows: auto auto;
    }
    .war-attack-manage__drag { display: none; }
    .war-attack-manage__names { grid-column: 1 / -1; }
    .war-attack-manage__actions { grid-column: 4; grid-row: 1; }
}

/* ===== Rankings (gaming leaderboard) ===== */
.rankings-page {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.rankings-hero {
    position: relative;
    overflow: hidden;
    padding: 1.35rem 1.5rem 1.15rem;
    background:
        radial-gradient(ellipse 80% 120% at 0% 0%, rgba(91, 141, 239, 0.2), transparent 55%),
        radial-gradient(ellipse 60% 90% at 100% 100%, rgba(212, 168, 67, 0.14), transparent 50%),
        var(--bg-panel);
    border-color: rgba(91, 141, 239, 0.28);
}

.rankings-hero__glow {
    position: absolute;
    inset: -40% -10% auto;
    height: 70%;
    background: radial-gradient(circle, rgba(91, 141, 239, 0.22), transparent 65%);
    pointer-events: none;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.rankings-hero.is-visible .rankings-hero__glow {
    opacity: 1;
    transform: scale(1);
}

.rankings-hero__content {
    position: relative;
    z-index: 1;
}

.rankings-hero__eyebrow {
    margin: 0 0 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
}

.rankings-hero__title {
    margin: 0;
    font-size: clamp(1.55rem, 3vw, 2.1rem);
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-main);
    text-shadow: 0 2px 18px rgba(91, 141, 239, 0.25);
}

.rankings-hero__subtitle {
    margin: 0.45rem 0 0;
    color: var(--text-muted);
    max-width: 42rem;
    font-size: 0.92rem;
}

.rankings-hero__actions {
    margin-top: 0.9rem;
}

.rankings-hero__export {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.rankings-spotlights {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 1.1rem;
}

.rankings-spotlight {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.85rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.22);
    text-decoration: none;
    color: inherit;
    opacity: 0;
    transform: translateY(12px);
    transition:
        opacity 0.55s ease var(--spot-delay, 0ms),
        transform 0.55s ease var(--spot-delay, 0ms),
        border-color 0.15s ease,
        background 0.15s ease;
}

.rankings-spotlight.is-visible {
    opacity: 1;
    transform: translateY(0);
}

a.rankings-spotlight:hover {
    border-color: rgba(91, 141, 239, 0.45);
    background: rgba(91, 141, 239, 0.08);
    color: inherit;
}

.rankings-spotlight__icon {
    font-size: 1.35rem;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.rankings-spotlight__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

.rankings-spotlight__value {
    font-size: 1.2rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text-main);
    line-height: 1.1;
}

.rankings-spotlight__label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 700;
}

.rankings-spotlight__meta {
    font-size: 0.78rem;
    color: #b8c4d8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rankings-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.15rem 0;
}

.rankings-jump__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.72rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.18);
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.rankings-jump__chip:hover {
    color: var(--text-main);
    border-color: rgba(91, 141, 239, 0.45);
    background: rgba(91, 141, 239, 0.1);
    transform: translateY(-1px);
}

.rankings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.rankings-card {
    --rankings-accent: var(--accent, #5b8def);
    position: relative;
    overflow: hidden;
    padding: 0;
    opacity: 0;
    transform: translateY(22px);
    transition:
        opacity 0.55s ease var(--rankings-delay, 0ms),
        transform 0.55s ease var(--rankings-delay, 0ms),
        box-shadow 0.25s ease;
}

.rankings-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.rankings-card--pulse {
    animation: rankingsPulse 0.85s ease;
}

@keyframes rankingsPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(91, 141, 239, 0); }
    40% { box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.35), 0 0 28px rgba(91, 141, 239, 0.18); }
}

.rankings-card--shield { --rankings-accent: #3dd68c; }
.rankings-card--danger { --rankings-accent: #ef5350; }
.rankings-card--ember { --rankings-accent: #e07055; }
.rankings-card--gold { --rankings-accent: var(--gold); }
.rankings-card--hero { --rankings-accent: #5b8def; }
.rankings-card--violet { --rankings-accent: #a78bfa; }
.rankings-card--muted { --rankings-accent: #8b9cb3; }

.rankings-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, var(--rankings-accent), transparent);
    opacity: 0.85;
}

.rankings-card__head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.95rem 1rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background:
        radial-gradient(ellipse 90% 80% at 0% 0%, color-mix(in srgb, var(--rankings-accent) 18%, transparent), transparent 60%),
        rgba(0, 0, 0, 0.12);
}

.rankings-card__icon {
    font-size: 1.45rem;
    line-height: 1;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
}

.rankings-card__title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--text-main);
}

.rankings-card__hint {
    margin: 0.2rem 0 0;
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.rankings-card__empty {
    margin: 0;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.rankings-card__list {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0.55rem 0.65rem;
}

.rankings-row {
    display: grid;
    grid-template-columns: 2.6rem minmax(0, 1fr);
    gap: 0.55rem;
    align-items: start;
    padding: 0.55rem 0.45rem;
    border-radius: 0.55rem;
    opacity: 0;
    transform: translateX(-8px);
    transition:
        opacity 0.4s ease var(--row-delay, 0ms),
        transform 0.4s ease var(--row-delay, 0ms),
        background 0.15s ease;
}

.rankings-row.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.rankings-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.rankings-row--gold {
    background: linear-gradient(90deg, rgba(212, 168, 67, 0.1), transparent 70%);
}

.rankings-row--silver {
    background: linear-gradient(90deg, rgba(200, 208, 220, 0.08), transparent 70%);
}

.rankings-row--bronze {
    background: linear-gradient(90deg, rgba(212, 149, 106, 0.08), transparent 70%);
}

.rankings-row__flag {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
}

.rankings-row__medal {
    font-size: 1.35rem;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
    animation: rankingsMedalPop 0.55s ease var(--row-delay, 0ms) both;
}

@keyframes rankingsMedalPop {
    0% { transform: scale(0.4) rotate(-12deg); opacity: 0; }
    70% { transform: scale(1.12) rotate(4deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.rankings-row__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.65rem;
    height: 1.65rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.22);
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.rankings-row__flag--gold .rankings-row__num,
.rankings-row__flag--gold .rankings-row__medal { filter: drop-shadow(0 0 8px rgba(212, 168, 67, 0.45)); }

.rankings-row__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.rankings-row__primary {
    min-width: 0;
}

.rankings-row__link {
    color: inherit;
    text-decoration: none;
}

.rankings-row__link:hover {
    color: var(--rankings-accent);
}

.rankings-row__name {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-main);
    word-break: break-word;
}

.rankings-row__badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.25rem;
}

.rankings-row__meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.rankings-row__meta--mode {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.rankings-row__meta-mixed {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.rankings-row__score {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.55rem;
}

.rankings-row__bar {
    height: 0.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.rankings-row__bar-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, color-mix(in srgb, var(--rankings-accent) 70%, #fff 10%), var(--rankings-accent));
    box-shadow: 0 0 10px color-mix(in srgb, var(--rankings-accent) 45%, transparent);
    transition: width 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.rankings-row__value {
    font-size: 0.92rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--rankings-accent);
    min-width: 2.5rem;
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 1199.98px) {
    .rankings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .rankings-hero {
        padding: 1rem;
    }

    .rankings-spotlights {
        grid-template-columns: 1fr;
    }

    .rankings-jump__chip {
        font-size: 0.7rem;
        padding: 0.28rem 0.58rem;
    }

    .rankings-row {
        grid-template-columns: 2.2rem minmax(0, 1fr);
        padding: 0.5rem 0.35rem;
    }

    .rankings-row__score {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .rankings-row__value {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rankings-card,
    .rankings-row,
    .rankings-spotlight,
    .rankings-hero__glow {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        animation: none !important;
    }

    .rankings-row__bar-fill {
        width: var(--bar-target, 0%) !important;
        transition: none !important;
    }
}

