:root {
    --bg-primary: #0f0c29;
    --bg-secondary: rgba(26, 22, 64, 0.72);
    --bg-card: rgba(30, 26, 74, 0.65);
    --bg-card-hover: rgba(40, 34, 90, 0.8);
    --text-primary: #ffffff;
    --text-secondary: #a78bfa;
    --accent-primary: #6c5ce7;
    --accent-secondary: #a78bfa;
    --accent-glow: rgba(108, 92, 231, 0.35);
    --neural-line: rgba(140, 130, 255, 0.25);
    --neural-node: rgba(180, 170, 255, 0.8);
    --glass-border: rgba(167, 139, 250, 0.15);
    --glass-blur: blur(16px);
    --nav-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 20px;
    --transition: all 0.2s ease;
}

/* ===== СБРОС ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== ФОН С НЕЙРОСЕТЬЮ ===== */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
}

body {
    background: #0f0c29 !important;
}

.app-container {
    position: relative;
    z-index: 1;
}

/* ===== ЛОАДЕР ===== */
.loader-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    overflow: hidden;
    transition: opacity 0.5s ease;
}

.loader-overlay.fade-out {
    opacity: 0;
}

.loader-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.45;
    pointer-events: none;
}

.loader-scrim {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 42%, rgba(15, 12, 41, 0.15) 0%, rgba(15, 12, 41, 0.72) 62%, rgba(15, 12, 41, 0.92) 100%),
        linear-gradient(180deg, rgba(15, 12, 41, 0.35) 0%, rgba(15, 12, 41, 0.8) 100%);
    pointer-events: none;
}

.loader-content {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    padding-top: max(24px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.loader-panel {
    width: min(320px, 88vw);
    padding: 28px 24px 22px;
    text-align: center;
    border-radius: 24px;
    background: linear-gradient(165deg, rgba(38, 32, 88, 0.94) 0%, rgba(22, 18, 52, 0.96) 100%);
    border: 1px solid rgba(167, 139, 250, 0.24);
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.42),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    animation: loaderPanelIn 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.loader-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    margin: 0 auto 14px;
    border-radius: 24px;
    background: radial-gradient(circle at 30% 20%, rgba(167, 139, 250, 0.18), rgba(108, 92, 231, 0.06) 70%);
    border: 1px solid rgba(167, 139, 250, 0.18);
    box-shadow: 0 8px 28px rgba(108, 92, 231, 0.18);
}

.loader-brand {
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 0.34em;
    color: #fff;
    margin-bottom: 8px;
}

.loader-subtitle {
    font-size: 13px;
    line-height: 1.45;
    color: rgba(226, 232, 240, 0.78);
    font-weight: 500;
    letter-spacing: 0.02em;
    margin-bottom: 18px;
}

.loader-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.loader-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    box-shadow: 0 0 10px rgba(167, 139, 250, 0.45);
    animation: loaderDotPulse 1.2s ease-in-out infinite;
}

.loader-dot:nth-child(2) { animation-delay: 0.15s; }
.loader-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes loaderPanelIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes loaderDotPulse {
    0%, 80%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.45;
    }
    40% {
        transform: translateY(-5px) scale(1.08);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-12px); }
}

/* ===== СКРЫТИЕ ===== */
.hidden {
    display: none !important;
}

/* ===== КОНТЕЙНЕР ПРИЛОЖЕНИЯ ===== */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-secondary);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    position: relative;
    border-left: 1px solid var(--glass-border);
    border-right: 1px solid var(--glass-border);
    box-shadow:
        0 0 60px rgba(108, 92, 231, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: appFadeIn 0.6s ease;
}

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

.content-reveal {
    opacity: 0;
    transform: translateY(12px);
    animation: contentReveal 0.48s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}

@keyframes contentReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .content-reveal {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* ===== ХЕДЕР ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    padding: 0;
    padding-top: env(safe-area-inset-top, 0px);
    background: transparent;
    border-bottom: none;
    box-shadow: none;
}

.header-center {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px 16px 18px;
    border-radius: 0 0 28px 28px;
    background: linear-gradient(180deg, rgba(28, 24, 68, 0.88) 0%, rgba(22, 18, 52, 0.72) 100%);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-top: none;
    box-shadow:
        0 12px 40px rgba(108, 92, 231, 0.18),
        0 4px 0 rgba(108, 92, 231, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.header-center::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), var(--accent-secondary), transparent);
    opacity: 0.75;
    pointer-events: none;
}

.header-emblem {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-orbit {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(167, 139, 250, 0.28);
    pointer-events: none;
}

.header-orbit-1 {
    inset: 0;
    border-style: dashed;
    animation: authRingSpin 14s linear infinite;
}

.header-orbit-2 {
    inset: 6px;
    border-color: rgba(108, 92, 231, 0.22);
    animation: authRingSpin 20s linear infinite reverse;
}

.header-title {
    font-size: 18px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    line-height: 1;
    margin: 0;
    text-align: center;
    background: linear-gradient(135deg, #fff 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-logo {
    font-size: 22px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

/* ===== НАВИГАЦИЯ ===== */
#bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 480px;
    display: flex;
    justify-content: space-around;
    background: rgba(15, 12, 41, 0.92);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--glass-border);
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    z-index: 200;
    box-shadow: 0 -4px 24px rgba(108, 92, 231, 0.15);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: rgba(167, 139, 250, 0.6);
    font-size: 11px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-item.active {
    color: var(--accent-secondary);
    background: rgba(108, 92, 231, 0.15);
    box-shadow: 0 0 12px var(--accent-glow);
}

.nav-icon {
    width: 22px;
    height: 22px;
}

.nav-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
}

/* ===== ОСНОВНОЙ КОНТЕНТ ===== */
#page-content {
    padding: 16px;
    padding-bottom: calc(var(--nav-height) + 24px + env(safe-area-inset-bottom));
}

