/* Сброс и базовые стили */

:root {
    --tg-theme-bg-color: #667eea;
    --tg-theme-text-color: #ffffff;
    --tg-theme-hint-color: #aaaaaa;
    --tg-theme-link-color: #667eea;
    --tg-theme-button-color: #667eea;
    --tg-theme-button-text-color: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: var(--tg-theme-bg-color) !important;
    color: var(--tg-theme-text-color) !important;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
}

/* ШАПКА */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
}

.logo {
    font-size: 20px;
    font-weight: bold;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.3s;
}

.user-info:hover {
    transform: scale(1.05);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, #FF6B8B, #FF8E53);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* ГЛАВНЫЙ ЭКРАН */
.main-menu {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.menu-item {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.menu-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.menu-icon {
    font-size: 40px;
}

.menu-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.menu-description {
    font-size: 12px;
    color: #666;
}

/* СТАТУС ПОИСКА ИГРЫ */
.searching-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 9998;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.searching-content {
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.searching-title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 20px;
}

.searching-subtitle {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 40px;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.avatar-option.selected {
    border: 2px solid #667eea !important;
    background: #f0f5ff !important;
}

.player-slot {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.player-slot.filled {
    background: rgba(255, 255, 255, 0.3);
}

.player-slot.male {
    border: 3px solid #667eea;
}

.player-slot.female {
    border: 3px solid #FF6B8B;
}

.slot-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.slot-avatar.male {
    background: #667eea;
}

.slot-avatar.female {
    background: #FF6B8B;
}

.slot-name {
    font-size: 14px;
    font-weight: bold;
}

.searching-timer {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 30px;
}

.cancel-search {
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.cancel-search:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ИГРОВОЙ ЭКРАН */
.game-screen {
    display: none;
    height: calc(100vh - 100px);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.round-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.round-badge {
    background: #667eea;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
}

.game-timer {
    font-size: 36px;
    font-weight: bold;
    color: #FF6B8B;
}

.game-content {
    display: flex;
    gap: 20px;
    height: calc(100% - 100px);
}

.questions-column {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.answers-column {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.column-title {
    font-size: 18px;
    color: #667eea;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

/* ВОПРОСЫ */
.question-item {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.question-item.active {
    border-color: #667eea;
    background: #f0f5ff;
}

.question-text {
    font-size: 16px;
    line-height: 1.4;
    color: #333;
    margin-bottom: 10px;
}

.question-author {
    font-size: 12px;
    color: #666;
}

/* ОТВЕТЫ */
.answer-item {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    border: 2px solid transparent;
    transition: all 0.3s;
    cursor: pointer;
}

.answer-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.answer-item.selected {
    border-color: #FF6B8B;
    background: #fff5f7;
}

.answer-text {
    font-size: 16px;
    line-height: 1.4;
    color: #333;
    margin-bottom: 10px;
}

.answer-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.author-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.author-avatar.male {
    background: #667eea;
    color: white;
}

.author-avatar.female {
    background: #FF6B8B;
    color: white;
}

.author-name {
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.like-button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: #f0f0f0;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.like-button:hover {
    background: #e0e0e0;
}

.like-button.selected {
    background: #FF6B8B;
    color: white;
}

/* ЭКРАН СТРЕЛОК */
.arrows-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.arrows-title {
    font-size: 32px;
    font-weight: bold;
    color: white;
    margin-bottom: 40px;
    text-align: center;
}

.arrows-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 20px;
    width: 90%;
    max-width: 800px;
    height: 60vh;
    margin-bottom: 40px;
}

.arrow-cell {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

.arrow-cell.matched {
    background: rgba(76, 175, 80, 0.2);
    border: 2px solid #4CAF50;
}

.cell-players {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.cell-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.cell-avatar.male {
    background: #667eea;
}

.cell-avatar.female {
    background: #FF6B8B;
}

.cell-name {
    font-size: 12px;
    color: white;
    font-weight: bold;
}

.arrow-line {
    position: absolute;
    z-index: 1;
    pointer-events: none;
}

/* ЭКРАН МЭТЧА */
.match-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.98);
    z-index: 1001;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.match-card {
    background: white;
    border-radius: 25px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: bounceIn 0.8s;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    70% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.match-heart {
    font-size: 80px;
    color: #FF6B8B;
    margin-bottom: 20px;
    animation: heartbeat 1.5s infinite;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.match-title {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.match-subtitle {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

.matched-players {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.matched-player {
    text-align: center;
}

.matched-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
    border: 4px solid white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.matched-avatar.male {
    background: #667eea;
}

.matched-avatar.female {
    background: #FF6B8B;
}

.matched-name {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.matched-details {
    font-size: 14px;
    color: #666;
}

.telegram-button {
    width: 100%;
    padding: 18px;
    background: #0088cc;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.telegram-button:hover {
    background: #0077b3;
    transform: translateY(-2px);
}

/* ОКНО ПРОФИЛЯ (обновлённое) */
.profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.profile-card {
    background: white;
    border-radius: 25px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.profile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px 20px;
    text-align: center;
    color: white;
    position: relative;
}

.profile-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.2);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 15px;
    border: 4px solid white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.profile-name {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.profile-details {
    font-size: 14px;
    opacity: 0.9;
}

.profile-content {
    padding: 20px;
}

/* Разделитель */
.section-divider {
    height: 1px;
    background: #e9ecef;
    margin: 20px 0;
}

/* Статистика (видят все) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    font-size: 11px;
    color: #666;
    margin-top: 3px;
}

/* Личная информация (только для себя) */
.private-section {
    background: #f0f5ff;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.private-label {
    font-size: 12px;
    color: #667eea;
    font-weight: bold;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.private-info {
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
}

/* Вопрос (только для себя) */
.question-section {
    background: #fff5f7;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #FF6B8B;
}

.question-label {
    font-size: 12px;
    color: #FF6B8B;
    font-weight: bold;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.question-text {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

/* ЭКРАН ВХОДА */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 25px;
    padding: 40px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}

.login-tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 2px solid #e9ecef;
}

.login-tab {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.login-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.login-form {
    display: block;
}

.login-form.hidden {
    display: none;
}

.login-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    margin-bottom: 15px;
    outline: none;
    transition: border-color 0.3s;
}

.login-input:focus {
    border-color: #667eea;
}

.login-button {
    width: 100%;
    padding: 18px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.login-links {
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.login-link {
    color: #667eea;
    text-decoration: none;
    cursor: pointer;
}

.login-link:hover {
    text-decoration: underline;
}

/* Баланс в шапке (только для себя) */
.header-balance {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 107, 139, 0.2);
    padding: 5px 10px;
    border-radius: 15px;
    margin-right: 10px;
}

.balance-icon {
    color: #FF6B8B;
}

.balance-text {
    font-size: 14px;
    font-weight: bold;
    color: #FF6B8B;
}

/* Кнопки профиля */
.profile-buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    align-items: center !important;
    width: 100% !important;
    margin-top: 20px !important;
}

.profile-btn {
    width: 100% !important;
    max-width: 250px !important;
    padding: 15px !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    box-sizing: border-box !important;
}

#profile-buttons {
    display: flex !important;
}

.profile-btn.edit {
    background: #667eea;
    color: white;
}

.profile-btn.edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.profile-btn.gift {
    background: linear-gradient(45deg, #FF6B8B, #FF8E53);
    color: white;
}   

.profile-btn.gift:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 139, 0.4);
}

.profile-btn.logout {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e9ecef;
}

.profile-btn.logout:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.profile-btn.chat {
    background: #667eea;
    color: white;
}

.profile-btn.chat:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Форма редактирования профиля */
.edit-form {
    display: none;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    color: #333;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.form-input:focus {
    border-color: #667eea;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.form-btn.save {
    background: #4CAF50;
    color: white;
}

.form-btn.save:hover {
    background: #43a047;
}

.form-btn.cancel {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e9ecef;
}

.form-btn.cancel:hover {
    background: #e9ecef;
}

/* Подарки */
.gifts-section {
    margin-bottom: 20px;
}

.gifts-title {
    font-size: 14px;
    color: #333;
    font-weight: bold;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.gifts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.gift-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    font-size: 20px;
}

/* Регистрация - новые поля */
.registration-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

/* УТИЛИТЫ */
.hidden {
    display: none !important;
}

.visible {
    display: flex !important;
}

/* ЭКРАН СОЗДАНИЯ ПРОФИЛЯ */
#registration-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#registration-screen > div {
    background: white;
    border-radius: 25px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* ========== СТИЛИ ПРОФИЛЯ ========== */

.profile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px 20px;
    text-align: center;
    color: white;
    position: relative;
    border-radius: 25px 25px 0 0;
}

.profile-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.2);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    margin: 0 auto 15px;
    border: 3px solid white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
    background: linear-gradient(45deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    position: relative;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.profile-details {
    font-size: 14px;
    opacity: 0.9;
}

.profile-content {
    padding: 20px;
}

/* ========== КРАСИВАЯ ЗАГРУЗКА ФОТО ========== */

.photo-upload-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.photo-preview-large {
    width: 140px;
    height: 140px;
    background: linear-gradient(135deg, #f0f5ff 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 3px dashed #c1c8e4;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s;
    position: relative;
}

.photo-preview-large:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.photo-preview-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.photo-placeholder {
    text-align: center;
    color: #667eea;
    padding: 20px;
}

.photo-placeholder-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.photo-placeholder-text {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.photo-requirements {
    text-align: center;
    color: #666;
    font-size: 12px;
    line-height: 1.4;
}

.photo-requirements div {
    margin-bottom: 3px;
}

.photo-buttons-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.photo-btn-primary {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.photo-btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.photo-btn-secondary {
    padding: 10px 20px;
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.photo-btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.photo-change-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Стили для кнопок формы редактирования с stopPropagation */
.form-btn.save,
.form-btn.cancel {
    cursor: pointer;
}

.form-btn.save:hover {
    background: #43a047;
}

.form-btn.cancel:hover {
    background: #e9ecef;
}

.photo-preview-large-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.photo-preview-large.has-photo {
    border: 3px solid #667eea;
    background: none;
}

/* ========== ЭКРАН РЕГИСТРАЦИИ ========== */
.registration-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.registration-card {
    background: white;
    border-radius: 25px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.registration-title {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
    font-size: 28px;
}

.registration-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

.registration-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

@media (min-width: 480px) {
    .registration-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.registration-field {
    margin-bottom: 15px;
}

.registration-label {
    display: block;
    color: #333;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 14px;
}

.registration-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.registration-input:focus {
    border-color: #667eea;
}

.registration-textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.registration-gender-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.gender-btn {
    flex: 1;
    padding: 15px;
    border: 3px solid #e9ecef;
    background: white;
    color: #666;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.gender-btn.selected {
    border-color: #667eea;
    background: #f0f5ff;
    color: #667eea;
}

.gender-btn.female.selected {
    border-color: #FF6B8B;
    background: #fff5f7;
    color: #FF6B8B;
}

.registration-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.registration-back-btn {
    flex: 1;
    padding: 18px;
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.registration-back-btn:hover {
    background: #e9ecef;
}

.registration-submit-btn {
    flex: 2;
    padding: 18px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.registration-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

/* Стили для загрузки фото */
.photo-upload-section {
    margin-bottom: 25px;
}

.photo-preview-reg {
    width: 120px;
    height: 120px;
    background: #f8f9fa;
    border: 3px dashed #e9ecef;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    margin: 0 auto 15px;
    transition: all 0.3s;
}

.photo-preview-reg:hover {
    border-color: #667eea;
}

.photo-preview-reg.has-photo {
    border: 3px solid #667eea;
    background: none;
}

.photo-placeholder {
    text-align: center;
    color: #666;
}

.photo-placeholder-icon {
    font-size: 32px;
    margin-bottom: 5px;
}

.photo-placeholder-text {
    font-size: 12px;
    line-height: 1.3;
}

.photo-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 10px;
}

.photo-select-btn {
    padding: 8px 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.photo-select-btn:hover {
    background: #5a6fd8;
}

.photo-remove-btn {
    padding: 8px 15px;
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.photo-remove-btn:hover {
    background: #e9ecef;
}

.photo-info {
    font-size: 11px;
    color: #666;
    text-align: center;
    line-height: 1.4;
}

.gender-btn {
    flex: 1;
    padding: 15px;
    border: 3px solid #e9ecef;
    background: white;
    color: #666;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.gender-btn.male-selected {
    border-color: #667eea !important;
    background: #f0f5ff !important;
    color: #667eea !important;
}

.gender-btn.female-selected {
    border-color: #FF6B8B !important;
    background: #fff5f7 !important;
    color: #FF6B8B !important;
}

/* ========== ЭКРАН МЭТЧА ========== */
.match-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.98);
    z-index: 1001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.match-card {
    background: white;
    border-radius: 25px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: bounceIn 0.8s;
}

.match-heart {
    font-size: 80px;
    color: #FF6B8B;
    margin-bottom: 20px;
    animation: heartbeat 1.5s infinite;
}

.match-title {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.match-subtitle {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

.matched-players {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.matched-player {
    text-align: center;
}

.matched-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: white;
    border: 4px solid white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.matched-avatar.male {
    background: #667eea;
}

.matched-avatar.female {
    background: #FF6B8B;
}

.matched-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.matched-name {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.matched-details {
    font-size: 14px;
    color: #666;
}

.telegram-button {
    width: 100%;
    padding: 18px;
    background: #0088cc;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.telegram-button:hover {
    background: #0077b3;
    transform: translateY(-2px);
}

.continue-game-btn {
    width: 100%;
    padding: 15px;
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.continue-game-btn:hover {
    background: #e9ecef;
}

.telegram-button {
    background: var(--tg-theme-button-color) !important;
    color: var(--tg-theme-button-text-color) !important;
}