:root {
    --bg-dark: #080808;
    --bg-card: #121212;
    --brand-red: #ff002b;
    --text-white: #ffffff;
    --text-gray: #888888;
    --border-color: #1a1a1a;
    --brand-blue: #0077ff;
    --warning: #ff7b00;
    --warning-border: #29241f;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    overflow: hidden;
}

.app-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 260 bounds;
    width: 260px;
    background-color: #0d0d0d;
    border-right: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    z-index: 2;
}

.profile {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.profile span {
    display: flex;
    align-items: center;
}

#pop-menu {
    width: 250px;
    height: 400px;
    background: rgba(18, 18, 18, 0.45);
    position: fixed;
    bottom: 5px;
    left: 265px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 10px;
    backdrop-filter: blur(16px);

    display: none;
    opacity: 0;
    transform: translateX(-18px) translateY(8px) scale(0.98);
    pointer-events: none;

    transition:
        opacity 0.22s ease,
        transform 0.22s ease;

    will-change: opacity, transform;
    z-index: 50;
}

#pop-menu.is-open {
    display: block;
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
    pointer-events: auto;
}

#pop-menu.is-closing {
    display: block;
    opacity: 0;
    transform: translateX(-18px) translateY(8px) scale(0.98);
    pointer-events: none;
}

#pop-menu.is-closed {
    display: none;
    opacity: 0;
    transform: translateX(-18px) translateY(8px) scale(0.98);
    pointer-events: none;
}

#pop-menu .content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.logo {
    font-size: 24px;
    font-weight: 900;
    color: var(--brand-red);
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 0, 43, 0.3);
    text-align: center;
}

.logo img {
    width: 100px;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-gray);
    padding: 12px 20px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
}

.nav-btn.active {
    background-color: var(--brand-red);
    color: var(--text-white);
}

.btn-ok {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-gray);
    padding: 12px 20px;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-align: center;
    margin: 0 auto;
}

.btn-ok:hover {
    color: var(--text-white);
    background: var(--brand-blue);
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--brand-red);
    padding: 12px 20px;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-cancel:hover {
    color: var(--text-white);
    background: var(--brand-red);
}

.btn-confirm {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-gray);
    padding: 12px 20px;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-align: center;
    margin: 0 auto;
}

.btn-confirm:hover {
    color: #080808;
    background-color: #00E676; 
}

/* Main Content Area */
main {
    flex-1: 1;
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

h1 {
    font-size: 28px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 20px;
}

span.red-text {
    color: var(--brand-red);
}

html.auth-mode .sidebar {
    display: none !important;
}

#toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
    pointer-events: none; /* Zabezpiecza przed blokowaniem kliknięć pod kontenerem */
}

#popout-overlay {
    position: fixed;
    pointer-events: none;
    top: 0; left: 0;
    bottom: 0; right: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.2s ease;
    z-index: 100;
}

#popout-overlay.active {
    background: rgba(0, 0, 0, 0.4);
    pointer-events: all;
}

#popout-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#popout {
    min-width: 400px; max-width: 500px;
    min-height: 150px; max-height: 500px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.4s ease forwards;
}

#popout h3 {
    text-transform: uppercase;
    font-size: 300;
    color: var(--text-gray);
}
#popout p {
    margin: 10px 0;
}

#popout.info {
    border: 1px solid var(--border-color);
}
#popout.warning {
    border: 1px solid var(--warning-border);
}

#popout.fade-out {
    animation: fadeOut 0.4s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.toast {
    min-width: 280px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    border-radius: 8px;
    color: var(--text-white);
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    border-left: 4px solid transparent;
    animation: slideInRight 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

/* Kolory w zależności od typu powiadomienia */
.toast.success {
    border-left-color: #00E676;
}

.toast.error {
    border-left-color: var(--brand-red);
}

.toast.info {
    border-left-color: #2979FF;
}

/* Klasa dodawana przez JS przed usunięciem elementu */
.toast.fade-out {
    animation: fadeOutRight 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

/* Animacje Keyframes */
@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

/* --- WIZARD KONFIGURACYJNY (SETUP) --- */
.setup-header {
    text-align: center;
    margin-bottom: 30px;
}

/* Pasek postępu */
.progress-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto 40px auto;
    position: relative;
}

.progress-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--border-color);
    z-index: 0;
}

