/* style.css - Part Universe Game */

/* ===== ОСНОВНЫЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Avenir', system-ui, sans-serif;
}

body {
    min-height: 100vh;
    background: radial-gradient(ellipse at 30% 40%, #0b0d2e, #030514);
    color: #eef5ff;
    position: relative;
    overflow-x: hidden;
}

/* ===== ЗВЕЗДНЫЙ ФОН ===== */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000 repeating-radial-gradient(circle at 20% 30%, #fff 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

/* ===== КОНТЕЙНЕР ===== */
.container {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== ШАПКА ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(90, 150, 255, 0.3);
    margin-bottom: 30px;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #b0e0ff, #3f9eff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 20px #3f9eff;
    letter-spacing: 2px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.friends-count {
    background: rgba(74, 165, 255, 0.2);
    border: 1px solid #4aa5ff;
    padding: 5px 15px;
    border-radius: 30px;
    font-size: 0.9rem;
    color: #7eb9ff;
}

.logout-btn {
    background: rgba(255, 70, 70, 0.2);
    border: 1px solid #ff4d4d;
    color: #ff9f9f;
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.95rem;
}

.logout-btn:hover {
    background: rgba(255, 70, 70, 0.4);
    color: white;
    box-shadow: 0 0 15px #ff4d4d;
}

/* ===== ВКЛАДКИ ===== */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab {
    background: rgba(20, 30, 50, 0.6);
    border: 1px solid #2b4f7c;
    padding: 15px 30px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: 0.3s;
    color: #adccff;
    backdrop-filter: blur(5px);
}

.tab:hover {
    background: #1e3a5f;
    color: white;
    border-color: #4aa5ff;
    transform: translateY(-2px);
}

.tab.active {
    background: #236ab9;
    color: white;
    border-color: #4aa5ff;
    box-shadow: 0 0 20px #3f9eff;
}

/* ===== КОНТЕНТ ВКЛАДОК ===== */
.tab-content {
    background: rgba(10, 15, 30, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(90, 150, 255, 0.2);
    border-radius: 30px;
    padding: 30px;
    min-height: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.content-pane {
    display: none;
}

.content-pane.active {
    display: block;
}

/* ===== ЗАГОЛОВКИ ===== */
h2 {
    color: #7eb9ff;
    margin-bottom: 25px;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    border-bottom: 1px solid #3a5f8a;
    padding-bottom: 10px;
}

/* ===== ИГРЫ ===== */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.game-card {
    background: rgba(30, 40, 70, 0.6);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    border: 1px solid #3a5f8a;
    transition: 0.3s;
    backdrop-filter: blur(5px);
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 100, 255, 0.3);
    border-color: #4aa5ff;
}

.game-card h3 {
    color: #7eb9ff;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.game-card p {
    color: #adccff;
    margin-bottom: 25px;
    line-height: 1.5;
}

.play-btn {
    background: #236ab9;
    border: none;
    padding: 12px 35px;
    border-radius: 30px;
    color: white;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: 0.3s;
    border: 1px solid #4aa5ff;
}

.play-btn:hover {
    background: #2e7bd6;
    box-shadow: 0 0 25px #3f9eff;
    transform: scale(1.05);
}

/* ===== ЧАТ ===== */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 500px;
}

.chat-messages {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 20px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid #2b4f7c;
}

.message {
    margin-bottom: 15px;
    padding: 12px 18px;
    background: rgba(63, 158, 255, 0.1);
    border-radius: 15px;
    border-left: 4px solid #4aa5ff;
    animation: fadeIn 0.3s;
}

.message strong {
    color: #7eb9ff;
    font-size: 1rem;
}

.chat-input {
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex-grow: 1;
    background: rgba(5, 15, 30, 0.7);
    border: 1px solid #2b4f7c;
    border-radius: 30px;
    padding: 15px 25px;
    color: white;
    font-size: 1rem;
    transition: 0.3s;
}

.chat-input input:focus {
    outline: none;
    border-color: #4aa5ff;
    box-shadow: 0 0 20px #2a6ec7;
}

.chat-input button {
    background: #236ab9;
    border: none;
    border-radius: 30px;
    padding: 0 35px;
    color: white;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: 0.3s;
    border: 1px solid #4aa5ff;
}

.chat-input button:hover {
    background: #2e7bd6;
    box-shadow: 0 0 20px #3f9eff;
}

/* ===== ПОЛЬЗОВАТЕЛИ И ДРУЗЬЯ ===== */
.users-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.users-section, .friends-section {
    background: rgba(20, 30, 50, 0.6);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid #3a5f8a;
}

.section-title {
    color: #7eb9ff;
    font-size: 1.4rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #3a5f8a;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.search-box input {
    flex: 1;
    background: rgba(5, 15, 30, 0.7);
    border: 1px solid #2b4f7c;
    border-radius: 30px;
    padding: 12px 20px;
    color: white;
    font-size: 1rem;
}

.search-box input:focus {
    outline: none;
    border-color: #4aa5ff;
    box-shadow: 0 0 15px #2a6ec7;
}

.search-btn {
    background: #236ab9;
    border: none;
    border-radius: 30px;
    padding: 0 25px;
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
    border: 1px solid #4aa5ff;
}

.search-btn:hover {
    background: #2e7bd6;
    box-shadow: 0 0 15px #4aa5ff;
}

.users-list, .friends-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.user-item, .friend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: rgba(30, 40, 70, 0.4);
    border-radius: 15px;
    margin-bottom: 10px;
    transition: 0.3s;
}

.user-item:hover {
    background: rgba(40, 60, 100, 0.6);
    transform: translateX(5px);
}

.friend-item {
    background: rgba(74, 165, 255, 0.1);
    border: 1px solid #4aa5ff;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    background: linear-gradient(145deg, #236ab9, #12438c);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    border: 2px solid #4aa5ff;
    box-shadow: 0 0 15px #3f9eff;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: bold;
    color: white;
    font-size: 1.1rem;
}

.user-status {
    font-size: 0.8rem;
    color: #8aa3cc;
}

.user-status.online {
    color: #4aff8f;
}

.add-friend-btn, .remove-friend-btn {
    background: transparent;
    border: 1px solid #4aa5ff;
    color: #7eb9ff;
    padding: 6px 18px;
    border-radius: 20px;
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.9rem;
    font-weight: 600;
}

.add-friend-btn:hover {
    background: #4aa5ff;
    color: white;
    box-shadow: 0 0 15px #4aa5ff;
}

.remove-friend-btn {
    border-color: #ff6b6b;
    color: #ff9f9f;
}

.remove-friend-btn:hover {
    background: #ff6b6b;
    color: white;
    box-shadow: 0 0 15px #ff6b6b;
}

.no-results {
    text-align: center;
    color: #8aa3cc;
    padding: 40px 20px;
    font-style: italic;
    font-size: 1.1rem;
}

/* ===== 3D АВАТАР ===== */
.avatar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.cube-container {
    width: 300px;
    height: 300px;
    perspective: 1000px;
    margin: 20px auto;
    cursor: grab;
}

.cube-container:active {
    cursor: grabbing;
}

.cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(-20deg) rotateY(-30deg);
    transition: transform 0.1s;
}

