:root {
    --orange-primary: #ff8c42;
    --orange-dark: #e67a2e;
    --orange-light: #ffb085;
    --orange-glow: rgba(255, 140, 66, 0.3);

    --blue-primary: #3a6ea5;
    --blue-dark: #2c5290;
    --blue-light: #6c9bd2;
    --blue-glow: rgba(58, 110, 165, 0.3);

    --gold: #ffd700;
    --silver: #c0c0c0;
    --bronze: #cd7f32;

    --dark-bg: #0a0f1a;
    --darker-bg: #05080f;
    --card-bg: rgba(20, 30, 45, 0.7);
    --text-primary: #e5e9f0;
    --text-secondary: #a0b3d9;
    --text-muted: #6c7a96;

    --gradient-orange: linear-gradient(135deg, var(--orange-primary), var(--orange-dark));
    --gradient-blue: linear-gradient(135deg, var(--blue-primary), var(--blue-dark));
    --gradient-mixed: linear-gradient(135deg, var(--orange-primary), var(--blue-primary));

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
    --shadow-orange: 0 8px 24px var(--orange-glow);
    --shadow-blue: 0 8px 24px var(--blue-glow);
    --shadow-gold: 0 8px 24px rgba(255, 215, 0, 0.3);

    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    --border-radius-xl: 32px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at 20% 30%, #1a2538, var(--dark-bg), var(--darker-bg));
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========== ДЕКОР ========== */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.rune {
    position: absolute;
    font-size: 200px;
    font-weight: bold;
    color: rgba(255, 140, 66, 0.05);
    white-space: nowrap;
    animation: floatRune 30s infinite linear;
}

.rune-1::before { content: 'ᚠ'; }
.rune-2::before { content: 'ᚢ'; }
.rune-3::before { content: 'ᚦ'; }
.rune-4::before { content: 'ᚨ'; }

.rune-1 { top: 10%; left: 5%; animation-delay: 0s; }
.rune-2 { top: 40%; right: 10%; animation-delay: -5s; }
.rune-3 { bottom: 20%; left: 15%; animation-delay: -10s; }
.rune-4 { bottom: 50%; right: 20%; animation-delay: -15s; }

.mist {
    position: absolute;
    width: 100%;
    height: 300px;
    background: linear-gradient(to bottom, transparent, rgba(58, 110, 165, 0.1), transparent);
    filter: blur(40px);
    animation: mistMove 20s infinite alternate;
}

.mist-1 { top: 0; left: -10%; width: 120%; }
.mist-2 { bottom: 0; right: -10%; width: 120%; animation-direction: reverse; }

.ancient-symbol {
    position: absolute;
    font-size: 300px;
    color: rgba(58, 110, 165, 0.03);
    transform: rotate(-15deg);
}

.symbol-1 { top: 20%; right: 5%; }
.symbol-2 { bottom: 10%; left: 5%; transform: rotate(20deg); }
.symbol-3 { top: 60%; left: 20%; }
.symbol-4 { bottom: 30%; right: 15%; }

@keyframes floatRune {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

@keyframes mistMove {
    0% { transform: translateX(0) scale(1); opacity: 0.3; }
    100% { transform: translateX(30px) scale(1.2); opacity: 0.6; }
}

/* ========== ШАПКА ========== */
.header {
    position: sticky;
    top: 0;
    backdrop-filter: blur(12px);
    background: rgba(10, 15, 26, 0.7);
    border-bottom: 1px solid rgba(255, 140, 66, 0.2);
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 32px;
    filter: drop-shadow(0 0 8px var(--orange-primary));
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { filter: drop-shadow(0 0 8px var(--orange-primary)); }
    50% { filter: drop-shadow(0 0 16px var(--orange-primary)); }
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    background: var(--gradient-mixed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 24px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-mixed);
    transition: width 0.3s;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    width: 100%;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
}

/* ========== КНОПКИ ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gradient-orange);
    color: white;
    box-shadow: var(--shadow-orange);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px var(--orange-glow);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--orange-primary);
    color: var(--orange-primary);
}

.btn-outline:hover {
    background: rgba(255, 140, 66, 0.1);
    border-color: var(--orange-light);
    color: var(--orange-light);
    transform: translateY(-2px);
}

/* ========== СТРАНИЦА ТОП ========== */
.top {
    padding: 40px 0 60px;
}

.breadcrumbs {
    margin-bottom: 30px;
    font-size: 14px;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumbs a:hover {
    color: var(--orange-primary);
}

/* ========== ЗАГОЛОВОК ========== */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 140, 66, 0.2);
    border-radius: var(--border-radius-xl);
    padding: 30px;
}

.header-title {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 16px;
}

.gradient-text {
    background: var(--gradient-mixed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-description {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.8;
}

.header-decoration .trophy-icon {
    font-size: 80px;
    filter: drop-shadow(0 0 20px var(--orange-primary));
    animation: glow 3s infinite alternate;
}

@keyframes glow {
    0% { filter: drop-shadow(0 0 10px var(--orange-primary)); }
    100% { filter: drop-shadow(0 0 30px var(--orange-primary)); }
}

/* ========== ВКЛАДКИ ========== */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    background: var(--card-bg);
    border: 1px solid rgba(255, 140, 66, 0.2);
    border-radius: var(--border-radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
}

.tab-btn:hover {
    border-color: var(--orange-primary);
    color: var(--orange-light);
}

.tab-btn.active {
    background: var(--gradient-orange);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-orange);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== ТАБЛИЦА ТОПА ========== */
.top-table {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 140, 66, 0.2);
    border-radius: var(--border-radius-xl);
    overflow: hidden;
}

.table-header {
    display: grid;
    grid-template-columns: 80px 1fr 150px 200px;
    padding: 20px;
    background: rgba(255, 140, 66, 0.1);
    border-bottom: 1px solid rgba(255, 140, 66, 0.2);
    font-weight: 600;
    color: var(--orange-light);
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1px;
}

.table-row {
    display: grid;
    grid-template-columns: 80px 1fr 150px 200px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 140, 66, 0.1);
    transition: all 0.3s;
    align-items: center;
}

.table-row:hover {
    background: rgba(255, 140, 66, 0.05);
}

.table-row:last-child {
    border-bottom: none;
}

.table-row.top-1 {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), transparent);
}