.progress-step {
    position: relative;
    z-index: 1;
    background-color: var(--bg-dark);
    border: 2px solid var(--border-color);
    color: var(--text-gray);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
}

.progress-step.active {
    border-color: var(--brand-red);
    color: var(--brand-red);
    box-shadow: 0 0 15px rgba(255, 0, 43, 0.2);
}

.progress-step.completed {
    background-color: var(--brand-red);
    border-color: var(--brand-red);
    color: var(--text-white);
}

/* Kontenery kroków */
.setup-step {
    display: none; /* Domyślnie ukryte */
    max-width: 600px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease forwards;
}

.setup-step.active {
    display: block;
}

/* Karty wyboru w Kroku 2 */
.choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.choice-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 30px 20px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.choice-card:hover, .choice-card.selected {
    border-color: var(--brand-red);
    background-color: rgba(255, 0, 43, 0.05);
}

/* Integracje w Kroku 1 */
.integration-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 15px;
    color: white;
    transition: opacity 0.2s;
}

.integration-btn:hover { opacity: 0.9; }
.btn-steam { background-color: #171a21; border: 1px solid #2a475e; }
.btn-discord { background-color: #5865F2; }
.btn-connected { background-color: #00E676 !important; color: #080808 !important; pointer-events: none; }

/* Karta Gracza w Kroku 3 */
.player-preview-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, #1a0004 100%);
    border: 1px solid var(--brand-red);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(255, 0, 43, 0.1);
}

.player-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--brand-red);
    margin: 0 auto 15px auto;
    background-color: #222;
    object-fit: cover;
}
.player-avatar-nav {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--brand-red);
    margin: 0 8px;
    background-color: #222;
    object-fit: cover;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- WIDOK DRUŻYNY - KARTY GRACZY --- */
.player-team-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    position: relative;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.player-team-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 0, 43, 0.4);
}

.player-team-card.captain-card {
    border-color: var(--brand-red);
    box-shadow: 0 4px 20px rgba(255, 0, 43, 0.05);
}

.player-team-card .role-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 20px;
    margin-top: 8px;
    text-transform: uppercase;
}

.role-badge.leader { background: rgba(255, 0, 43, 0.15); color: var(--brand-red); }
.role-badge.member { background: rgba(255, 255, 255, 0.05); color: var(--text-gray); }
.role-badge.sub { background: rgba(255, 152, 0, 0.15); color: #FF9800; }

.player-team-card .kick-player-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 16px;
    transition: color 0.2s;
}
.player-team-card .kick-player-btn:hover { color: var(--brand-red); }

/* Puste sloty */
.player-team-card.empty-slot {
    border-style: dashed;
    border-color: rgba(255,255,255,0.1);
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
}

.mode-container {
    width: 800px; 
    height: 400px; 
    margin: 0 auto; 
    padding: 10px; 
    border-radius: 12px; 
    border: 1px solid var(--border-color); 
    background: var(--bg-card); 
    display: flex; align-items: stretch; 
    justify-content: center; flex-wrap: wrap; 
    gap: 5px;
    animation: fadeIn 0.3s ease forwards;

}

.mode-item {
    width: 255px; 
    border-radius: 8px; 
    background: #1d1d1d; 
    cursor: pointer;
    animation: fadeIn 0.5s ease forwards;
    transition: all 0.2s ease;
}

.mode-item:hover {
    background: #222222; 
}

.mode-item .mode-poster::first-letter {
    scale: 1.0;
    transition: all 0.3s ease;
}

.mode-item:hover .mode-poster::first-letter {
    scale: 1.2;
}

.skeleton-box {
    background: linear-gradient(90deg, var(--bg-card) 25%, #1a1a1a 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.search-results-container {
    margin-top: 15px;
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.search-result-item img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.drawer-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    transform: translateX(100%);
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: #0f0f0f;
    border-left: 1px solid var(--border-color);
    box-shadow: -5px 0 25px rgba(0,0,0,0.5);
    z-index: 1001;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    will-change: transform;
}

.drawer.open {
    transform: translateX(0);
}

.drawer-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-dark);
}

.drawer-content {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Styl pojedynczego powiadomienia */
.notification-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-left: 3px solid var(--brand-red); /* Akcent wizualny */
}

.notification-card p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.notification-actions {
    display: flex;
    gap: 10px;
}