/* ===== ЗАГОЛОВКИ СЕКЦИЙ ===== */
.section-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--accent-primary), transparent);
    margin-left: 4px;
    opacity: 0.4;
}

.section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--accent-secondary);
    flex-shrink: 0;
}

.section-icon svg {
    width: 100%;
    height: 100%;
}

.icon-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    color: var(--accent-secondary);
    flex-shrink: 0;
    vertical-align: middle;
}

.icon-inline svg {
    width: 100%;
    height: 100%;
}

.meta-icon {
    display: inline-flex;
    align-items: center;
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.meta-icon svg {
    width: 100%;
    height: 100%;
}

.quick-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--accent-secondary);
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.22), rgba(167, 139, 250, 0.1));
    border: 1px solid rgba(167, 139, 250, 0.22);
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(108, 92, 231, 0.15);
}

.quick-icon svg {
    width: 20px;
    height: 20px;
    display: block;
    flex-shrink: 0;
    overflow: visible;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.podium-rank {
    font-size: 14px;
    font-weight: 900;
    color: var(--accent-secondary);
    margin-bottom: 4px;
}

.podium-crown {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    color: #ffd700;
    z-index: 20;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
    animation: crownFloat 2s ease-in-out infinite;
}

.podium-crown svg {
    width: 100%;
    height: 100%;
}

.profile-avatar-wrap {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.avatar-edit-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
    color: #fff;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.avatar-edit-badge svg {
    width: 14px;
    height: 14px;
}

.profile-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-action-btn .icon-inline {
    width: 18px;
    height: 18px;
}

/* ===== CROP MODAL ===== */
.crop-modal {
    max-width: 360px;
}

.crop-body {
    padding: 16px;
}

.crop-container {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 50%;
    background: #0a0820;
    border: 2px solid var(--glass-border);
    touch-action: none;
    cursor: grab;
}

.crop-container:active {
    cursor: grabbing;
}

.crop-container img {
    position: absolute;
    user-select: none;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.crop-container img.loaded {
    opacity: 1;
}

.crop-grid-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
    background:
        linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 33.33% 33.33%;
}

.crop-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 0 4px;
}

.crop-zoom-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.crop-zoom-icon svg {
    width: 100%;
    height: 100%;
}

.crop-controls input[type="range"] {
    flex: 1;
    accent-color: var(--accent-primary);
}

.crop-footer {
    display: flex;
    gap: 10px;
    padding: 12px 16px 16px;
    border-top: 1px solid var(--glass-border);
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-secondary {
    background: rgba(108, 92, 231, 0.15);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.modal-overlay.active {
    animation: appFadeIn 0.2s ease;
}

.modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

.about-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.about-feature .icon-inline {
    width: 16px;
    height: 16px;
}

.view-all-link {
    font-size: 12px;
    color: var(--accent-secondary);
    text-decoration: none;
    font-weight: 600;
}

/* ===== КАРТОЧКИ ТУРНИРОВ ===== */
.tournaments-list-home {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tournament-card {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    padding: 14px;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.tournament-card:hover {
    border-color: rgba(167, 139, 250, 0.3);
    box-shadow: 0 4px 24px var(--accent-glow);
}

.tournament-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.title-status-group {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.tournament-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0;
    line-height: 1.3;
    min-width: 0;
}

.tournament-date-badge {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 10px var(--accent-glow);
}

/* ===== СТАТУС-ТОЧКА ===== */
.status-dot {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    /* визуально по центру первой строки названия (15px * 1.3) */
    margin-top: 4.5px;
}
.status-dot.active {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    animation: dotPulse 1.5s ease-in-out infinite;
}

.status-dot.finished {
    background: #9ca3af;
    box-shadow: none;
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

/* ===== МЕТА ДАННЫЕ ===== */
.tournament-meta {
    margin-bottom: 12px;
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.meta-icon {
    font-size: 14px;
}

.meta-text {
    color: var(--text-secondary);
}

/* ===== ПРОГРЕСС МЕСТ ===== */
.spots-progress {
    margin-bottom: 12px;
}

.spots-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.spots-label strong {
    color: var(--accent-secondary);
}

.progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ===== КНОПКИ ДЕЙСТВИЙ ===== */
.tournament-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.action-btn.secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255,255,255,0.15);
}

.action-btn.results,
.action-btn.registered {
    background: rgba(148, 163, 184, 0.18);
    color: rgba(226, 232, 240, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: none;
}

.action-btn.results:active {
    background: rgba(148, 163, 184, 0.28);
}

.action-btn.registered,
.action-btn.registered:disabled {
    cursor: default;
    opacity: 1;
    pointer-events: none;
}

.action-btn:active {
    transform: scale(0.97);
    opacity: 0.9;
}

/* ===== КАЛЕНДАРЬ ===== */
.calendar-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    overflow-x: auto;
}

.calendar-filters-stretch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
}

.filter-btn {
    padding: 10px 8px;
    background: rgba(108, 92, 231, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    text-align: center;
}

.calendar-filters-stretch .filter-btn {
    width: 100%;
    min-width: 0;
    padding: 12px 8px;
    font-size: 13px;
    letter-spacing: 0.01em;
}

.filter-btn:hover {
    border-color: rgba(167, 139, 250, 0.3);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* ===== РЕЙТИНГ: ПЕРИОДЫ ===== */
.rating-period-picker {
    margin-bottom: 14px;
}

.rating-period-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(30, 26, 74, 0.82);
    border: 1px solid rgba(167, 139, 250, 0.22);
    border-radius: 16px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.rating-period-trigger:active {
    transform: scale(0.99);
    border-color: rgba(167, 139, 250, 0.35);
}

.rating-period-trigger-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    text-align: left;
}

.rating-period-trigger-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(167, 139, 250, 0.72);
}

.rating-period-trigger-value {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.rating-period-trigger-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(108, 92, 231, 0.18);
    color: var(--accent-secondary);
}

.rating-period-trigger-icon svg {
    width: 16px;
    height: 16px;
}

.rating-period-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(52vh, 420px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 2px;
}

.rating-period-option {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(167, 139, 250, 0.14);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.rating-period-option:active {
    transform: scale(0.99);
}

.rating-period-option.active {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.28), rgba(167, 139, 250, 0.14));
    border-color: rgba(167, 139, 250, 0.35);
    box-shadow: 0 4px 16px rgba(108, 92, 231, 0.18);
}

.rating-period-option-label {
    flex: 1;
    min-width: 0;
}

.rating-period-option-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-secondary);
}