.table-row.top-1 .rank {
    color: var(--gold);
}

.table-row.top-2 {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.1), transparent);
}

.table-row.top-2 .rank {
    color: var(--silver);
}

.table-row.top-3 {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.1), transparent);
}

.table-row.top-3 .rank {
    color: var(--bronze);
}

.rank {
    font-weight: 700;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rank-number {
    font-size: 16px;
}

.medal {
    font-size: 20px;
}

.player {
    display: flex;
    flex-direction: column;
}

.player-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 16px;
}

.player-title {
    font-size: 12px;
    color: var(--text-muted);
}

.value {
    font-weight: 600;
    color: var(--orange-primary);
    font-size: 16px;
}

.guild-link {
    color: var(--blue-light);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 14px;
}

.guild-link:hover {
    color: var(--orange-primary);
    text-decoration: underline;
}

.no-guild {
    color: var(--text-muted);
    font-size: 14px;
}

/* ========== КАРТОЧКИ ГИЛЬДИЙ ========== */
.guilds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
}

.guild-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 140, 66, 0.2);
    border-radius: var(--border-radius-xl);
    padding: 30px;
    position: relative;
    transition: all 0.3s;
    overflow: hidden;
}

.guild-card:hover {
    transform: translateY(-4px);
    border-color: var(--orange-primary);
    box-shadow: var(--shadow-orange);
}

.guild-card.top-1::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gold);
    box-shadow: 0 0 20px var(--gold);
}

.guild-card.top-2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--silver);
    box-shadow: 0 0 20px var(--silver);
}

.guild-card.top-3::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--bronze);
    box-shadow: 0 0 20px var(--bronze);
}

.guild-rank {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    font-weight: 800;
    color: var(--orange-primary);
    opacity: 0.3;
}

.guild-icon {
    font-size: 64px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px var(--orange-primary));
}

.guild-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

.guild-name-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s;
}

.guild-name-link:hover {
    color: var(--orange-primary);
}

.guild-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 140, 66, 0.2);
    border-bottom: 1px solid rgba(255, 140, 66, 0.2);
}

.guild-stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--orange-primary);
}

.guild-master {
    text-align: center;
    font-size: 14px;
}

.master-label {
    color: var(--text-muted);
    margin-right: 8px;
}

.master-name {
    color: var(--orange-light);
    font-weight: 600;
}

/* ========== ПОДВАЛ ========== */
.footer {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 140, 66, 0.2);
    padding: 60px 0 30px;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 12px;
}

.footer-col a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
}

.footer-col a:hover {
    color: var(--orange-primary);
    padding-left: 5px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.footer-description {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 140, 66, 0.1);
    border: 1px solid rgba(255, 140, 66, 0.3);
    border-radius: 50%;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
}

.social-link:hover {
    background: var(--orange-primary);
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid rgba(255, 140, 66, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 14px;
}

.magic-signature {
    color: var(--orange-primary);
    font-style: italic;
}

/* ========== АДАПТАЦИЯ ========== */
@media (max-width: 1024px) {
    .table-header {
        grid-template-columns: 60px 1fr 120px 180px;
    }

    .table-row {
        grid-template-columns: 60px 1fr 120px 180px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .nav.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 80px;
        left: 0;
        right: 0;
        background: rgba(10, 15, 26, 0.95);
        backdrop-filter: blur(12px);
        padding: 20px;
        border-bottom: 1px solid rgba(255, 140, 66, 0.2);
        z-index: 99;
    }

    .mobile-menu-btn {
        display: block;
    }

    .top-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .tabs {
        justify-content: center;
    }

    .table-header {
        grid-template-columns: 50px 1fr 100px 150px;
        font-size: 12px;
        padding: 15px;
    }

    .table-row {
        grid-template-columns: 50px 1fr 100px 150px;
        padding: 12px 15px;
    }

    .guilds-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-logo {
        justify-content: center;
    }

    .social-links {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .table-header {
        grid-template-columns: 40px 1fr 80px 120px;
        font-size: 11px;
        padding: 10px;
    }

    .table-row {
        grid-template-columns: 40px 1fr 80px 120px;
        padding: 10px;
    }

    .rank {
        font-size: 14px;
    }

    .player-name {
        font-size: 14px;
    }

    .player-title {
        font-size: 10px;
    }

    .value {
        font-size: 12px;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.table-row,
.guild-card {
    animation: fadeInUp 0.5s ease-out forwards;
}