.notification-card.is-read {
    opacity: 0.72;
}

.notification-card.is-read .notification-dot {
    background: #555;
    box-shadow: none;
}

.notification-card.is-unread .notification-dot {
    background: var(--brand-red);
    box-shadow: 0 0 12px rgba(255,0,43,0.6);
}

.promo-banner {
    width: 100%; height: 600px;
    background: var(--bg-card);
    margin-top: 20px;
    border-radius: 8px;
    padding: 20px;
}

.promo-banner h2 {
    text-transform: uppercase;
}

.upcoming-tournament-item {
    width: 200px; height: 250px;
    border-radius: 8px;
    padding: 5px;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    border: 1px dashed var(--border-color);
    background: var(--bg-dark);
    transition: all 0.4s ease;
}

.upcoming-tournament-item:hover {
    scale: 1.1;
    transform: rotateZ(2deg);
    border: 1px dashed var(--brand-red);
    background: var(--border-color);
    cursor: pointer;
}

.tournament-item {
    height: 80px; 
    background: var(--bg-card);
    border-radius: 8px; 
    display: flex; 
    align-items: stretch; 
    flex-wrap: wrap; 
    padding: 8px;
}

/* --- SIDEBAR NOTIFICATIONS --- */
.notification-sidebar-card {
    width: 100%;
    position: relative;
    border: 1px solid rgba(255,255,255,0.06);
    background: linear-gradient(135deg, rgba(255,0,43,0.10), rgba(255,255,255,0.03));
    color: var(--text-white);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-align: left;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.notification-sidebar-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255,0,43,0.35);
    background: linear-gradient(135deg, rgba(255,0,43,0.18), rgba(255,255,255,0.04));
}

.notification-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
}

.notification-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.notification-text strong {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.notification-text small {
    font-size: 11px;
    color: var(--text-gray);
}

.notification-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    background: var(--brand-red);
    color: white;
    font-size: 11px;
    font-weight: 800;
    border-radius: 999px;
    border: 2px solid #0d0d0d;
}

.notification-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-gray);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.notification-card-top small {
    margin-left: auto;
    color: #555;
    text-transform: none;
    letter-spacing: 0;
}

.notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-red);
    box-shadow: 0 0 12px rgba(255,0,43,0.6);
}

/* --- FRIENDS + CHAT --- */
.friends-page {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 22px;
    height: calc(100vh - 80px);
}

.friends-sidebar-card,
.chat-card {
    background: rgba(18,18,18,0.88);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0,0,0,0.25);
}

.friends-sidebar-card {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
}

.friends-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.friends-header h1 {
    margin: 0;
}

.friends-header p,
.zone-heading p,
.tournaments-hero p {
    color: var(--text-gray);
    font-size: 13px;
    line-height: 1.5;
    margin-top: 6px;
}

.friend-search-box input,
.chat-form input {
    width: 100%;
    background: var(--bg-dark);
    color: var(--text-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 13px 14px;
    outline: none;
}

.friend-search-box input:focus,
.chat-form input:focus {
    border-color: rgba(255,0,43,0.55);
}

.friend-search-results,
.friend-requests,
.friends-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.friends-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 11px;
    font-weight: 800;
}

.friends-section-title strong {
    color: var(--brand-red);
}

.friend-search-result,
.friend-request-card,
.friend-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 14px;
    padding: 10px;
}

.friend-row {
    border: 0;
    color: var(--text-white);
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease, transform 0.2s ease;
}

.friend-row:hover,
.friend-row.active {
    background: rgba(255,0,43,0.12);
    transform: translateX(3px);
}

.friend-search-result img,
.friend-request-card img,
.avatar-wrap img {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--bg-dark);
}

.friend-search-result div,
.friend-request-card div,
.friend-row-main {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.friend-search-result span,
.friend-request-card span,
.friend-row-main small {
    color: var(--text-gray);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-request-actions {
    flex: 0 !important;
    flex-direction: row !important;
}

.avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.status-dot {
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 13px;
    height: 13px;
    background: #333;
    border: 3px solid var(--bg-card);
    border-radius: 50%;
}

.status-dot.online {
    background: #00E676;
}

.chat-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(255,0,43,0.10), transparent);
}

.chat-header span,
.eyebrow {
    display: inline-block;
    color: var(--brand-red);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 800;
}

.chat-header h2 {
    margin-top: 5px;
}

