/* css/style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #0d001a, #1a0033, #2a004d);
    color: #e0e0ff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    padding: 20px;
}

h1, h2, h3 {
    color: #00f0ff;
    text-shadow: 0 0 12px #00f0ff88;
}

.message {
    text-align: center;
    padding: 12px;
    background: rgba(0,240,255,0.15);
    border: 1px solid #00f0ff;
    border-radius: 10px;
    margin: 1rem 0;
}

.message.success {
    background: rgba(0,255,136,0.15);
    border-color: #00ff88;
}

/* ==================== ОБЩИЕ ЭЛЕМЕНТЫ ==================== */
.event-card {
    background: rgba(20, 20, 60, 0.6);
    border: 1px solid #00f0ff55;
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1.2rem 0;
    backdrop-filter: blur(8px);
    transition: all 0.25s;
}

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px #00f0ff44;
    border-color: #00f0ff;
}

.teams {
    font-size: 1.2rem;
    margin: 0.6rem 0;
    color: #a0f0ff;
}

.coeffs {
    margin: 0.8rem 0;
    font-size: 1.1rem;
}

form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1rem;
}

input, select, button {
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid #00f0ff66;
    background: rgba(255,255,255,0.08);
    color: white;
    font-size: 1rem;
}

input:focus, select:focus {
    outline: none;
    border-color: #00f0ff;
    box-shadow: 0 0 12px #00f0ff66;
}

button {
    background: linear-gradient(90deg, #ff00aa, #aa00ff);
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px #ff00aaaa;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #00f0ff33;
}

th {
    color: #00f0ff;
}

.status-pending { color: #ffaa00; }
.status-won     { color: #00ff88; font-weight: bold; }
.status-lost    { color: #ff5555; }

a {
    color: #00f0ff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ==================== ТОП-БАР ==================== */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: rgba(20, 20, 60, 0.95);
    border-bottom: 1px solid #00f0ff55;
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 4px 20px rgba(0, 240, 255, 0.2);
}

.topbar-logo img {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 0 10px #00f0ff);
}

.topbar-nav {
    flex: 1;
    display: flex;
    justify-content: center;
    gap: 40px;
}

.topbar-nav a {
    color: #e0e0ff;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 12px;
    transition: all 0.3s;
}

.topbar-nav a:hover {
    background: rgba(0, 240, 255, 0.2);
    color: #00f0ff;
    box-shadow: 0 0 15px #00f0ff44;
}

.topbar-nav a.active {
    background: linear-gradient(90deg, #ff00aa, #aa00ff);
    color: white;
}

.topbar-right a {
    color: #ff5555;
    font-size: 1.1rem;
}

/* Смещение контента */
.main-content {
    margin-top: 100px;
    padding: 20px;
}

/* ==================== ПРОФИЛЬ ==================== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    background: rgba(20,20,60,0.6);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid #00f0ff44;
}

.avatar-section {
    text-align: center;
}

.avatar-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #00f0ff;
    box-shadow: 0 0 15px #00f0ff66;
}

.upload-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: #00f0ff;
    color: #000;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
}

.apply-btn {
    margin-top: 10px;
    padding: 10px 20px;
    background: linear-gradient(90deg, #00ff88, #00cc66);
    border: none;
    color: white;
    border-radius: 999px;
    cursor: pointer;
    font-weight: bold;
}

.user-info h3 {
    margin: 0 0 0.5rem 0;
    color: #00f0ff;
}

/* Steam кнопки в профиле */
.steam-status {
    margin-top: 20px;
    text-align: center;
}

.steam-action-btn {
    display: inline-block;
    padding: 14px 32px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 999px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 220px;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
}

.steam-action-btn.link {
    background: linear-gradient(90deg, #1b9e1b, #2ecc71);
    color: white;
    border: none;
}

.steam-action-btn.link:hover {
    background: linear-gradient(90deg, #169016, #27ae60);
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(46,204,113,0.8);
}

.steam-action-btn.unlink {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
    color: white;
    border: none;
}

.steam-action-btn.unlink:hover {
    background: linear-gradient(90deg, #c0392b, #a93226);
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(231,76,60,0.8);
}

.nickname-form {
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* ==================== ЧАТ ==================== */
.chat-sidebar {
    position: fixed;
    left: 0;
    top: 80px;
    width: 300px;
    height: calc(100vh - 80px);
    background: rgba(20, 20, 60, 0.95);
    border-right: 1px solid #00f0ff55;
    display: flex;
    flex-direction: column;
    z-index: 900;
}

.chat-header {
    padding: 15px;
    background: rgba(0, 240, 255, 0.2);
    text-align: center;
    border-bottom: 1px solid #00f0ff55;
}

.chat-header h3 {
    margin: 0;
    color: #00f0ff;
}

.chat-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background: rgba(10, 10, 40, 0.8);
}

.chat-msg {
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(0, 240, 255, 0.1);
    border-radius: 8px;
    border-left: 3px solid #00f0ff;
}

.chat-msg strong {
    color: #00f0ff;
}

.chat-msg small {
    color: #aaa;
    font-size: 0.8rem;
}

.chat-form {
    padding: 10px;
    display: flex;
    background: rgba(20, 20, 60, 1);
    border-top: 1px solid #00f0ff55;
}

.chat-form input {
    flex: 1;
    padding: 10px;
    border-radius: 999px 0 0 999px;
    border: 1px solid #00f0ff66;
    background: rgba(255,255,255,0.08);
    color: white;
}

.chat-form button {
    padding: 10px 20px;
    border-radius: 0 999px 999px 0;
    background: linear-gradient(90deg, #ff00aa, #aa00ff);
    color: white;
    border: none;
    cursor: pointer;
}

.main-with-chat {
    margin-left: 320px;
    padding: 20px;
}

/* ==================== TWITCH СТРИМ ==================== */
.twitch-stream-container {
    margin: 20px 0;
    text-align: center;
    background: rgba(20, 20, 60, 0.8);
    border: 1px solid #00f0ff55;
    border-radius: 16px;
    padding: 15px;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

.twitch-title {
    color: #00f0ff;
    text-shadow: 0 0 10px #00f0ff88;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.twitch-embed {
    position: relative;
    width: 100%;
    height: 250px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 15px #9146ff88;
}

.twitch-embed iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ==================== АДАПТИВ ==================== */
@media (max-width: 992px) {
    .chat-sidebar {
        position: static;
        width: 100%;
        height: 400px;
    }
    .main-with-chat {
        margin-left: 0;
    }
    .twitch-embed, .twitch-embed iframe {
        height: 200px;
    }
    .twitch-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .topbar {
        height: 70px;
        padding: 0 15px;
    }
    .topbar-logo img {
        height: 50px;
    }
    .topbar-nav {
        gap: 20px;
    }
    .topbar-nav a {
        font-size: 1rem;
        padding: 8px 15px;
    }
    .main-content {
        margin-top: 80px;
    }
}