.cube-face {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(30, 40, 70, 0.9);
    border: 2px solid #4aa5ff;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: visible;
    box-shadow: 0 0 30px rgba(74, 165, 255, 0.3);
    transition: background-color 0.3s;
}

.front  { transform: translateZ(150px); }
.back   { transform: rotateY(180deg) translateZ(150px); }
.right  { transform: rotateY(90deg) translateZ(150px); }
.left   { transform: rotateY(-90deg) translateZ(150px); }
.top    { transform: rotateX(90deg) translateZ(150px); }
.bottom { transform: rotateX(-90deg) translateZ(150px); }

.face-content {
    text-align: center;
    line-height: 1;
    text-shadow: 0 0 15px currentColor;
    transition: font-size 0.3s;
    font-size: 3rem;
}

.avatar-controls {
    background: rgba(20, 30, 50, 0.8);
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    border: 1px solid #3a5f8a;
}

.control-group {
    margin-bottom: 25px;
}

.control-group label {
    display: block;
    color: #7eb9ff;
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.control-group input[type="text"],
.control-group input[type="range"] {
    width: 100%;
    padding: 12px 20px;
    background: rgba(5, 15, 30, 0.7);
    border: 1px solid #2b4f7c;
    border-radius: 30px;
    color: white;
    font-size: 1rem;
}

.control-group input[type="range"] {
    padding: 0;
    height: 8px;
    background: linear-gradient(90deg, #236ab9, #4aa5ff);
    border: none;
    -webkit-appearance: none;
    appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #4aa5ff;
    box-shadow: 0 0 10px #4aa5ff;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #4aa5ff;
}

.control-group input[type="text"]:focus {
    outline: none;
    border-color: #4aa5ff;
    box-shadow: 0 0 15px #2a6ec7;
}

.size-value {
    display: inline-block;
    margin-left: 12px;
    color: #4aa5ff;
    font-weight: bold;
    font-size: 1.1rem;
}

.color-input {
    display: flex;
    gap: 12px;
    align-items: center;
}

.color-input input[type="color"] {
    width: 60px;
    height: 60px;
    padding: 5px;
    background: transparent;
    border: 2px solid #4aa5ff;
    border-radius: 12px;
    cursor: pointer;
}

.color-input input[type="text"] {
    flex: 1;
}

.apply-btn {
    background: #236ab9;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    border: 1px solid #4aa5ff;
    transition: 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.apply-btn:hover {
    background: #2e7bd6;
    box-shadow: 0 0 25px #3f9eff;
    transform: scale(1.02);
}

/* ===== ПРОФИЛЬ ===== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
    padding: 25px;
    background: rgba(30, 40, 70, 0.4);
    border-radius: 25px;
    border: 1px solid #3a5f8a;
    backdrop-filter: blur(5px);
}

.profile-avatar {
    width: 120px;
    height: 120px;
    background: linear-gradient(145deg, #236ab9, #12438c);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    border: 4px solid #7eb9ff;
    box-shadow: 0 0 35px #3f9eff;
}

.profile-nickname {
    font-size: 2.2rem;
    color: white;
    margin-bottom: 8px;
    font-weight: 700;
    text-shadow: 0 0 15px #3f9eff;
}

#profileEmail {
    color: #8aa3cc;
    font-size: 1.2rem;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.stat-card {
    background: rgba(30, 40, 70, 0.6);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    border: 1px solid #3a5f8a;
    transition: 0.3s;
    backdrop-filter: blur(5px);
}

.stat-card:hover {
    transform: scale(1.03);
    border-color: #4aa5ff;
    box-shadow: 0 0 25px rgba(74, 165, 255, 0.3);
}

.stat-card h3 {
    color: #7eb9ff;
    margin-bottom: 12px;
    font-size: 1.2rem;
    font-weight: 600;
}

.stat-value {
    font-size: 2.8rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 15px #3f9eff;
    line-height: 1.2;
}

.stat-label {
    color: #8aa3cc;
    margin-top: 8px;
    font-size: 0.95rem;
}

/* ===== УВЕДОМЛЕНИЯ ===== */
.message-banner {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #236ab9;
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    z-index: 1000;
    animation: slideIn 0.3s;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);
    font-weight: 600;
    border: 1px solid #4aa5ff;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 992px) {
    .container {
        padding: 15px;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .users-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .tabs {
        justify-content: center;
    }
    
    .tab {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .cube-container {
        width: 250px;
        height: 250px;
    }
    
    .front  { transform: translateZ(125px); }
    .back   { transform: rotateY(180deg) translateZ(125px); }
    .right  { transform: rotateY(90deg) translateZ(125px); }
    .left   { transform: rotateY(-90deg) translateZ(125px); }
    .top    { transform: rotateX(90deg) translateZ(125px); }
    .bottom { transform: rotateX(-90deg) translateZ(125px); }
    
    .profile-stats {
        grid-template-columns: 1fr;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .tab-content {
        padding: 20px;
    }
    
    .user-info {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .avatar-controls {
        padding: 20px;
    }
    
    .profile-avatar {
        width: 100px;
        height: 100px;
        font-size: 3rem;
    }
    
    .profile-nickname {
        font-size: 1.8rem;
    }
}

/* ===== ПОЛОСА ПРОКРУТКИ ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(20, 30, 50, 0.6);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #236ab9;
    border-radius: 10px;
    border: 2px solid #4aa5ff;
}

::-webkit-scrollbar-thumb:hover {
    background: #2e7bd6;
}

/* ===== ДЕКОРАТИВНЫЕ ЭЛЕМЕНТЫ ===== */
hr {
    border: 0.5px solid #2d4f79;
    margin: 20px 0;
}

.particle-decor {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0 10px;
    font-size: 1.3rem;
    color: #5d8fd6;
}