/* ================== RESET ================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ================== BASE ================== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0f0f0f;
    color: #ffffff;
    line-height: 1.6;
}

body.no-scroll {
    overflow: hidden;
}

input {
    transition: 0.2s;
}

/* ================== CONTAINER ================== */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 15px;
}

/* ================== HEADINGS ================== */
h1 {
    margin-bottom: 20px;
    color: #f5a623;
    text-align: center;
}

/* ================== LINKS ================== */
a {
    text-decoration: none;
    color: inherit;
}

/* ================== КНОПКИ (ОБЩИЕ) ================== */
.logout-btn,
.event-link {
    background: linear-gradient(45deg, #f5a623, #ff7b00);
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    text-align: center;
    display: inline-block;
    font-family: inherit;
}

.logout-btn:hover,
.event-link:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(245, 166, 35, 0.7);
}

/* ================== НАВИГАЦИЯ (НОВАЯ) ================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 215, 0, 0.25);
    font-family: inherit;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.navbar-logo {
    flex-shrink: 0;
}
.navbar-logo img {
    height: 40px;
    width: auto;
    display: block;
    transition: opacity 0.2s;
}
.navbar-logo:hover img {
    opacity: 0.8;
}

.navbar-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.nav-link {
    padding: 0.5rem 1rem;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
}
.nav-link:hover {
    background: rgba(255, 215, 0, 0.15);
    color: #f5a623;
}
.nav-link.active {
    background: linear-gradient(135deg, #f5a623, #ffcc33);
    color: #000;
    font-weight: bold;
}
.admin-link {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 215, 0, 0.5);
}
.admin-link:hover {
    background: rgba(255, 0, 0, 0.4);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.social-links {
    display: flex;
    gap: 0.5rem;
}
.social-icon {
    width: 32px;
    height: 32px;
    background-size: 60%;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    transition: background-color 0.2s;
}
.social-icon.vk {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M21 7.5c-0.3-0.9-1-1.5-1.8-1.5H4.8c-0.8 0-1.5 0.6-1.8 1.5L3 9.5c0 0.2 0 0.4 0.1 0.6...'/%3E%3C/svg%3E");
    background-color: #4c75a3;
}
.social-icon.tg {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm4.6 6.8l-1.4 6.8c-0.1 0.4-0.4 0.6-0.7 0.6-0.1 0-0.2 0-0.3-0.1l-2.2-1.6-1.4 1.4c-0.1 0.1-0.2 0.1-0.3 0.1s-0.2 0-0.3-0.1c-0.2-0.1-0.3-0.3-0.3-0.5l0-2.2 4.4-4c0.2-0.2 0.2-0.5 0-0.7-0.2-0.2-0.5-0.2-0.7 0l-5 4.5-2-1.4c-0.4-0.3-0.4-0.8-0.1-1.1l8-3.6c0.3-0.1 0.6 0 0.8 0.2 0.2 0.2 0.3 0.4 0.2 0.7z'/%3E%3C/svg%3E");
    background-color: #28a8e9;
}
.social-icon:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Кнопки входа/регистрации */
.btn {
    padding: 0.4rem 1rem;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s;
    display: inline-block;
}
.btn-outline {
    background: transparent;
    border: 1px solid #f5a623;
    color: #f5a623;
}
.btn-outline:hover {
    background: #f5a623;
    color: #000;
}
.btn-primary {
    background: #f5a623;
    border: none;
    color: #000;
}
.btn-primary:hover {
    background: #ffcc33;
    transform: scale(1.02);
}
.auth-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Пользовательское меню */
.user-dropdown {
    position: relative;
}
.user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.1);
    border: none;
    padding: 0.3rem 0.8rem;
    border-radius: 40px;
    cursor: pointer;
    color: white;
    font-weight: 500;
}
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.user-name {
    font-size: 0.9rem;
}
.dropdown-arrow {
    border: solid white;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    transition: transform 0.2s;
}
.user-btn.open .dropdown-arrow {
    transform: rotate(-135deg);
}
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #1a1a1a;
    border-radius: 12px;
    min-width: 200px;
    margin-top: 0.5rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,215,0,0.3);
    opacity: 0;
    visibility: hidden;
    transition: 0.2s;
    z-index: 1001;
}
.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
}
.dropdown-menu a, .dropdown-menu button {
    display: block;
    padding: 0.7rem 1rem;
    color: #eee;
    text-decoration: none;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
}
.dropdown-menu a:hover, .dropdown-menu button:hover {
    background: rgba(255,215,0,0.2);
}
.dropdown-menu hr {
    margin: 0.3rem 0;
    border-color: #333;
}
.logout-btn {
    color: #050001;
}

