html {
    scroll-behavior: smooth;
}

body {
    margin:0;
    font-family: 'Segoe UI', sans-serif;
    color: white;
    background: black;
}

/* BACKGROUND (только до блока «Новости») */
.page-top {
    position: relative;
    overflow: hidden;
}

.page-top .bg {
    position: absolute;
    inset: 0;
    background: url('../images/background.png') center/cover;
    filter: brightness(0.4);
    z-index: 0;
    pointer-events: none;
}

.page-top > *:not(.bg) {
    position: relative;
    z-index: 1;
}

/* NAVBAR */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
    flex-wrap: wrap;
}

.logo-block {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    font-size: 20px;
}

.logo-block img {
    width: 45px;
}

.accent {
    color: #ff2e2e;
}

/* NAV */
nav {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: nowrap;
}

nav a {
    text-decoration: none;
    color: white;
    font-weight: 500;
    position: relative;
}

nav a::after {
    content: "";
    position: absolute;
    width: 0%;
    height: 2px;
    background: #ff2e2e;
    left: 0;
    bottom: -5px;
    transition: 0.3s;
}

nav a:hover::after {
    width: 100%;
}

button {
    color: black;
}

.login-btn {
    background: #ff2e2e;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-btn:hover {
    background: #ff5555;
    box-shadow: 0 0 10px rgba(255,0,0,0.5);
}

/* HERO */
.hero {
    text-align: center;
    padding: 140px 20px 100px;
}

.hero h1 {
    font-size: 48px;
    line-height: 1.3;
}

.title-main {
    font-size: 60px;
    font-weight: 800;
}

.subtitle {
    margin-top: 15px;
    color: #aaa;
    letter-spacing: 1px;
}

.hero-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 28px;
}

.connect-btn {
    display: inline-block;
    padding: 16px 36px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, #c41e1e, #8b0000);
    border: 1px solid rgba(255, 80, 80, 0.5);
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(196, 30, 30, 0.45);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.connect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(196, 30, 30, 0.6);
    background: linear-gradient(135deg, #e02525, #a00000);
}

/* SECTION TITLE */
.section-title {
    font-size: 36px;
    margin-bottom: 40px;
    text-align: center;
}

/* STATS */
.stats {
    padding: 80px 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px,1fr));
    gap: 20px;
    width: 80%;
    margin: auto;
}

/* STAT CARD */
.stat-card {
    background: rgba(0,0,0,0.6);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,0,0,0.2), transparent);
    top: 0;
    left: -100%;
    transition: 0.6s;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 25px rgba(255,0,0,0.25);
}

/* ONLINE BIG */
.online p {
    font-size: 36px;
    font-weight: bold;
    margin: 10px 0;
}

/* PROGRESS */
.progress {
    width: 100%;
    height: 18px;
    background: #222;
    border-radius: 20px;
    overflow: hidden;
    margin-top: 10px;
}

#progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg,#ff2e2e,#ff7b00);
    transition: 1s;
}

/* PLAYERS */
.players-card {
    max-height: 250px;
    overflow-y: auto;
}

#players {
    margin-top: 10px;
}

.player {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    margin-bottom: 5px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    transition: 0.3s;
    opacity: 0;
    animation: fade 0.5s forwards;
}

.player:hover {
    background: rgba(255,0,0,0.1);
}

.player::before {
    content: "🟢";
    font-size: 10px;
}

/* SCROLL */
.players-card::-webkit-scrollbar {
    width: 6px;
}

.players-card::-webkit-scrollbar-thumb {
    background: #ff2e2e;
    border-radius: 10px;
}

/* FEATURES */
.features {
    padding: 80px 20px;
}

.cards {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

.card {
    background: rgba(255,255,255,0.05);
    padding: 25px;
    width: 260px;
    border-radius: 15px;
    transition: 0.3s;
    border: 1px solid rgba(255,255,255,0.05);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.card::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,0,0,0.2), transparent);
    top: 0;
    left: -100%;
    transition: 0.6s;
}

.card:hover::after {
    left: 100%;
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255,0,0,0.4);
    box-shadow: 0 0 25px rgba(255,0,0,0.25);
}

.card .icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.card h3 {
    margin-bottom: 10px;
}

