/* --- ЗМІННІ (Глобальна палітра RES) --- */
:root {
    --bg-main: #0D0C0B;       /* Фон сайту */
    --bg-card: #1A1816;       /* Колонки / Контейнери */
    --text-main: #FFF5E6;     /* Головний текст */
    --accent-orange: #FF9F1C; /* Акцент 1 (Помаранчевий) */
    --accent-gold: #FFD700;   /* Акцент 2 (Золотий) */
    --border-color: rgba(255, 245, 230, 0.1); /* Легкі бордери */

    /* Зворотна сумісність для старих сторінок (щоб нічого не зламалося) */
    --accent-pink: var(--accent-orange); 
    --accent-blue: var(--accent-gold);
}

/* --- БАЗОВІ НАЛАШТУВАННЯ --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Manrope', sans-serif;
    min-height: 100vh;
    padding: 0 60px; /* Додаємо глобальні відступи по боках */
}

/* --- УНІВЕРСАЛЬНА ШАПКА (HEADER) --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0; /* Прибираємо горизонтальні паддінги, бо вони вже на body */
    max-width: 1440px; /* Обмежуємо ширину */
    margin: 0 auto; /* Центруємо */
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

.logo-icon {
    height: 45px;
    display: block;
}

.logo-text {
    color: var(--text-main);
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.2;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 35px;
}

.nav-links a {
    color: rgba(255, 245, 230, 0.6);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--text-main);
}

/* Активна вкладка з рискою */
.nav-links a.active {
    color: var(--accent-orange);
    font-weight: 600;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--accent-orange);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255, 159, 28, 0.5);
}

/* --- БАЗОВИЙ КОНТЕЙНЕР ДЛЯ ВСІХ СТОРІНОК (ЗАСТАРІЛИЙ, АЛЕ ЗАЛИШАЄМО) --- */
.main-container {
    padding-bottom: 40px;
}
/* =========================================
   УНІВЕРСАЛЬНІ UI КОМПОНЕНТИ (Бокси, Форми, Кнопки)
   ========================================= */

/* --- 1. КАРТКИ ТА КОНТЕЙНЕРИ (Ті самі "боксики") --- */
.t-card, .mod-content, .reg-form, .admin-card, .auth-box, .tourney-summary,
.card { /* ВИДАЛИЛИ .player-card, бо він матиме свої стилі */
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: var(--text-main);
}

/* Внутрішні відступи для текстових карток (Новини, Профіль, Адмінка) */
.card, .mod-content, .reg-form, .admin-card {
    padding: 25px;
}

/* Ефект наведення для інтерактивних карток */
.t-card:hover, .admin-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-orange);
    box-shadow: 0 15px 40px rgba(255, 159, 28, 0.15);
}

/* --- 2. СІТКИ (Bento Grids) --- */
.bento-grid, .tournaments-grid, .admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); /* Адаптивні колонки */
    gap: 30px; /* Зменшимо gap для кращого вигляду */
    max-width: 1440px; /* Обмежуємо максимальну ширину */
    margin: 30px auto 0 auto; /* Центруємо сітку */
    width: 100%;
}

/* Заголовок сторінки, що займає всю ширину сітки */
.page-header {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 10px;
}

/* Стиль для картинок у новинах */
.card-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}

/* Стиль для тексту новин */
.news-content {
    margin-top: 15px;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 245, 230, 0.8);
}

/* Щоб вставлені відео та твіти не вилазили за межі */
.embed-container {
    margin-top: 20px;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
}
.embed-container iframe, .embed-container blockquote {
    max-width: 100% !important;
}