.rating-period-option-check svg {
    width: 18px;
    height: 18px;
}

.calendar-card {
    padding: 12px;
}

.calendar-card-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.calendar-date-box {
    background: var(--accent-primary);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    text-align: center;
    min-width: 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.calendar-day {
    font-size: 20px;
    font-weight: 900;
    color: #fff;
    line-height: 1;
}

.calendar-month {
    font-size: 9px;
    font-weight: 700;
    color: rgba(255,255,255,0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.calendar-card-info {
    flex: 1;
}

.calendar-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.calendar-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== РЕЙТИНГ ===== */
.rating-list-home {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rating-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius-md);
    padding: 12px 12px;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.rating-item:hover {
    border-color: rgba(167, 139, 250, 0.25);
    box-shadow: 0 2px 16px var(--accent-glow);
}

.rating-item:active {
    transform: scale(0.98);
}

.rating-rank-wrapper {
    min-width: 32px;
}

.rating-rank {
    font-size: 14px;
    font-weight: 900;
    color: var(--text-secondary);
    text-align: center;
}

.rating-rank.top-1 { color: #ffd700; }
.rating-rank.top-2 { color: #c0c0c0; }
.rating-rank.top-3 { color: #cd7f32; }

.rating-player {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.player-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-primary);
    flex-shrink: 0;
    border: 2px solid rgba(167, 139, 250, 0.3);
    box-shadow: 0 0 8px var(--accent-glow);
}

.player-info {
    flex: 1;
}

.player-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.player-stats {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.rating-points-wrapper {
    min-width: 60px;
    text-align: right;
}

.rating-points {
    font-size: 14px;
    font-weight: 800;
    color: var(--accent-secondary);
}

.rating-points.top-1 { color: #ffd700; }
.rating-points.top-2 { color: #c0c0c0; }
.rating-points.top-3 { color: #cd7f32; }

.points-value {
    font-size: 14px;
}

/* ===== БЫСТРЫЕ ДЕЙСТВИЯ ===== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.quick-btn {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 14px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
}

.quick-btn:hover {
    border-color: rgba(167, 139, 250, 0.3);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.quick-btn:active {
    transform: scale(0.97);
    background: rgba(108, 92, 231, 0.3);
}

.quick-btn span:last-child {
    font-size: 13px;
    font-weight: 600;
}

/* ===== ПРОФИЛЬ ===== */
.profile-page {
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
}

.profile-header {
    text-align: center;
    padding: 20px 0 16px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent-primary);
    margin: 0 auto 12px;
    border: 3px solid var(--accent-secondary);
    background-size: cover;
    background-position: center;
}

.profile-name {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.profile-nickname {
    font-size: 13px;
    color: var(--text-secondary);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius-md);
    padding: 12px 8px;
    text-align: center;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.stat-card:hover {
    border-color: rgba(167, 139, 250, 0.25);
}

.stat-value {
    font-size: 20px;
    font-weight: 900;
    color: var(--accent-secondary);
    margin-bottom: 2px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.profile-info {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid var(--glass-border);
}

.profile-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.profile-info-row:last-child {
    border-bottom: none;
}

.profile-info-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.profile-info-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-action-btn {
    width: 100%;
    padding: 12px;
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.profile-action-btn:hover {
    border-color: rgba(167, 139, 250, 0.3);
    box-shadow: 0 2px 12px var(--accent-glow);
}

.profile-action-btn:active {
    background: rgba(108, 92, 231, 0.3);
    transform: scale(0.98);
}

.profile-action-btn.is-disabled,
.profile-action-btn:disabled {
    opacity: 0.55;
    cursor: default;
    pointer-events: none;
}

/* ===== ИСТОРИЯ ===== */
.history-item {
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius-sm);
    padding: 12px 12px;
    margin-bottom: 8px;
}

.history-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.history-date {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.history-stats {
    display: flex;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.history-stats .stat-badge {
    background: rgba(255,255,255,0.06);
    padding: 2px 6px;
    border-radius: 6px;
}

.player-stats .stat-badge {
    font-size: 12px;
}
/* ===== СТРАНИЦА ДЕТАЛЕЙ ТУРНИРА ===== */
.detail-page {
    padding: 0 0 calc(var(--nav-height) + env(safe-area-inset-bottom)) 0;
}

.detail-back-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 0;
    margin-bottom: 4px;
}

.detail-status-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 14px 12px;
    text-align: center;
    margin-bottom: 8px;
}

.detail-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 4px 12px;
    margin-bottom: 8px;
}

.detail-status-text {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.detail-tournament-title {
    font-size: 18px;
    font-weight: 900;
    color: var(--text-primary);
    margin: 0;
}

.detail-info-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
}

.detail-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.detail-info-item {
    margin-bottom: 0;
}

.detail-info-item.full-width {
    margin-bottom: 8px;
}

.detail-info-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-info-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.detail-spots-section {
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.detail-spots-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.detail-spots-count {
    font-weight: 700;
    color: #a78bfa;
    font-size: 13px;
}

.detail-participants {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.detail-participants-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    cursor: pointer;
    padding: 4px 0;
}

.toggle-arrow {
    font-size: 8px;
}

.participant-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.participant-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
}

.participant-name {
    font-size: 12px;
    color: var(--text-primary);
}

.detail-format-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 12px 12px;
    margin-bottom: 8px;
    border-left: 3px solid #6c5ce7;
}

.detail-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-apply-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #6c5ce7, #a78bfa);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
}

.detail-apply-btn.detail-apply-btn--results,
.detail-apply-btn.detail-apply-btn--registered {
    background: rgba(148, 163, 184, 0.18);
    color: rgba(226, 232, 240, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.detail-apply-btn.detail-apply-btn--registered,
.detail-apply-btn.detail-apply-btn--registered:disabled {
    cursor: default;
    opacity: 1;
    pointer-events: none;
}

.detail-apply-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.detail-back-btn-secondary {
    width: 100%;
    padding: 9px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
}

.detail-back-btn-secondary:active {
    background: rgba(255,255,255,0.05);
}

/* ===== СТРАНИЦА РЕЗУЛЬТАТОВ ===== */
.results-page {
    padding: 0 0 calc(var(--nav-height) + env(safe-area-inset-bottom)) 0;
}

.results-info-card {
    background: linear-gradient(160deg, rgba(108, 92, 231, 0.18), rgba(30, 26, 74, 0.72));
    border-radius: 16px;
    padding: 14px 14px 16px;
    margin-bottom: 14px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.results-info-card--loading {
    text-align: left;
}

.results-info-head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.results-info-card .results-back-btn {
    margin-bottom: 0;
    padding: 6px 12px;
    font-size: 12px;
    flex-shrink: 0;
}

.results-info-head .results-info-badge {
    margin-bottom: 0;
    margin-left: auto;
}

.results-info-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(167, 139, 250, 0.18), transparent 55%);
    pointer-events: none;
}

.results-info-badge {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 5px 12px;
    margin-bottom: 10px;
    font-size: 9px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.6px;
}

.results-info-title {
    position: relative;
    z-index: 1;
    font-size: 20px;
    font-weight: 900;
    color: var(--text-primary);
    margin: 0 0 12px;
    line-height: 1.25;
}

.results-info-summary {
    position: relative;
    z-index: 1;
    font-size: 13px;
    color: var(--text-secondary);
}

.results-info-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    text-align: left;
    margin-bottom: 12px;
}

.results-info-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 10px;
}

.results-info-item--wide {
    grid-column: 1 / -1;
}

.results-info-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.results-info-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
}

.results-info-meta {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.results-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.results-meta-chip--accent {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.25);
    background: rgba(251, 191, 36, 0.08);
}

.results-section {
    margin-bottom: 14px;
}

.results-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    margin-bottom: 10px;
    padding-left: 2px;
}

.results-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(108, 92, 231, 0.45), transparent);
    margin-left: 4px;
}

.results-empty-card {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 28px 18px;
    text-align: center;
}

.results-empty-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-secondary);
}

