:root {
    --accent: #00d2ff;
    --accent-secondary: #0066ff;
    --bg: #010b1a; /* Deep Ocean Night */
    --card-bg: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
    --text: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.7);
    --transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg);
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Ocean Wave Background (Pure CSS) */
.ocean {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background: linear-gradient(180deg, #010b1a 0%, #002d5a 100%);
    z-index: -2;
    overflow: hidden;
}

.wave {
    position: absolute;
    bottom: -150%;
    left: -50%;
    width: 200vw;
    height: 200vw;
    background: rgba(0, 210, 255, 0.05);
    border-radius: 43%;
    animation: drift 15s infinite linear;
    z-index: -1;
}

.wave:nth-child(2) {
    animation: drift 20s infinite linear;
    opacity: 0.1;
    background: #00d2ff;
    border-radius: 40%;
}

.wave:nth-child(3) {
    animation: drift 25s infinite linear;
    opacity: 0.05;
    background: #3a7bd5;
    border-radius: 45%;
}

@keyframes drift {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

/* Glass Navigation */
.glass-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2.5rem 0;
}

.logo {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-shadow: 0 0 20px rgba(0, 210, 255, 0.5);
}

.logo span { color: var(--accent); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: var(--transition);
    opacity: 0.8;
}

.nav-links a:hover { opacity: 1; color: var(--accent); }

.cta-btn {
    background: rgba(0, 210, 255, 0.1);
    padding: 0.9rem 2rem;
    border-radius: 50px;
    border: 1px solid rgba(0, 210, 255, 0.3);
    backdrop-filter: blur(15px);
}

.cta-btn:hover {
    background: var(--accent);
    color: var(--bg);
    box-shadow: 0 0 30px rgba(0, 210, 255, 0.4);
}

/* Hero Section */
.hero {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 4rem 0;
}

.reveal-text {
    font-size: clamp(3rem, 8vw, 5.5rem);
    line-height: 1.1;
    margin-bottom: 2rem;
    font-weight: 700;
    text-transform: uppercase;
}

.gradient-text {
    background: linear-gradient(90deg, #00d2ff, #3a7bd5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(0, 210, 255, 0.3));
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-dim);
    max-width: 650px;
    margin-bottom: 4rem;
}

.hero-actions {
    display: flex;
    gap: 2rem;
}

.btn-primary {
    background: var(--text);
    color: var(--bg);
    padding: 1.2rem 3rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn-primary:hover {
    transform: translateY(-5px);
    background: transparent;
    color: var(--text);
    border-color: var(--text);
}

.btn-secondary {
    color: var(--text);
    text-decoration: none;
    padding: 1.2rem 3rem;
    border: 1px solid var(--border);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Projects Section */
.projects { padding: 10rem 0; }

.section-title {
    font-size: 1rem;
    letter-spacing: 8px;
    color: var(--text-dim);
    margin-bottom: 5rem;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: -15px;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--accent);
}

.project-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.project-card {
    border-radius: 24px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    backdrop-filter: blur(25px);
    padding: 4rem;
    transition: var(--transition);
    position: relative;
}

.project-card:hover {
    transform: translateY(-15px) scale(1.02);
    border-color: rgba(0, 210, 255, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.card-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--accent);
    letter-spacing: 3px;
    margin-bottom: 1.5rem;
}

.project-card h3 {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.project-card p {
    color: var(--text-dim);
    margin-bottom: 4rem;
    font-size: 1.05rem;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    opacity: 0.6;
}

.arrow {
    font-size: 2rem;
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
}

.project-card:hover .arrow {
    transform: translateX(10px);
    color: var(--accent);
}

/* Footer */
.glass-footer {
    border-top: 1px solid var(--border);
    padding: 8rem 0 4rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6rem;
    align-items: flex-end;
}

.contact-info p {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.email-link {
    color: var(--text);
    font-size: 2.8rem;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
}

.email-link:hover { color: var(--accent); }

.social-links {
    display: flex;
    gap: 3rem;
}

.social-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 1.1rem;
    transition: var(--transition);
}

.social-links a:hover { color: var(--text); transform: translateY(-3px); }

.copyright {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    text-align: center;
    margin-top: 4rem;
    letter-spacing: 2px;
}

/* Табы и Виды */
.view { display: none; }
.view.active { display: block; }

.glass-card { 
    display: none; 
    background: var(--card-bg); 
    backdrop-filter: blur(20px); 
    border: 1px solid var(--border); 
    border-radius: 24px; 
    padding: 2rem;
    margin-bottom: 2rem;
    animation: slideUp 0.6s ease-out;
}
.glass-card.active { display: block; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Нижняя навигация */
.bottom-nav {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: 500px;
    background: rgba(1, 11, 26, 0.85);
    backdrop-filter: blur(25px);
    border: 1px solid var(--border);
    border-radius: 30px;
    display: flex;
    justify-content: space-around;
    padding: 0.8rem;
    z-index: 100;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: 0.3s;
    opacity: 0.6;
}

.nav-item.active {
    opacity: 1;
    color: var(--accent);
}

.nav-icon { font-size: 1.4rem; margin-bottom: 4px; }
.nav-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px; }

/* Регистрация: дополнения */
.password-warning {
    color: #ffcc00;
    font-size: 0.75rem;
    margin-bottom: 0.8rem;
    font-weight: 700;
    text-align: left;
}
.agreement-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 1.5rem;
    text-align: left;
}
.agreement-check input {
    width: auto !important;
    margin-top: 4px !important;
    cursor: pointer;
}
.agreement-check label {
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.3;
}
.agreement-check a {
    color: var(--accent);
    text-decoration: underline;
}

/* Форма авторизации */
#view-registration { position: relative; z-index: 5000; }
.form-container { max-width: 400px; margin: 80px auto; padding: 2.5rem; background: rgba(1, 11, 26, 0.95); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: 24px; text-align: center; position: relative; z-index: 5100; }

/* Модальные окна */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.modal-content {
    width: 90%;
    max-width: 450px;
    padding: 2rem;
    text-align: center;
}

/* Zvezdun Game */
.zvezdun-game-area {
    margin: 20px 0;
    position: relative;
}

#zvezdun-img {
    width: 150px;
    height: 150px;
    cursor: pointer;
    transition: 0.1s;
    user-select: none;
}

#z-progress-bg {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    margin-bottom: 20px;
    overflow: hidden;
}