.chat-messages {
    flex: 1;
    padding: 22px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    display: flex;
}

.chat-message.mine {
    justify-content: flex-end;
}

.chat-bubble {
    max-width: min(560px, 78%);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 12px 14px;
}

.chat-message.mine .chat-bubble {
    background: rgba(255,0,43,0.18);
    border-color: rgba(255,0,43,0.22);
}

.chat-bubble p {
    line-height: 1.45;
    font-size: 14px;
}

.chat-bubble span {
    display: block;
    color: var(--text-gray);
    font-size: 10px;
    margin-top: 7px;
}

.chat-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.hidden {
    display: none !important;
}

.empty-state {
    color: var(--text-gray);
    border: 1px dashed rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 18px;
    text-align: center;
    font-size: 13px;
}

.empty-state.small {
    padding: 12px;
    font-size: 12px;
}

.chat-empty {
    margin: 24px;
}

.compact {
    padding: 8px 10px !important;
    font-size: 11px !important;
    margin: 0 !important;
}

/* --- DASHBOARD TOURNAMENT ZONE --- */
.dashboard-tournament-zone {
    margin-top: 24px;
    background:
        radial-gradient(circle at top right, rgba(255,0,43,0.18), transparent 35%),
        var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 24px;
}

.zone-heading,
.tournaments-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.zone-heading h2,
.tournaments-hero h1 {
    margin: 8px 0 0 0;
    text-transform: uppercase;
}

.dashboard-tournaments-grid {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.dashboard-tournament-card {
    min-height: 210px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(8,8,8,0.72);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 18px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.dashboard-tournament-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255,0,43,0.4);
}

.tournament-card-accent {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    background: rgba(255,0,43,0.14);
    border-radius: 14px;
    margin-bottom: 20px;
}

.tournament-card-label {
    color: var(--brand-red);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 800;
}

.dashboard-tournament-card h3 {
    margin: 8px 0;
    font-size: 18px;
}

.dashboard-tournament-card p {
    color: var(--text-gray);
    font-size: 13px;
}

.tournament-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 12px;
    margin-top: 18px;
    color: var(--text-gray);
    font-size: 12px;
}

.tournament-card-footer strong {
    color: var(--text-white);
}

/* --- TOURNAMENTS LIST --- */
.tournaments-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tournaments-hero {
    background:
        linear-gradient(135deg, rgba(255,0,43,0.14), rgba(255,255,255,0.03)),
        var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 26px;
}

.tournaments-hero-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.tournaments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tournament-item {
    height: auto;
    min-height: 98px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 16px;
    padding: 16px;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.tournament-item:hover {
    transform: translateX(4px);
    border-color: rgba(255,0,43,0.35);
}

.tournament-item-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    background: rgba(255,0,43,0.12);
    border-radius: 16px;
    font-size: 24px;
}

.tournament-item-main h2 {
    margin: 6px 0;
    font-size: 18px;
}

.tournament-item-main p,
.tournament-item-meta span {
    color: var(--text-gray);
    font-size: 12px;
}

.tournament-item-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: right;
}

.tournament-item-meta strong {
    font-size: 13px;
    color: var(--text-white);
}

@media (max-width: 950px) {
    .friends-page {
        grid-template-columns: 1fr;
        height: auto;
    }

    .chat-card {
        min-height: 600px;
    }

    .zone-heading,
    .tournaments-hero,
    .tournament-item {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
        text-align: left;
    }

    .tournament-item-meta {
        text-align: left;
    }
}

.activity-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 14px 0 18px;
}

.activity-tab {
    position: relative;
    border: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.03);
    color: var(--text-gray);
    border-radius: 12px;
    padding: 11px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.activity-tab:hover,
.activity-tab.active {
    background: rgba(255,0,43,0.12);
    border-color: rgba(255,0,43,0.35);
    color: var(--text-white);
}

.activity-tab span {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 21px;
    height: 21px;
    display: grid;
    place-items: center;
    background: var(--brand-red);
    color: white;
    border-radius: 999px;
    border: 2px solid #0d0d0d;
    font-size: 10px;
    font-weight: 900;
}