.results-empty-icon svg {
    width: 24px;
    height: 24px;
}

.results-empty-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.results-empty-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* ===== ПЬЕДЕСТАЛ ===== */
.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 10px;
    padding: 18px 10px 14px;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 14px 8px 10px;
    border-radius: 14px;
    flex: 1;
    max-width: 108px;
    min-height: 0;
}

.podium-1 {
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.18), rgba(255, 215, 0, 0.05));
    border: 1px solid rgba(255, 215, 0, 0.32);
    order: 2;
    padding-bottom: 16px;
    transform: translateY(-6px);
    box-shadow: 0 10px 24px rgba(255, 215, 0, 0.08);
}

.podium-2 {
    background: linear-gradient(180deg, rgba(192, 192, 192, 0.14), rgba(192, 192, 192, 0.04));
    border: 1px solid rgba(192, 192, 192, 0.28);
    order: 1;
}

.podium-3 {
    background: linear-gradient(180deg, rgba(205, 127, 50, 0.14), rgba(205, 127, 50, 0.04));
    border: 1px solid rgba(205, 127, 50, 0.28);
    order: 3;
}

/* ===== АВАТАРЫ ПЬЕДЕСТАЛА ===== */
.podium-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-size: cover !important;
    background-position: center;
    background-repeat: no-repeat;
    border: 3px solid rgba(255,255,255,.15);
    background-color: #6c5ce7;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.podium-1 .podium-avatar{
    width:72px;
    height:72px;
    border-color:#ffd700;
}

.podium-2 .podium-avatar{
    border-color:#c0c0c0;
}

.podium-3 .podium-avatar{
    border-color:#cd7f32;
}

.podium-avatar-wrapper {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 6px;
}

.podium-avatar-wrap{
    position:relative;
    display:inline-block;
    margin-bottom:8px;
}

@keyframes crownFloat{
    0%,100%{
        transform:translateX(-50%) translateY(0);
    }
    50%{
        transform:translateX(-50%) translateY(-3px);
    }
}

.podium-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 96px;
}

.podium-medal {
    font-size: 18px;
    margin-bottom: 4px;
}

.podium-1 .podium-medal {
    font-size: 22px;
}

.podium-stats {
    display: flex;
    gap: 6px;
    font-size: 9px;
    color: var(--text-secondary);
    flex-wrap: wrap;
    justify-content: center;
}

.podium-stats .stat-badge {
    font-size: 9px;
    padding: 3px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

/* ===== СПИСОК УЧАСТНИКОВ ===== */
.results-list {
    background: var(--bg-card);
    border-radius: 14px;
    overflow: hidden;
}

.results-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.results-list-item:last-child {
    border-bottom: none;
}

.results-place {
    font-size: 12px;
    font-weight: 800;
    color: var(--accent-secondary);
    min-width: 32px;
    text-align: center;
}

.results-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.08);
    background-position: center;
    background-repeat: no-repeat;
}