/* --- 3. ФОРМИ ТА ІНПУТИ --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: rgba(255, 245, 230, 0.7);
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

input[type="text"], 
input[type="password"], 
input[type="email"], 
select, 
textarea {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.4);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    font-size: 15px;
    font-family: 'Manrope', sans-serif;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent-orange);
    box-shadow: 0 0 10px rgba(255, 159, 28, 0.2);
}

/* --- 4. УНІВЕРСАЛЬНІ КНОПКИ --- */
.submit-btn, .update-btn, .action-btn {
    display: inline-block;
    width: 100%;
    padding: 15px;
    background-color: var(--accent-orange);
    color: var(--bg-main); /* Темний текст на яскравому фоні для контрасту */
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.submit-btn:hover, .update-btn:hover, .action-btn:hover {
    background-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

button:disabled, .btn-disabled {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.4) !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
}

/* --- 5. МОДАЛЬНІ ВІКНА (Турніри, Реєстрація) --- */

/* Фон позаду вікна */
.t-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.t-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Сама картка (РОБИМО ЇЇ ШИРОКОЮ) */
.t-hero-card {
    background: #0d1117; /* Темний фон */
    width: 100%;
    max-width: 800px; /* Ширина як у справжньому кіберспорті */
    border-radius: 16px;
    border: 1px solid rgba(80, 227, 194, 0.2);
    position: relative;
    overflow: hidden; /* Щоб картинка не вилазила */
    transform: translateY(20px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto; /* Щоб можна було скролити, якщо екран маленький */
}

.t-modal-overlay.active .t-hero-card {
    transform: translateY(0);
}

/* Кнопка "Х" для закриття */
.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
}
.close-modal:hover { background: #ff4646; }

/* Обкладинка турніру */
.hero-banner {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Контейнер для тексту і кнопок */
.hero-content {
    padding: 30px;
}

.hero-title {
    font-size: 28px;
    color: #fff;
    margin-bottom: 15px;
}

.hero-desc {
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    margin-bottom: 30px;
    font-size: 15px;
}

/* СІТКА ХАРАКТЕРИСТИК (BENTO STYLE) */
.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); /* 4 рівні колонки */
    gap: 15px;
    margin-bottom: 30px;
}

.hero-stat-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.hero-stat-label {
    display: block;
    font-size: 11px;
    color: #888;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-stat-value {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

/* ГОЛОВНА КНОПКА (action-btn) */
.action-btn {
    display: block;
    width: 100%;
    padding: 16px;
    text-align: center;
    color: #000 !important; /* Чорний текст на яскравому фоні */
    font-weight: 800;
    font-size: 16px;
    border-radius: 8px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.action-btn:hover:not(.btn-disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(80, 227, 194, 0.4);
}

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: #fff !important;
}

/* =========================================
   СТИЛІ СТОРІНКИ ТУРНІРІВ
   ========================================= */

.t-card {
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.t-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.t-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.t-card:hover .t-image {
    transform: scale(1.05);
}

.t-status-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 2;
    /* Інші стилі задаються інлайново через JS */
}

.t-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Дозволяє контенту зайняти весь вільний простір */
    padding: 20px;
}

.t-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.t-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: rgba(255, 245, 230, 0.6);
    margin-bottom: 8px;
}

.t-info-val {
    font-weight: 600;
    color: var(--text-main);
}

/* Магія, щоб притиснути призові до низу */
.t-info-row[style*="margin-top: auto"] {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px dashed var(--border-color);
}

/* =========================================
   СТИЛІ СТОРІНКИ СТАТИСТИКИ
   ========================================= */
.player-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    padding: 0; /* Прибираємо глобальний padding */
}

.player-header {
    position: relative;
    height: 100px;
    display: flex;
    align-items: flex-end;
    padding: 15px;
}

.player-banner {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0.3;
}

.player-info, .ranks-container {
    position: relative;
    z-index: 2;
}

.player-info {
    margin-right: auto;
}

.player-name {
    font-size: 1.2rem;
    font-weight: 700;
}
.player-tag {
    color: rgba(255,255,255,0.5);
}

.ranks-container {
    display: flex;
    gap: 10px;
}
.rank-box {
    background: rgba(0,0,0,0.4);
    border-radius: 8px;
    padding: 5px 10px;
    text-align: center;
}
.rank-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}
.rank-icon {
    width: 40px;
    height: 40px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.stat-box {
    padding: 15px;
    text-align: center;
    border-left: 1px solid var(--border-color);
}
.stat-box:first-child { border-left: none; }

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    display: block;
}
.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
}