/* --- MESSAGE THREADS IN DRAWER --- */
.message-thread-card {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
    color: var(--text-white);
    border-radius: 14px;
    padding: 12px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    cursor: pointer;
    text-align: left;
    margin-bottom: 10px;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.message-thread-card:hover {
    transform: translateX(4px);
    background: rgba(255,0,43,0.10);
    border-color: rgba(255,0,43,0.30);
}

.message-thread-avatar {
    position: relative;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}

.message-thread-avatar img {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    object-fit: cover;
    background: var(--bg-dark);
}

.message-thread-avatar span {
    position: absolute;
    right: -7px;
    top: -7px;
    min-width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    background: var(--brand-red);
    color: white;
    border-radius: 999px;
    border: 2px solid #0d0d0d;
    font-size: 10px;
    font-weight: 900;
}

.message-thread-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-thread-main strong {
    font-size: 14px;
}

.message-thread-main small {
    color: var(--text-gray);
    font-size: 12px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.message-thread-time {
    color: var(--text-gray);
    font-size: 10px;
    max-width: 82px;
    text-align: right;
}

/* --- TOURNAMENT DETAIL REGISTRATION --- */
.tournament-detail-page {
    animation: fadeIn 0.4s ease forwards;
}

.tournament-detail-hero {
    min-height: 220px;
    background:
        radial-gradient(circle at top right, rgba(255,0,43,0.22), transparent 36%),
        linear-gradient(45deg, var(--bg-dark), rgba(255, 0, 43, 0.10));
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 34px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    overflow: hidden;
}

.tournament-detail-hero h1 {
    margin: 8px 0 0;
    font-size: clamp(32px, 5vw, 54px);
    text-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.tournament-detail-hero p {
    color: var(--text-gray);
    margin-top: 8px;
}

.tournament-detail-hero p span {
    color: white;
    font-weight: 800;
}

.tournament-detail-status {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 230, 118, 0.1);
    color: #00E676;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1px;
}

.tournament-detail-status.closed {
    background: rgba(255, 193, 7, 0.12);
    color: #FFC107;
}

.tournament-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) 360px;
    gap: 20px;
    margin-top: 20px;
}

.tournament-detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
}

.tournament-detail-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tournament-section-heading h2 {
    margin-bottom: 6px;
}

.tournament-section-heading p,
.tournament-join-hint {
    color: var(--text-gray);
    font-size: 13px;
    line-height: 1.5;
}

.tournament-join-hint {
    margin: 12px 0 18px;
}

.tournament-info-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    font-size: 13px;
}

.tournament-info-list div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 8px;
}

.tournament-info-list span {
    color: var(--text-gray);
}

.tournament-join-code {
    display: block;
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--brand-red);
    font-weight: 900;
    letter-spacing: 1px;
    user-select: all;
}

.tournament-participants-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 18px;
}

.tournament-participant-card {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 14px;
}

.tournament-participant-card.status-pending {
    border-color: rgba(255, 193, 7, 0.28);
    background: rgba(255, 193, 7, 0.05);
}

.tournament-participant-card.status-rejected,
.tournament-participant-card.status-left {
    opacity: 0.65;
}

.tournament-participant-card img {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    object-fit: cover;
    background: var(--bg-dark);
}

.participant-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.participant-main strong {
    display: block;
}

.participant-main span,
.participant-main small,
.participant-main p {
    color: var(--text-gray);
    font-size: 12px;
}

.participant-main p {
    margin-top: 5px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(0,0,0,0.22);
}

.participant-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.participant-status {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: var(--text-white);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.participant-actions {
    display: flex;
    gap: 8px;
}

@media (max-width: 950px) {
    .tournament-detail-grid {
        grid-template-columns: 1fr;
    }

    .tournament-participant-card {
        grid-template-columns: 48px 1fr;
    }

    .participant-side {
        grid-column: 1 / -1;
        align-items: stretch;
    }

    .participant-actions {
        justify-content: stretch;
    }
}

/* --- TOURNAMENT ADMIN STATUS CONTROLS --- */
.tournament-admin-status {
    display: grid;
    gap: 10px;
    margin: 14px 0 18px;
}

.tournament-admin-status div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 11px 12px;
}

.tournament-admin-status span {
    color: var(--text-gray);
    font-size: 12px;
}

.tournament-admin-status strong {
    color: var(--text-white);
    font-size: 13px;
    text-align: right;
}

.tournament-admin-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tournament-admin-controls button {
    width: 100%;
    margin: 0;
}

.tournament-join-code-box {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.07);
}