.results-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.results-stats {
    display: flex;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.results-stats .stat-badge {
    font-size: 11px;
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 12, 41, 0.8);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    animation: appFadeIn 0.2s ease;
}

.modal {
    background: rgba(30, 26, 74, 0.95);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 40px rgba(108, 92, 231, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.modal-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
}

.modal-body {
    padding: 16px;
}

/* ===== СОСТОЯНИЯ ===== */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.loading-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-width: min(100%, 240px);
    padding: 18px 20px;
    border-radius: 16px;
    background: rgba(30, 26, 74, 0.72);
    border: 1px solid rgba(167, 139, 250, 0.16);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.loading-label {
    color: rgba(226, 232, 240, 0.82);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-align: center;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
    animation: bounce 1.4s ease-in-out infinite;
    box-shadow: 0 0 8px var(--accent-glow);
}

.loading-dots span:nth-child(2) { animation-delay: 0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0.32s; }
.loading-dots span:nth-child(4) { animation-delay: 0.48s; }
.loading-dots span:nth-child(5) { animation-delay: 0.64s; }

.empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--glass-border);
}

/* ===== РЕЙТИНГ (полный список) ===== */
.rating-full-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rating-full-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius-md);
    padding: 12px;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.rating-full-item:hover {
    border-color: rgba(167, 139, 250, 0.25);
    box-shadow: 0 2px 16px var(--accent-glow);
}

.rating-full-item.top-1 {
    border-color: rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
}

.rating-full-item.top-2 {
    border-color: rgba(192, 192, 192, 0.25);
}

.rating-full-item.top-3 {
    border-color: rgba(205, 127, 50, 0.25);
}

/* ===== ПРОФИЛЬ ПОЛЬЗОВАТЕЛЯ ===== */
.user-profile-wrapper {
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
    animation: appFadeIn 0.4s ease;
}

.back-btn,
.detail-back-btn,
.results-back-btn {
    background: rgba(108, 92, 231, 0.15);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    margin-bottom: 16px;
    transition: var(--transition);
    letter-spacing: 0.3px;
}

.back-btn:hover,
.detail-back-btn:hover,
.results-back-btn:hover {
    background: rgba(108, 92, 231, 0.25);
    border-color: rgba(167, 139, 250, 0.3);
    color: var(--text-primary);
}

.user-header {
    text-align: center;
    padding: 8px 0 20px;
}

.user-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 900;
    color: #fff;
    border: 3px solid rgba(167, 139, 250, 0.4);
    box-shadow: 0 0 24px var(--accent-glow);
    background-size: cover;
    background-position: center;
}

.user-name {
    font-size: 22px;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.user-nickname {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

.user-period {
    margin-top: 6px;
    font-size: 11px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: 0.75;
    font-weight: 700;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 8px;
}

.stats-grid .stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stats-grid .stat-value,
.stats-grid .stat-label {
    display: block;
    width: 100%;
}

/* ===== ИСТОРИЯ (компактные карточки) ===== */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-card-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 12px;
    transition: var(--transition);
}

.history-card-compact:hover {
    border-color: rgba(167, 139, 250, 0.25);
    box-shadow: 0 2px 12px var(--accent-glow);
}

.history-card-clickable {
    cursor: pointer;
}

.compact-info {
    flex: 1;
    min-width: 0;
}

.compact-title {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.compact-date {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
}

.compact-stats {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.compact-place,
.compact-bounty,
.compact-points {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 6px;
    background: rgba(108, 92, 231, 0.15);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.compact-place {
    color: var(--accent-secondary);
}

.compact-details-btn {
    background: rgba(108, 92, 231, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    flex-shrink: 0;
}

.compact-details-btn:hover {
    background: rgba(108, 92, 231, 0.35);
    color: var(--text-primary);
}

/* ===== ФОРМЫ И МОДАЛКИ ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="file"] {
    width: 100%;
    padding: 12px 14px;
    background: rgba(15, 12, 41, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px var(--accent-glow);
}

.save-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.save-btn:hover {
    box-shadow: 0 6px 24px rgba(108, 92, 231, 0.5);
    transform: translateY(-1px);
}

.save-btn:active {
    transform: scale(0.98);
}

/* ===== ДЕТАЛИ / РЕЗУЛЬТАТЫ (glass) ===== */
.detail-status-card,
.detail-info-card,
.detail-format-card,
.results-info-card,
.results-empty-card,
.podium,
.results-list {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
}

.profile-avatar {
    box-shadow: 0 0 24px var(--accent-glow);
}

.profile-header {
    position: relative;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.profile-avatar,
.profile-name,
.profile-nickname {
    position: relative;
    z-index: 1;
}

/* ===== СЕКЦИИ СТРАНИЦ ===== */
section {
    animation: appFadeIn 0.4s ease;
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.section-header-row .section-title {
    margin-bottom: 0;
}

.section-spacer {
    margin-top: 24px;
}

.header-logo-img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 8px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 12px rgba(167, 139, 250, 0.45));
}

.loader-logo-img {
    width: 72px;
    height: auto;
    max-height: 56px;
    object-fit: contain;
    filter: drop-shadow(0 0 14px rgba(167, 139, 250, 0.35));
    animation: loaderLogoFloat 3s ease-in-out infinite;
}

@keyframes loaderLogoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* ===== АВТОРИЗАЦИЯ ===== */
.auth-screen {
    position: relative;
    z-index: 1;
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    overflow: hidden;
}

.auth-stage {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 48px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    gap: 0;
}

.auth-stage-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    width: 100%;
}

.auth-orbs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.45;
    animation: authOrbFloat 8s ease-in-out infinite;
}

.auth-orb-1 {
    width: 220px;
    height: 220px;
    background: rgba(108, 92, 231, 0.5);
    top: -40px;
    left: -60px;
}

.auth-orb-2 {
    width: 180px;
    height: 180px;
    background: rgba(167, 139, 250, 0.35);
    bottom: 10%;
    right: -50px;
    animation-delay: -3s;
}

.auth-orb-3 {
    width: 120px;
    height: 120px;
    background: rgba(140, 130, 255, 0.3);
    top: 40%;
    left: 50%;
    animation-delay: -5s;
}

@keyframes authOrbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(12px, -18px) scale(1.08); }
}

.auth-suits {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.auth-suit {
    position: absolute;
    font-size: 28px;
    opacity: 0.08;
    color: var(--accent-secondary);
    animation: authSuitDrift 12s ease-in-out infinite;
}

.auth-suit-1 { top: 12%; left: 8%; animation-delay: 0s; }
.auth-suit-2 { top: 22%; right: 10%; animation-delay: -2s; color: #f87171; }
.auth-suit-3 { bottom: 28%; left: 12%; animation-delay: -4s; }
.auth-suit-4 { bottom: 18%; right: 8%; animation-delay: -6s; color: #f87171; }

@keyframes authSuitDrift {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.06; }
    50% { transform: translateY(-12px) rotate(8deg); opacity: 0.12; }
}

.auth-reveal {
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(20px);
    animation: authReveal 0.7s ease forwards;
    animation-delay: calc(var(--delay, 0) * 0.12s + 0.1s);
}

@keyframes authReveal {
    to { opacity: 1; transform: translateY(0); }
}

.auth-hero {
    text-align: center;
    padding-top: 8px;
}

.auth-brand {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 4px;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-shadow: 0 0 24px var(--accent-glow);
}

.auth-tagline {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.3px;
    line-height: 1.4;
    max-width: 280px;
    margin: 0 auto;
}

.auth-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.auth-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(30, 26, 74, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: var(--transition);
}

.auth-chip .icon-inline {
    width: 14px;
    height: 14px;
    color: var(--accent-secondary);
}

.auth-chip-accent {
    border-color: rgba(108, 92, 231, 0.35);
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent-secondary);
}

.auth-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-methods-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(167, 139, 250, 0.6);
    text-align: center;
    margin-bottom: 4px;
}

.auth-method {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px 18px;
    background: rgba(30, 26, 74, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    text-align: left;
    color: var(--text-primary);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
}

.auth-method:active {
    transform: scale(0.98);
}

.auth-method:hover {
    border-color: rgba(167, 139, 250, 0.35);
    box-shadow: 0 8px 32px var(--accent-glow);
}

.auth-method-tg {
    border-color: rgba(108, 92, 231, 0.4);
}

.auth-method-glow {
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.4), transparent 40%, rgba(167, 139, 250, 0.3));
    opacity: 0.5;
    pointer-events: none;
    animation: authGlowPulse 3s ease-in-out infinite;
}