.kd-good { color: #50E3C2; }
.kd-bad { color: #ff4646; }

.last-updated {
    padding: 8px 15px;
    font-size: 12px;
    text-align: right;
    color: rgba(255,255,255,0.4);
    background: rgba(0,0,0,0.2);
}

/* =========================================
   СТИЛІ ПАНЕЛІ МОДЕРАТОРА
   ========================================= */
.mod-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.mod-sidebar {
    flex: 0 0 250px; /* Фіксована ширина */
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 15px;
}

.mod-menu-btn {
    display: block;
    width: 100%;
    padding: 12px 15px;
    background: transparent;
    border: none;
    color: rgba(255, 245, 230, 0.6);
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.mod-menu-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.mod-menu-btn.active {
    background-color: rgba(255, 159, 28, 0.1);
    color: var(--accent-orange);
    font-weight: 700;
}

.mod-content {
    flex: 1; /* Займає весь вільний простір */
}

/* СТИЛІ ДЛЯ ADMIN HUB */
.admin-card .icon-box {
    font-size: 2.5rem;
    margin-bottom: 15px;
    background: rgba(255,255,255,0.05);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

/* =========================================
   СТИЛІ СТОРІНКИ НОВИН
   ========================================= */

/* Заокруглюємо головний банер новин */
.news-hero, .hero-banner-container, .main-article {
    width: 100%;
    border-radius: 24px; /* Круглі кути в стилі RES */
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    margin-top: 10px;
    grid-column: 1 / -1; /* Розтягуємо на всю ширину */
}

/* Переконуємось, що сама картинка всередині банера не ламає кути */
.news-hero img, .hero-banner-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* === ТУРНІРНА СІТКА (BENTO BRACKETS) === */
.bracket-wrapper {
    display: flex;
    gap: 30px; /* Відстань між раундами */
    overflow-x: auto; /* Дозволяємо скролити горизонтально на телефонах */
    padding: 20px 0;
    margin-top: 20px;
    border-top: 1px dashed rgba(255,255,255,0.1);
}

/* Колонка одного раунду (напр. Чвертьфінали) */
.bracket-round {
    display: flex;
    flex-direction: column;
    justify-content: space-around; /* МАГІЯ: автоматично центрує матчі відносно сусідньої колонки! */
    gap: 20px;
    min-width: 220px;
}

.bracket-round-title {
    text-align: center;
    color: var(--accent-blue);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

/* Картка конкретного матчу */
.bracket-match {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Рядок команди в матчі */
.bracket-team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.bracket-team:last-child {
    border-bottom: none;
}

/* Стиль для переможця */
.bracket-team.winner {
    background: rgba(80, 227, 194, 0.1);
    border-left: 3px solid var(--accent-blue);
}

.bracket-team.winner .b-name,
.bracket-team.winner .b-score {
    color: var(--accent-blue);
    font-weight: 800;
}

.b-name { font-size: 14px; color: #fff; }
.b-score { font-size: 15px; color: #888; font-weight: bold; }

/* === БЛОК ЗДІБНОСТЕЙ (ABILITIES) === */
.abilities-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.ability-slot {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    font-weight: 800;
    color: #444; /* Сірий, якщо розряджено */
    position: relative;
    transition: all 0.2s ease;
}

/* Коли здібність заряджена */
.ability-slot.active {
    border-color: #50E3C2;
    color: #fff;
    background: rgba(80, 227, 194, 0.1);
    box-shadow: 0 0 10px rgba(80, 227, 194, 0.2);
}

/* Спеціальний стиль для Ульти (X) */
.ability-slot.ult.active {
    border-color: #f5a623;
    background: rgba(245, 166, 35, 0.15);
    box-shadow: 0 0 15px rgba(245, 166, 35, 0.3);
    color: #f5a623;
}

/* Кружечок з цифрою зарядів (скільки смоків/флешок) */
.charge-badge {
    position: absolute;
    bottom: -6px;
    right: -6px;
    background: #111;
    border: 1px solid #50E3C2;
    color: #50E3C2;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

.ability-slot:not(.active) .charge-badge {
    border-color: #444;
    color: #444;
}

/* === БЛОК ЗБРОЇ ТА ПАТРОНІВ === */
.weapon-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.w-name {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.w-ammo {
    font-family: monospace;
    font-size: 16px;
    font-weight: bold;
    color: #50E3C2;
}

.w-reserve {
    font-size: 12px;
    color: #888;
}
