html, body {
    /* Отключает pinch-to-zoom и двойной тап для зума */
    touch-action: none;
    /* Дополнительная защита для некоторых браузеров */
    -webkit-text-size-adjust: none;
}
/* Запрещаем зум конкретно на кнопках и инпутах */
input, button {
    touch-action: manipulation;
}
#chat {
    touch-action: pan-y; /* Разрешаем только вертикальный скролл внутри чата */
}

a{
    color: #d0ff00 !important;
    word-break: break-all; /* Чтобы длинные ссылки не ломали бабл */
}

#hello{
    display:flex; 
    justify-content:center; 
    align-items:center; 
    height:100%;
}


#body {
    display: flex;
}

body,
#body {
    margin: 0;
    flex-direction: column;
    font-family: sans-serif;
    height: 100vh;
    height: 100dvh; /* Динамическая высота для мобилок */
    background: #1a1a1a;
    color: #fff;
    overflow: hidden; /* Запрещаем скролл самого body */
}

#shadow {
    position: absolute;
    top: -9999px;
    left: 0;
    visibility: hidden;
    /* Больше ничего не нужно, JS сделает клон #chat */
}

#chat {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Улучшаем плавность скролла на Android */
    -webkit-overflow-scrolling: touch;
}


.controls {
    position: relative;
    display: flex;
    padding: 12px;
    background: #222;
    gap: 10px;
    /* Убираем лишние отступы снизу на iPhone/Android с полосками */
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.info{
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-content: center;
    align-items: center;
    font-size: 11px;
    font-style: italic;
    z-index: 10; /* Чтобы точно был поверх */
}
#typing-status {
    color: #00ffcc;
    margin-left: 15px;
    transition: opacity 0.2s ease-in-out;
}
#online-status {
    color: #888;
    background: rgba(26, 26, 26, 0.8);
    margin-right: 15px;
}



#chat, 
#shadow,
.controls, 
.info {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    width: 100%; /* Чтобы на мобилках растягивался на весь экран */
    box-sizing: border-box;
    border-left:1px solid rgb(50, 50, 50);
    border-right:1px solid rgb(50, 50, 50);
}

/* Опционально: если хочешь, чтобы панель ввода тоже была ограничена, 
   но фон под ней шел на всю ширину, оберни controls в еще один div */
.controls {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: center;
    align-items: center;
    padding: 8px;
}



input {
    flex: 1;
    background: #333;
    border: none;
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px; /* Важно: 16px предотвращает авто-зум в iOS/Android */
    outline: none;
}

/* Баблы делаем чуть шире для узких экранов */
.msg {
    max-width: 85%;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Зеленый бабл для своих */
.msg.my { background: #2e7d32; align-self: flex-end; color: #fff; }
.msg b { color: #00ffcc; margin-right: 5px; }
.msg.my b { color: #afffba; }

.msg .time {
    font-size: 0.7rem;
    color: #888;
    margin-left: 8px;
    font-weight: normal;
}
.msg.my .time {
    color: #afffba;
    opacity: 0.8;
}



#load-more {
    width: 100%;
    background: none;
    border: 1px solid #444;
    color: #888;
    padding: 5px;
    font-size: 11px;
    cursor: pointer;
    border-radius: 5px;
}

#send-btn {
    background: #006aff;
    min-width: 42px; /* Минимальный размер тач-зоны */
    min-height: 42px;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
#exit-btn {
    background: #c62828;
    min-width: 10px; /* Минимальный размер тач-зоны */
    min-height: 10px;
    border-radius: 8px;
    cursor: pointer;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
}
#exit-btn:hover { background: #b71c1c; }

input:disabled { background: #222; cursor: not-allowed; }
#send-btn:disabled { background: #555; cursor: not-allowed; opacity: 0.5; }