@keyframes authGlowPulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 0.65; }
}

.auth-method-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(108, 92, 231, 0.2);
    border: 1px solid var(--glass-border);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.auth-method-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
}

.auth-method-tg .auth-method-icon {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.35), rgba(167, 139, 250, 0.2));
    color: var(--accent-secondary);
}

.auth-method-body {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.auth-method-title {
    display: block;
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 2px;
}

.auth-method-desc {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.auth-method-arrow {
    font-size: 18px;
    color: var(--accent-secondary);
    opacity: 0.7;
    position: relative;
    z-index: 1;
    transition: transform 0.2s ease;
}

.auth-method:hover .auth-method-arrow {
    transform: translateX(4px);
    opacity: 1;
}

.auth-method.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

.auth-footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
    flex-shrink: 0;
    padding-top: 16px;
    border-top: 1px solid rgba(167, 139, 250, 0.1);
}

.auth-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 11px;
    color: rgba(167, 139, 250, 0.55);
    line-height: 1.4;
    font-weight: 600;
}

.auth-meta-item .icon-inline {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    margin-top: 1px;
    opacity: 0.7;
}

.auth-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(15, 12, 41, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    user-select: text;
    -webkit-user-select: text;
}

.auth-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px var(--accent-glow);
}

.auth-modal {
    max-width: 400px;
}

/* ===== AUTH SHEET (модалки) ===== */
.auth-sheet-overlay {
    align-items: center;
    justify-content: center;
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    background: rgba(8, 6, 24, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.auth-sheet-overlay.active {
    opacity: 1;
}

.auth-sheet-overlay.auth-sheet-stacked {
    background: rgba(8, 6, 24, 0.55);
}

.auth-sheet {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: min(88vh, calc(100vh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: linear-gradient(165deg, rgba(38, 32, 88, 0.98) 0%, rgba(22, 18, 52, 0.98) 100%);
    border: 1px solid rgba(167, 139, 250, 0.22);
    border-radius: 24px;
    box-shadow:
        0 8px 48px rgba(108, 92, 231, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    transform: translateY(12px) scale(0.96);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.28s ease;
}

.auth-sheet-overlay.active .auth-sheet {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.auth-sheet-handle {
    display: none;
}

.auth-sheet-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), var(--accent-secondary), transparent);
    opacity: 0.8;
}

.auth-sheet-header {
    position: relative;
    text-align: center;
    padding: 16px 48px 12px;
    flex-shrink: 0;
}

.auth-sheet-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.auth-sheet-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.auth-sheet-close svg {
    width: 16px;
    height: 16px;
}

.auth-sheet-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.25), rgba(167, 139, 250, 0.12));
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 16px;
    color: var(--accent-secondary);
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.2);
}

.auth-sheet-icon svg {
    width: 24px;
    height: 24px;
}

.auth-sheet-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.auth-sheet-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    line-height: 1.4;
}

