* {
    margin: 0;
    padding: 0;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e6e6e6;
    min-height: 100vh;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 20px;
    -webkit-text-size-adjust: 100%;
}

.container {
    width: 100%;
    max-width: 500px;
    background-color: #0f3460;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    height: 90vh;
}

header {
    background: linear-gradient(to right, #e94560, #c2185b);
    padding: 20px;
    text-align: center;
}

.logo {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 28px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
}

header p {
    font-size: 14px;
    opacity: 0.9;
}

main {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

.screen {
    display: none;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    height: 100%;
}

.screen.active {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
}

/* Start Screen */
#start-screen {
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    text-align: center;
}

.start-content {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 20px;
    padding: 20px;
}

.girl-silhouette {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(to right, #e94560, #c2185b);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: 0 0 30px rgba(233, 69, 96, 0.5);
}

.girl-silhouette i {
    font-size: 60px;
    color: white;
}

#start-screen h2 {
    font-size: 24px;
    margin-bottom: 10px;
    background: linear-gradient(to right, #f48fb1, #d81b60);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#start-screen p {
    opacity: 0.8;
    margin-bottom: 20px;
}

#start-chat-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(to right, #e94560, #c2185b);
    color: white;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 10px;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.4);
}

#start-chat-btn:hover {
    -webkit-transform: translateY(-3px);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(233, 69, 96, 0.6);
}

.pulse {
    -webkit-animation: pulse 2s infinite;
    animation: pulse 2s infinite;
}

@-webkit-keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(233, 69, 96, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(233, 69, 96, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(233, 69, 96, 0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(233, 69, 96, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(233, 69, 96, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(233, 69, 96, 0);
    }
}

.rewards-text {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 10px 20px;
    background: rgba(233, 69, 96, 0.2);
    border-radius: 20px;
}

.rewards-text i {
    color: #ffd700;
}

/* Chat Screen */
.chat-header {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
}

.interlocutor-info {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 10px;
}

.anonymous-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(to right, #e94560, #c2185b);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

.anonymous-avatar i {
    font-size: 20px;
}

.status {
    font-size: 12px;
    color: #4caf50;
}

.exit-chat {
    background: none;
    border: none;
    color: #e94560;
    font-size: 20px;
    cursor: pointer;
}

.chat-messages {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: 15px;
    -webkit-overflow-scrolling: touch;
}

.message {
    max-width: 80%;
    padding: 12px 15px;
    border-radius: 18px;
    position: relative;
    -webkit-animation: fadeIn 0.5s ease;
    animation: fadeIn 0.5s ease;
}

@-webkit-keyframes fadeIn {
    from { opacity: 0; -webkit-transform: translateY(10px); transform: translateY(10px); }
    to { opacity: 1; -webkit-transform: translateY(0); transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; -webkit-transform: translateY(10px); transform: translateY(10px); }
    to { opacity: 1; -webkit-transform: translateY(0); transform: translateY(0); }
}

.message.interlocutor {
    -ms-flex-item-align: start;
    align-self: flex-start;
    background-color: #1f4068;
    border-bottom-left-radius: 5px;
}

.message.user {
    -ms-flex-item-align: end;
    align-self: flex-end;
    background: linear-gradient(to right, #e94560, #c2185b);
    border-bottom-right-radius: 5px;
}

.message-time {
    font-size: 10px;
    opacity: 0.7;
    text-align: right;
    margin-top: 5px;
}

.blurred-image {
    position: relative;
    margin-top: 10px;
    cursor: pointer;
}

.blurred-image img {
    width: 100%;
    border-radius: 10px;
    transition: filter 0.3s ease;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.image-overlay i {
    font-size: 40px;
    color: white;
    opacity: 0.8;
}

.chat-input {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-input input {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 20px;
    background-color: #1a1a2e;
    color: white;
    font-size: 16px; /* Увеличиваем размер шрифта для мобильных */
}

.chat-input button {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(to right, #e94560, #c2185b);
    color: white;
    cursor: pointer;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

footer {
    background-color: #0d0d1a;
    padding: 15px;
    text-align: center;
    font-size: 12px;
    opacity: 0.7;
}

footer p:first-child {
    margin-bottom: 5px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    padding: 15px;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 25px;
    border-radius: 15px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    position: relative;
}

.modal-content h2 {
    margin-bottom: 15px;
    text-align: center;
}

.modal-content p {
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
    opacity: 0.8;
}

.close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #e94560;
}

.input-group {
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background-color: #1a1a2e;
    color: white;
    margin-top: 5px;
    font-size: 16px; /* Увеличиваем размер шрифта для мобильных */
}

.error-message {
    color: #e94560;
    font-size: 12px;
    display: block;
    margin-top: 5px;
    min-height: 18px;
}

#code-error {
    display: block;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(to right, #e94560, #c2185b);
    color: white;
    font-weight: 600;
    cursor: pointer;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    font-size: 16px; /* Увеличиваем размер шрифта для мобильных */
}

.submit-btn:hover {
    -webkit-transform: translateY(-2px);
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(233, 69, 96, 0.3);
}

@media (max-width: 600px) {
    .container {
        height: 95vh;
        border-radius: 10px;
    }
    
    .message {
        max-width: 90%;
    }
    
    .girl-silhouette {
        width: 100px;
        height: 100px;
    }
    
    .girl-silhouette i {
        font-size: 50px;
    }
    
    #start-screen h2 {
        font-size: 20px;
    }
    
    header {
        padding: 15px;
    }
    
    main {
        padding: 15px;
    }
    
    .chat-header {
        padding-bottom: 10px;
    }
    
    .chat-input input {
        padding: 10px 12px;
    }
    
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        padding: 20px;
    }
}

/* Улучшения для мобильной навигации */
input, button, textarea, select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input:focus, textarea:focus, select:focus {
    outline: none;
}

/* Улучшения для iOS */
@supports (-webkit-touch-callout: none) {
    .container {
        height: -webkit-fill-available;
    }
}

.success-message {
    color: #4caf50;
    text-align: center;
    padding: 10px;
    margin-bottom: 15px;
    background-color: rgba(76, 175, 80, 0.1);
    border-radius: 5px;
}