/* Бургер-иконка */
.burger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}
.burger span {
    width: 100%;
    height: 2px;
    background: white;
    transition: 0.2s;
}
.burger.open span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.burger.open span:nth-child(2) {
    opacity: 0;
}
.burger.open span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Мобильное меню */
.mobile-menu {
    position: fixed;
    inset: 0;
    overflow-y: auto;

    display: flex;
    flex-direction: column;

    background: rgba(0,0,0,.95);
    backdrop-filter: blur(10px);

    z-index: 1001;

    transform: translateX(100%);
    transition: transform .3s ease;
}
.mobile-menu.open {
    transform: translateX(0);
}
.mobile-menu-inner {
    display: flex;
    flex-direction: column;
    padding: 80px 2rem 2rem;
    gap: 1rem;
}
.mobile-link {
    color: white;
    font-size: 1.2rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-decoration: none;
}
.mobile-social {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}
.mobile-social a {
    color: #f5a623;
    text-decoration: none;
}
.mobile-auth {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Адаптив для навигации */
@media (max-width: 900px) {
    .navbar-nav, .social-links, .auth-buttons {
        display: none;
    }
    .burger {
        display: flex;
    }
    .navbar-container {
        padding: 0.75rem 1rem;
    }
    .user-name {
        display: none;
    }
    .user-btn {
        padding: 0.3rem;
    }
}
@media (min-width: 901px) {
    .mobile-menu {
        display: none;
    }
}

/* ================== СПИСОК СОБЫТИЙ ================== */
.event-list-simple {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.event-item {
    background: #1a1a1a;
    border: 1px solid #333;
    border-left: 4px solid #f5a623;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    gap: 20px;
    align-items: center;
    transition: 0.3s;
    cursor: pointer;
}

.event-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 15px rgba(245, 166, 35, 0.3);
}

.event-image img {
    width: 150px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.event-main {
    flex: 1;
}

.no-events {
    text-align: center;
    color: #aaa;
    padding: 20px;
}

/* ================== ФОРМЫ ================== */
textarea[name="players"] {
    width: 100%;
    min-height: 300px;
    resize: vertical;
}

.input-dark {
    width: 100%;
    background: #0f0f0f;
    color: #fff;
    border: 1px solid #333;
    padding: 14px 16px;
    font-size: 16px;
    border-radius: 10px;
}

.input-dark:focus {
    outline: 2px solid #f5a623;
}

#tournamentFormMessage {
    margin-top: 15px;
    font-weight: bold;
}

/* ================== БЕГУЩАЯ СТРОКА ================== */
#ticker-bar {
    width: 100%;
    overflow: hidden;
    background: #111;
    color: #fff;
}

#ticker-content {
    white-space: nowrap;
    display: inline-block;
    padding: 6px 0;
    font-size: 14px;
}

/* ================== WINNER BAR ================== */
.winner-bar-wrap {
    margin: 20px 0 30px;
}

.winner-bar-title {
    font-size: 14px;
    opacity: 0.75;
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: 0.5px;
}

.winner-bar {
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(255, 215, 0, 0.22);
    border-radius: 12px;
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.08);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.winner-item {
    position: relative;
    overflow: hidden;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    color: #fff;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(6px);
}

.winner-item::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -60%;
    width: 220%;
    height: 220%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255,255,255,0.08),
        rgba(255,215,0,0.22),
        transparent
    );
    transform: rotate(25deg);
    animation: shine 3.2s linear infinite;
}

.w1 {
    border-color: rgba(255,215,0,0.65);
    box-shadow: 0 0 12px rgba(255,215,0,0.18);
}

.w2 {
    border-color: rgba(192,192,192,0.65);
    box-shadow: 0 0 12px rgba(192,192,192,0.12);
}