.auth-modal-tabs {
    display: flex;
    gap: 6px;
    margin: 0 20px 12px;
    padding: 4px;
    background: rgba(15, 12, 41, 0.5);
    border: 1px solid rgba(167, 139, 250, 0.12);
    border-radius: 14px;
    flex-shrink: 0;
}

.auth-tab {
    flex: 1;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.auth-tab.active {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.35), rgba(167, 139, 250, 0.2));
    color: var(--text-primary);
    box-shadow: 0 2px 12px rgba(108, 92, 231, 0.25);
}

.auth-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 8px;
    -webkit-overflow-scrolling: touch;
}

.auth-sheet-footer {
    flex-shrink: 0;
    padding: 12px 20px calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(167, 139, 250, 0.1);
    background: rgba(15, 12, 41, 0.35);
}

.auth-sheet-submit {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 800;
    border-radius: 14px;
    letter-spacing: 0.02em;
}

.auth-sheet-note {
    font-size: 12px;
    color: rgba(167, 139, 250, 0.65);
    line-height: 1.5;
    text-align: center;
    margin-bottom: 14px;
    font-weight: 600;
}

.auth-sheet-note-accent {
    margin-top: 4px;
    margin-bottom: 0;
}

.auth-sheet-note-accent strong {
    color: var(--accent-secondary);
}

.auth-demo-hint {
    text-align: center;
    font-size: 11px;
    color: rgba(167, 139, 250, 0.45);
    margin-top: 10px;
    font-weight: 600;
}

.auth-sheet-switch {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 12px;
    font-weight: 600;
}

.auth-sheet-switch button {
    background: none;
    border: none;
    color: var(--accent-secondary);
    font-weight: 800;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
}

.auth-field {
    margin-bottom: 14px;
}

.auth-field-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: rgba(167, 139, 250, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.auth-field-wrap {
    position: relative;
}

.auth-field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: rgba(167, 139, 250, 0.5);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-field-icon .icon-inline {
    width: 18px;
    height: 18px;
}

.auth-input-icon {
    padding-left: 44px !important;
}

.auth-panel {
    display: none;
}

.auth-panel.auth-panel-active {
    display: block;
    animation: authPanelIn 0.25s ease;
}

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

.auth-forgot-btn {
    display: block;
    width: 100%;
    text-align: right;
    background: none;
    border: none;
    font-size: 12px;
    color: var(--accent-secondary);
    font-weight: 700;
    cursor: pointer;
    margin-top: -4px;
    margin-bottom: 4px;
    padding: 4px 0;
}

.auth-choice-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 10px;
    background: rgba(15, 12, 41, 0.45);
    border: 1px solid rgba(167, 139, 250, 0.15);
    border-radius: 16px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    color: inherit;
}

.auth-choice-card:last-child {
    margin-bottom: 0;
}

.auth-choice-card:hover {
    border-color: rgba(167, 139, 250, 0.35);
    background: rgba(108, 92, 231, 0.12);
    transform: translateY(-1px);
}

.auth-choice-primary {
    border-color: rgba(108, 92, 231, 0.35);
    background: rgba(108, 92, 231, 0.1);
}

.auth-choice-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(108, 92, 231, 0.2);
    border-radius: 12px;
    color: var(--accent-secondary);
}

.auth-choice-icon svg {
    width: 20px;
    height: 20px;
}

.auth-choice-body {
    flex: 1;
    min-width: 0;
}