#z-progress-fill {
    width: 0%;
    height: 100%;
    background: var(--accent);
    box-shadow: 0 0 15px var(--accent);
    transition: 0.2s;
}

/* Скрываем для ПК элементы навигации если нужно */
@media (min-width: 768px) {
    .content-area { padding-bottom: 100px; }
}

/* Профиль и Статистика (из 03-profile.js) */
.profile-header { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 2rem; text-align: left; }
.profile-avatar { width: 70px; height: 70px; border-radius: 18px; object-fit: cover; border: 2px solid var(--accent); }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-item { background: rgba(255,255,255,0.03); padding: 1rem; border-radius: 16px; border: 1px solid var(--border); }
.stat-item .val { display: block; font-size: 1.2rem; font-weight: 700; color: var(--accent); }
.stat-item .lbl { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; }

/* Рейтинг */
.rating-row { 
    display: flex; 
    align-items: center; 
    padding: 1rem; 
    background: rgba(255,255,255,0.03); 
    border-radius: 14px; 
    margin-bottom: 0.8rem; 
    border: 1px solid var(--border);
}
.r-place { width: 30px; font-weight: 700; color: var(--accent); }
.r-name { flex: 1; text-align: left; padding-left: 10px; }
.r-score { font-weight: 700; }

/* Топ участников */
.top-users-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.top-user-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    transform: translateX(5px);
}

.top-user-item.me {
    background: rgba(0, 210, 255, 0.08);
    border-color: var(--accent);
}

.top-user-name {
    font-weight: 400;
}

.top-user-rank {
    opacity: 0.5;
    font-size: 0.9rem;
    margin-right: 4px;
}

.top-user-score {
    color: var(--accent);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 992px) {
    .project-grid { grid-template-columns: 1fr; gap: 4rem; }
    .hero { min-height: auto; padding: 8rem 0; }
    .footer-content { flex-direction: column; gap: 4rem; align-items: flex-start; }
    .email-link { font-size: 2rem; }
}

/* ==========================================
   AVATAR UPLOAD UI
   ========================================== */
.avatar-upload-area {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    cursor: pointer;
}