.w3 {
    border-color: rgba(205,127,50,0.65);
    box-shadow: 0 0 12px rgba(205,127,50,0.12);
}

.winner-bar-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.winner-bar-link:hover .winner-item {
    transform: scale(1.02);
    transition: 0.2s ease;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(25deg);
    }
    100% {
        transform: translateX(100%) rotate(25deg);
    }
}

/* ================== АДМИНКА ================== */
.admin-page h2 {
    color: #f5a623;
    margin-bottom: 15px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.admin-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-left: 4px solid #f5a623;
    border-radius: 10px;
    padding: 18px;
    transition: 0.3s;
}

.admin-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 15px rgba(245, 166, 35, 0.3);
}

.admin-card-title {
    display: block;
    color: #f5a623;
    font-weight: bold;
    margin-bottom: 8px;
}

.admin-card-text {
    display: block;
    font-size: 14px;
    color: #ccc;
}

.admin-section {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.admin-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #ddd;
    font-weight: 600;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
    width: 100%;
    background: #0f0f0f;
    color: #fff;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px;
    font-size: 15px;
}

.admin-form textarea {
    min-height: 120px;
    resize: vertical;
}

.admin-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.admin-checkboxes {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.admin-checkboxes label {
    flex-direction: row;
    align-items: center;
}

.admin-success {
    background: rgba(0, 180, 90, 0.18);
    border: 1px solid rgba(0, 180, 90, 0.4);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    color: #8cffb0;
}

.admin-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.admin-item {
    background: #0f0f0f;
    border: 1px solid #333;
    border-left: 4px solid #f5a623;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    align-items: flex-start;
}

.admin-item-main {
    flex: 1;
}

.admin-meta {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-meta span {
    background: #1a1a1a;
    border: 1px solid #333;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 13px;
    color: #ccc;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    max-width: 420px;
}

.admin-actions form {
    margin: 0;
}

.admin-actions button.event-link:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.admin-badge {
    background: #6f42c1;
    color: #fff;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: bold;
}

/* ================== СТАТУСЫ ================== */
.status-open,
.status-active {
    color: #33d17a !important;
    font-weight: bold;
}

.status-closed {
    color: #ff5c5c !important;
    font-weight: bold;
}

.status-draft {
    color: #aaa !important;
    font-weight: bold;
}

.status-archived,
.status-completed {
    color: #b388ff !important;
    font-weight: bold;
}

.status-registration {
    color: #f5a623 !important;
    font-weight: bold;
}

/* ================== ТУРНИРЫ НА ГЛАВНОЙ ================== */
.tournament-home-item {
    align-items: flex-start;
}

.tournament-empty-bracket {
    margin-top: 15px;
    padding: 12px;
    background: #0f0f0f;
    border: 1px dashed #444;
    border-radius: 10px;
    color: #aaa;
}

.home-bracket-tree {
    margin-top: 15px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(230px, 270px);
    gap: 35px;
    overflow-x: auto;
    align-items: start;
    padding-bottom: 8px;
}

.tree-round {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.tree-round-title {
    color: #f5a623;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 4px;
    text-align: center;
}

.tree-match {
    display: grid;
    grid-template-rows: auto auto auto;
    gap: 4px;
    position: relative;
}

.tree-player {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 7px;
    padding: 7px 9px;
    font-size: 14px;
}

.tree-connector {
    color: #f5a623;
    font-weight: bold;
    font-size: 13px;
    padding-left: 26px;
    white-space: nowrap;
    line-height: 1.3;
}

.tree-round-2 {
    padding-top: 42px;
}
.tree-round-3 {
    padding-top: 105px;
}
.tree-round-4 {
    padding-top: 230px;
}
.tree-round-5 {
    padding-top: 480px;
}

/* ================== ФУТЕР ================== */
.footer {
    background: #111;
    border-top: 2px solid #f5a623;
    color: #ccc;
    margin-top: 40px;
    padding: 20px;
    text-align: center;
}

/* ================== ТУРНИРНАЯ СЕТКА ================== */
.bracket-page {
    margin-top: 25px;
    display: flex;
    gap: 35px;
    align-items: stretch;
    overflow-x: auto;
    padding: 15px 5px 25px;
}

.bracket-round {
    min-width: 230px;
    display: flex;
    flex-direction: column;
}

.bracket-round-title {
    color: #f5a623;
    text-align: center;
    font-size: 18px;
    margin-bottom: 18px;
}

.bracket-round-matches {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 20px;
}

.bracket-match {
    background: #1a1a1a;
    border: 1px solid #333;
    border-left: 4px solid #f5a623;
    border-radius: 10px;
    padding: 10px;
    transition: 0.2s;
}

.bracket-match-odd {
    background: #1a1a1a;
}
.bracket-match-even {
    background: #151515;
}

.bracket-player {
    background: #0f0f0f;
    border: 1px solid #333;
    border-radius: 7px;
    padding: 8px 10px;
    font-size: 14px;
}

.bracket-meta {
    color: #f5a623;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 2px;
    text-align: center;
}

.bracket-player-winner {
    border-color: #33d17a;
    color: #33d17a;
    font-weight: bold;
}

.bracket-next-info {
    font-size: 10px;
    color: #888;
    text-align: center;
    margin-top: 8px;
    border-top: 1px dashed #333;
    padding-top: 6px;
}

.tournament-next-match {
    margin-top: 12px;
    padding: 12px;
    background: #0f0f0f;
    border: 1px solid #333;
    border-radius: 10px;
}

/* ================== ИНФОРМАЦИОННЫЙ БЛОК (нет событий) ================== */
.info-empty-wrap {
    margin: 20px 0 30px;
}
.info-empty-title {
    font-size: 14px;
    opacity: 0.75;
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: 0.5px;
}
.info-empty-bar {
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(255, 215, 0, 0.22);
    border-radius: 12px;
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
}
.info-empty-text {
    text-align: center;
    font-size: 1rem;
    color: #e0e0e0;
    line-height: 1.4;
    margin-bottom: 10px;
}
.info-empty-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}
.info-empty-buttons .winner-item.social-item {
    animation: none;
    background: #1a1a1a;
    backdrop-filter: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255,215,0,0.5);
    box-shadow: 0 0 8px rgba(245,166,35,0.4);
}
.info-empty-buttons .winner-item.social-item::before {
    display: none;
}
.info-empty-buttons .winner-item.social-item:hover {
    transform: scale(1.02);
    box-shadow: 0 0 16px rgba(245,166,35,0.8);
    border-color: #f5a623;
}
@media (max-width: 600px) {
    .info-empty-buttons {
        flex-direction: column;
        gap: 10px;
    }
    .info-empty-buttons .winner-item.social-item {
        justify-content: center;
    }
}

/* ================== АДАПТИВ ДЛЯ ОСТАЛЬНЫХ ЭЛЕМЕНТОВ ================== */
@media (max-width: 992px) {
    .admin-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .admin-item {
        flex-direction: column;
    }
    .admin-actions {
        max-width: none;
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .container {
        margin: 20px auto;
        padding: 0 10px;
    }
    .event-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .event-image img {
        width: 100%;
        height: auto;
    }
    .event-link,
    .tournament-home-item .event-link {
        width: 100%;
        margin-top: 10px;
    }
    .admin-grid {
        grid-template-columns: 1fr;
    }
    .admin-section {
        padding: 15px;
    }
    .admin-form-row {
        grid-template-columns: 1fr;
    }
    .admin-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
    .admin-actions .event-link,
    .admin-actions button.event-link {
        width: 100%;
    }
    .admin-meta {
        flex-direction: column;
    }
    .admin-meta span {
        width: 100%;
    }
    .home-bracket-tree {
        grid-auto-columns: minmax(210px, 240px);
        gap: 22px;
    }
    .tree-player {
        font-size: 13px;
    }
    .tree-connector {
        font-size: 12px;
    }
    .tree-round-2,
    .tree-round-3,
    .tree-round-4,
    .tree-round-5 {
        padding-top: 0;
    }
    .bracket-match {
        padding: 6px;
    }
    .bracket-player {
        font-size: 12px;
        padding: 5px 8px;
    }
    .bracket-meta {
        font-size: 9px;
    }
    .bracket-next-info {
        font-size: 8px;
    }
}




body.scroll-lock {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
}




.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 0 10px 0;
    margin-bottom: 5px;
}
.mobile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: #1a1a1a;
}
.mobile-user-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #f5a623;
}