/* NEWS */
.news {
    padding: 80px 20px;
    background: #000;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(300px,1fr));
    gap: 20px;
    width: 80%;
    margin: auto;
}

.news-card {
    background: rgba(0,0,0,0.6);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255,0,0,0.2);
    transition: 0.3s;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(255,0,0,0.3);
}

.news-title {
    font-size: 20px;
    margin-bottom: 10px;
}

.news-time {
    color: #aaa;
    font-size: 14px;
    margin-top: 10px;
}

.delete-btn {
    margin-top: 10px;
    padding: 6px 10px;
    background: #222;
    border: 1px solid #ff2e2e;
    color: #ff2e2e;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

.delete-btn:hover {
    background: #ff2e2e;
    color: white;
}

/* ADMIN BUTTON */
.admin-btn {
    display: block;
    margin: 0 auto 20px;
    padding: 10px 20px;
    background: #ff2e2e;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* MODAL */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);

    display: none; /* 👈 ВАЖНО */
    justify-content: center;
    align-items: center;

    z-index: 9999; /* 👈 ЧТОБ ПОВЕРХ ВСЕГО */
}

.modal.active {
    display: flex;
}

.hidden {
    display: none;
}

.modal-content {
    background: #111;
    padding: 30px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 320px;
    border: 1px solid rgba(255,0,0,0.3);
}

.modal-content input,
.modal-content textarea {
    background: #1a1a1a;
    border: 1px solid #333;
    color: white;
    padding: 10px;
    border-radius: 6px;
}

.modal-content button {
    background: #ff2e2e;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
}

/* ANIMATIONS */
@keyframes fade {
    to { opacity: 1 }
}

/* MOBILE */
@media(max-width: 768px){
    .title-main { font-size: 40px; }
    .stats-grid { width: 95%; }
    .navbar { padding: 15px 20px; }
    .news-grid { width: 95%; }
}

/* CHAT */
.chat {
    overflow: hidden;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    height: 400px;
    background: #111;
    border: 1px solid rgba(255,0,0,0.3);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    z-index: 9999;
}

.chat.hidden {
    display: none;
}

.chat-header {
    padding: 10px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    text-align: center;

    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.chat-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
}

.chat-message {
    margin-bottom: 10px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.chat-message img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.chat-message .name {
    font-size: 12px;
    color: #ff2e2e;
}

.chat-message .text {
    font-size: 14px;
}

.chat-input {
    padding: 10px;
    border-top: 1px solid #333;

    display: flex;
    gap: 8px;
}

.chat-input input {
    flex: 1;
    padding: 8px;
    background: #1a1a1a;
    border: none;
    color: white;
    border-radius: 6px;
}

.chat-input button {
    padding: 8px 12px;
    background: #ff2e2e;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    white-space: nowrap;
}

.chat-input button:hover {
    background-color: #ff5555;
}

.chat-content {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.chat-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-message .time {
    font-size: 11px;
    color: #777;
    margin-left: 10px;
    white-space: nowrap;
    opacity: 0.8;
}

/* немного прокачаем имя */
.chat-message .name {
    font-size: 12px;
    color: #ff2e2e;
    font-weight: 500;
}


/* FOOTER */
.footer {
    margin-top: 80px;
    background: rgba(0,0,0,0.8);
    border-top: 1px solid rgba(255,0,0,0.3);
    backdrop-filter: blur(10px);
}

.footer-content {
    width: 80%;
    margin: auto;
    padding: 30px 0;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* ЛОГО */
.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: bold;
}

.footer-logo img {
    width: 40px;
}

/* ССЫЛКИ */
.footer-links {
    display: flex;
    gap: 25px;
}

.footer-links a {
    color: #aaa;
    text-decoration: none;
    position: relative;
    transition: 0.3s;
}

.footer-links a::after {
    content: "";
    position: absolute;
    width: 0%;
    height: 2px;
    background: #ff2e2e;
    left: 0;
    bottom: -4px;
    transition: 0.3s;
}

.footer-links a:hover {
    color: white;
}

.footer-links a:hover::after {
    width: 100%;
}

/* КОПИРАЙТ */
.footer-copy {
    color: #666;
    font-size: 14px;
}

/* MOBILE */
@media(max-width: 768px){
    .footer-content {
        width: 95%;
    }

    .footer-links {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