.auth-choice-title {
    display: block;
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.auth-choice-desc {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.auth-choice-arrow {
    font-size: 16px;
    color: var(--accent-secondary);
    opacity: 0.6;
    flex-shrink: 0;
}

.auth-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 18px;
    padding: 0 8px;
}

.auth-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.auth-step span {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
    background: rgba(15, 12, 41, 0.6);
    border: 1px solid rgba(167, 139, 250, 0.2);
    color: var(--text-secondary);
    transition: var(--transition);
}

.auth-step em {
    font-style: normal;
    font-size: 10px;
    font-weight: 700;
    color: rgba(167, 139, 250, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.auth-step.active span {
    background: linear-gradient(135deg, var(--accent-primary), rgba(167, 139, 250, 0.6));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.auth-step.active em {
    color: var(--accent-secondary);
}

.auth-step-line {
    flex: 1;
    height: 2px;
    max-width: 60px;
    margin: 0 8px 14px;
    background: rgba(167, 139, 250, 0.15);
    border-radius: 2px;
    transition: var(--transition);
}

.auth-step-line.active {
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.auth-sheet .agreement-content {
    max-height: 42vh;
    padding: 0;
    margin-bottom: 4px;
}

.auth-note {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    text-align: center;
}

.auth-switch-link {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-switch-link span {
    color: var(--accent-secondary);
    cursor: pointer;
    font-weight: 700;
}

.forgot-password-link {
    font-size: 12px;
    color: var(--accent-secondary);
    text-align: right;
    margin-top: -8px;
    margin-bottom: 12px;
    cursor: pointer;
    font-weight: 600;
}

.agreement-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    cursor: pointer;
}

.agreement-checkbox {
    margin-top: 3px;
    accent-color: var(--accent-primary);
}

.agreement-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.agreement-text a {
    color: var(--accent-secondary);
    text-decoration: none;
    font-weight: 700;
}

.agreement-content {
    max-height: 50vh;
    overflow-y: auto;
    padding: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.agreement-content h3 {
    color: var(--text-primary);
    font-size: 14px;
    margin: 12px 0 8px;
}

.agreement-content p {
    margin-bottom: 8px;
}

.btn-mt-8 { margin-top: 8px; }
.btn-mt-12 { margin-top: 12px; }

.notice-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 12, 41, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.notice-overlay.active {
    opacity: 1;
}

.notice-card {
    background: rgba(30, 26, 74, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 40px rgba(108, 92, 231, 0.3);
}

.notice-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    color: var(--accent-secondary);
}

.notice-icon svg {
    width: 100%;
    height: 100%;
}

.notice-icon-success {
    color: #22c55e;
}

.notice-icon-error {
    color: #f87171;
}

.notice-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.notice-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.welcome-nickname {
    font-size: 24px;
    font-weight: 900;
    color: var(--accent-secondary);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.welcome-overlay .notice-card {
    position: relative;
    overflow: visible;
}

.welcome-burst {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(108, 92, 231, 0.25) 0%, transparent 65%);
    pointer-events: none;
    animation: welcomeBurst 1.2s ease-out forwards;
}

@keyframes welcomeBurst {
    from { opacity: 0; transform: scale(0.6); }
    to { opacity: 1; transform: scale(1); }
}

.welcome-chip-stack {
    position: relative;
    width: 64px;
    height: 48px;
    margin: 0 auto 16px;
}

.welcome-chip {
    position: absolute;
    left: 50%;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px dashed rgba(167, 139, 250, 0.5);
    transform: translateX(-50%);
    animation: welcomeChipLand 0.6s ease backwards;
}

.welcome-chip-1 {
    bottom: 0;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    box-shadow: 0 4px 16px var(--accent-glow);
    animation-delay: 0.1s;
    z-index: 3;
}

.welcome-chip-2 {
    bottom: 8px;
    background: rgba(108, 92, 231, 0.4);
    animation-delay: 0.25s;
    z-index: 2;
    transform: translateX(-50%) scale(0.92);
}

.welcome-chip-3 {
    bottom: 14px;
    background: rgba(108, 92, 231, 0.2);
    animation-delay: 0.4s;
    z-index: 1;
    transform: translateX(-50%) scale(0.84);
}

@keyframes welcomeChipLand {
    from { opacity: 0; transform: translateX(-50%) translateY(-30px) scale(0.5); }
    to { opacity: 1; }
}

.welcome-btn {
    width: 100%;
    letter-spacing: 1px;
}

.profile-action-logout {
    color: #f87171 !important;
    border-color: rgba(248, 113, 113, 0.25) !important;
}

.profile-action-logout .icon-inline {
    color: #f87171;
}

.auth-sheet-cancel {
    width: 100%;
    margin-top: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 14px;
}

.auth-logout-confirm {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    box-shadow: 0 4px 18px rgba(239, 68, 68, 0.3);
}

/* ===== FAQ / ABOUT SHEETS ===== */
.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-card {
    background: rgba(15, 12, 41, 0.45);
    border: 1px solid rgba(167, 139, 250, 0.14);
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition);
}

.faq-card.open {
    border-color: rgba(108, 92, 231, 0.35);
    background: rgba(108, 92, 231, 0.08);
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.12);
}

.faq-card-head {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    color: inherit;
}

.faq-card-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(108, 92, 231, 0.18);
    border-radius: 10px;
    color: var(--accent-secondary);
}

.faq-card-icon .icon-inline {
    width: 16px;
    height: 16px;
}

.faq-card-q {
    flex: 1;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.35;
}

.faq-card-chevron {
    flex-shrink: 0;
    color: var(--accent-secondary);
    opacity: 0.7;
    transition: transform 0.25s ease;
}

.faq-card-chevron .icon-inline {
    width: 16px;
    height: 16px;
}

.faq-card.open .faq-card-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

.faq-card-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-card.open .faq-card-body {
    grid-template-rows: 1fr;
}

.faq-card-body-inner {
    overflow: hidden;
}

.faq-card-a {
    padding: 0 14px 14px 56px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.28s ease 0.06s, transform 0.32s cubic-bezier(0.4, 0, 0.2, 1) 0.06s;
}

.faq-card.open .faq-card-a {
    opacity: 1;
    transform: translateY(0);
}

.faq-card-a a {
    color: var(--accent-secondary);
    text-decoration: none;
    font-weight: 700;
}

.faq-card-a strong {
    color: var(--text-primary);
}

.info-chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.info-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(15, 12, 41, 0.45);
    border: 1px solid rgba(167, 139, 250, 0.14);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.info-chip .icon-inline {
    width: 16px;
    height: 16px;
    color: var(--accent-secondary);
}

.info-chip-accent {
    border-color: rgba(108, 92, 231, 0.3);
    background: rgba(108, 92, 231, 0.12);
}

.about-sheet-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    font-weight: 600;
    padding: 14px;
    background: rgba(15, 12, 41, 0.35);
    border: 1px solid rgba(167, 139, 250, 0.12);
    border-radius: 14px;
    margin-bottom: 14px;
}

.about-sheet-content strong {
    color: var(--text-primary);
    font-weight: 800;
}

.about-sheet-content a {
    color: var(--accent-secondary);
    text-decoration: none;
    font-weight: 700;
}

.about-contact-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.about-contact-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(108, 92, 231, 0.1);
    border: 1px solid rgba(167, 139, 250, 0.18);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.about-contact-card:hover {
    border-color: rgba(167, 139, 250, 0.35);
    transform: translateY(-1px);
}

.about-contact-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(108, 92, 231, 0.2);
    border-radius: 12px;
    color: var(--accent-secondary);
    flex-shrink: 0;
}

.about-contact-icon .icon-inline {
    width: 18px;
    height: 18px;
}

.about-contact-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.about-contact-body em {
    font-style: normal;
    font-size: 11px;
    color: rgba(167, 139, 250, 0.6);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.about-contact-body strong {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 800;
}

.faq-item label {
    margin-bottom: 6px;
}

.faq-answer,
.about-content {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.faq-answer a,
.about-content a {
    color: var(--accent-secondary);
    text-decoration: none;
    font-weight: 600;
}

/* ===== ПРОКРУТКА ===== */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 2px;
}