.avatar-upload-area img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    transition: 0.3s;
}

.avatar-upload-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.3s;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 1px;
    text-transform: uppercase;
    pointer-events: none;
}

.avatar-upload-area:hover .avatar-upload-overlay {
    opacity: 1;
}

.avatar-upload-area:hover img {
    filter: brightness(0.7);
    transform: scale(1.1);
}

/* ==========================================
   ROLE 2 (Blank Page with Registration)
   ========================================== */
/* ==========================================
   ROLE 2 (Blank Page with Registration)
   ========================================== */
body.role-2 {
    background: #000 !important;
}

#live-stream-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    background: #000;
}

#live-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.role-2 #live-stream-container {
    display: block !important;
}

body.role-2 .ocean,
body.role-2 .glass-nav,
body.role-2 .bottom-nav,
body.role-2 #view-main,
body.role-2 .glass-card:not(#view-registration .glass-card):not(#view-broadcast .glass-card) {
    display: none !important;
}

body.role-2 #view-registration {
    background: transparent !important;
    z-index: 10;
}

body.role-2 #view-registration .glass-card {
    background: rgba(20, 20, 20, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* ==========================================
   AVATAR LIGHTBOX (fullscreen preview)
   ========================================== */
#avatar-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(20px);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

#avatar-lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 16px;
    box-shadow: 0 0 60px rgba(0, 210, 255, 0.15);
    object-fit: contain;
}

/* ==========================================
   PROFILE TIER GRADIENTS (уровни 1-7)
   ========================================== */
.profile-tier-1 { border-image: linear-gradient(135deg, #334155, #475569) 1; }
.profile-tier-2 { border-image: linear-gradient(135deg, #065f46, #10b981) 1; }
.profile-tier-3 { border-image: linear-gradient(135deg, #1e40af, #3b82f6) 1; }
.profile-tier-4 { border-image: linear-gradient(135deg, #7c3aed, #a78bfa) 1; }
.profile-tier-5 { border-image: linear-gradient(135deg, #b45309, #f59e0b) 1; }
.profile-tier-6 { border-image: linear-gradient(135deg, #dc2626, #f87171) 1; }
.profile-tier-7 {
    border-image: linear-gradient(135deg, #f59e0b, #ec4899, #8b5cf6, #06b6d4) 1;
    box-shadow: 0 0 30px rgba(236, 72, 153, 0.15);
}

/* ==========================================
   ACHIEVEMENT CARDS
   ========================================== */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.achievement-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px 8px;
    text-align: center;
    transition: 0.3s;
    cursor: pointer;
}

.achievement-card.unlocked {
    border-color: rgba(0, 210, 255, 0.3);
}

.achievement-card.unlocked:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 210, 255, 0.15);
    border-color: var(--accent);
}

.achievement-card.animating {
    animation: achBounce 0.6s ease;
}

@keyframes achBounce {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.15) rotate(-3deg); }
    60% { transform: scale(0.95) rotate(2deg); }
}

.achievement-icon { font-size: 2rem; margin-bottom: 6px; }
.achievement-name { font-size: 0.7rem; font-weight: 700; color: white; margin-bottom: 4px; }
.achievement-desc { font-size: 0.6rem; color: var(--text-dim); line-height: 1.3; }

.category-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 8px;
    margin-top: 20px;
}

/* ==========================================
   RATING SECTION TITLES
   ========================================== */
.rating-section-title {
    font-size: 0.9rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 2rem 0 1rem;
}

.rating-row.highlight {
    background: rgba(0, 210, 255, 0.08);
    border-color: var(--accent);
}

.rating-row:hover {
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

/* Squad Members */
.squad-members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.squad-member-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: 0.3s;
    width: 100%;
    text-align: left;
    color: white;
    font-family: 'Outfit', sans-serif;
}

.squad-member-row:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
}

.squad-member-row.me {
    background: rgba(0, 210, 255, 0.06);
    border-color: rgba(0, 210, 255, 0.3);
}

.squad-member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.squad-member-meta { flex: 1; }
.squad-member-name { font-weight: 700; font-size: 0.9rem; }
.squad-member-sub { font-size: 0.75rem; color: var(--text-dim); }
.squad-member-score { font-weight: 700; color: var(--accent); font-size: 0.85rem; white-space: nowrap; }
