/* Сброс и базовые настройки */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Unbounded', sans-serif;
    background: linear-gradient(145deg, #fce4e4 0%, #ffe9e9 40%, #fdd9d9 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* Основной враппер (весь сайт) */
.rmUI-body {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 5;
}

/* ===== ХЕДЕР ===== */
.rmUI-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 2px dashed rgba(220, 90, 90, 0.3);
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.rmUI-logo {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 2px;
    background: #0099ff;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 10px rgba(255, 120, 120, 0.2);
    position: relative;
}

.rmUI-logo::after {
    font-size: 1.8rem;
    margin-left: 8px;
    background: none;
    -webkit-text-fill-color: #0099ff;
    opacity: 0.8;
}

.rmUI-header-hearts {
    font-size: 2rem;
    animation: pulseHearts 1.8s infinite ease-in-out;
}

.rmUI-header-hearts span {
    display: inline-block;
    margin: 0 5px;
    transform: scale(1);
    transition: transform 0.2s;
}

.rmUI-header-hearts span:hover {
    transform: scale(1.3);
    color: #0099ff;
}

/* ===== ПАРЯЩИЕ СЕРДЕЧКИ (фон) ===== */
.rmUI-floating-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    cursor: pointer;
}

.rmUI-floating-hearts::before,
.rmUI-floating-hearts::after {
    content: "❤ ❤ ❤ ❤ ❤ ❤ ❤ ❤ ❤ ❤";
    position: absolute;
    font-size: 24px;
    color: rgba(255, 120, 120, 0.15);
    white-space: nowrap;
    animation: floatHearts 25s linear infinite;
    width: 200%;
    left: -50%;
    cursor: pointer;
}

.rmUI-floating-hearts::after {
    top: 300px;
    font-size: 40px;
    color: rgba(210, 90, 110, 0.1);
    animation-duration: 30s;
    animation-direction: reverse;
    content: "❤ ❤ ❤ ❤ ❤ ❤ ❤ ❤";
    cursor: pointer;
}

/* Анимация плавающих сердечек */
@keyframes floatHearts {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-600px) rotate(10deg); }
}

@keyframes pulseHearts {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* ===== ОСНОВНОЙ БЛОК ===== */
.rmUI-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
}

/* Обертка конверта */
.rmUI-envelope-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 700px;
    margin: 20px auto;
    position: relative;
}

/* ===== КОНВЕРТ ===== */
.rmUI-envelope {
    width: 340px;
    height: 240px;
    background-color: #f8d7d7;
    border: 2px solid #e6b3b3;
    border-radius: 12px 12px 8px 8px;
    position: relative;
    cursor: pointer;
    box-shadow: 0 15px 25px rgba(150, 60, 60, 0.25);
    transition: box-shadow 0.3s, transform 0.2s;
    margin-bottom: 30px;
    z-index: 20;
}

.rmUI-envelope:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 30px rgba(170, 70, 70, 0.35);
}

/* Клапан конверта (треугольник) */
.rmUI-envelope-flap {
    position: absolute;
    left: 0;
    width: 100%;
    height: 80px;
    background: #f3c5c5;
    clip-path: polygon(0% 0%, 50% 70%, 100% 0%);
    border-top: 2px solid #daa0a0;
    border-left: 2px solid #daa0a0;
    border-right: 2px solid #daa0a0;
    border-radius: 8px 8px 0 0;
    transition: all 0.5s ease;
    transform-origin: top;
    z-index: 25;
}

/* Открытый клапан (когда конверт открыт) */
.rmUI-envelope-flap.open {
    transform: rotateX(180deg);
    opacity: 0.7;
    z-index: 5;
}

/* Тело конверта (нижняя часть) */
.rmUI-envelope-body {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Сердечко-застежка */
.rmUI-heart-seal {
    font-size: 4rem;
    color: #d43f3f;
    cursor: pointer;
    text-shadow: 0 4px 8px rgba(190, 40, 40, 0.4);
    transition: all 0.3s;
    animation: heartbeat 1.4s infinite ease-in-out;
    z-index: 30;
    line-height: 1;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.15); }
    35% { transform: scale(1.05); }
    45% { transform: scale(1.1); }
    55% { transform: scale(1); }
}

/* Текст "Для тебя" на конверте (появляется после первого клика) */
.rmUI-envelope-message {
    position: absolute;
    bottom: 25px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 500;
    color: #a14343;
    letter-spacing: 2px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    z-index: 30;
    text-shadow: 0 2px 5px rgba(255, 200, 200, 0.8);
}

.rmUI-envelope-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* ===== КОНТЕЙНЕР ПИСЬМА (растягивается) ===== */
.rmUI-letter-container {
    width: 340px;
    max-height: 0;
    overflow: hidden;
    background: #fff9f0;
    border-radius: 16px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: max-height 1.2s cubic-bezier(0.4, 0, 0.2, 1), width 0.8s, padding 0.4s;
    margin-top: -20px;
    z-index: 15;
    position: relative;
    opacity: 0.95;
    border: 2px solid #f3cfcf;
}

.rmUI-letter-container.expanded {
    max-height: 380px;
    width: 1000px;
    padding: 20px 25px;
    overflow-y: auto;
}

/* Бумажка внутри */
.rmUI-letter-paper {
    background: #fff2e6;
    padding: 30px 25px;
    border-radius: 12px;
    font-family: 'Unbounded', 'Segoe UI', monospace;
    font-size: 1.4rem;
    line-height: 1.2;
    color: #3e2a2a;
    min-height: 240px;
    box-shadow: inset 0 0 20px #ffe2d4;
    border: 1px dashed #dbb;
    position: relative;
    word-break: break-word;
}

/* Анимация печатного текста */
.rmUI-typed-text {
    display: inline;
    font-weight: 500;
}

.rmUI-cursor {
    display: inline;
    font-size: 1.8rem;
    color: #b34e4e;
    animation: blinkCursor 0.8s infinite;
    margin-left: 3px;
    font-weight: 300;
}

@keyframes blinkCursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Подсказка под конвертом */
.rmUI-hint {
    margin-top: 40px;
    font-size: 1.1rem;
    color: #a56262;
    background: rgba(255, 240, 240, 0.7);
    padding: 8px 18px;
    border-radius: 40px;
    backdrop-filter: blur(4px);
    border: 1px solid #fbc1c1;
    transition: opacity 0.5s;
    z-index: 25;
}

.rmUI-hint.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ===== ПОДВАЛ ===== */
.rmUI-footer {
    padding: 25px 0 15px;
    text-align: center;
    color: #5c3434;
    font-style: italic;
    border-top: 1px solid rgba(220, 160, 160, 0.4);
    margin-top: 30px;
    font-size: 0.95rem;
    letter-spacing: 1px;
}

/* Адаптация под мобилки */
@media (max-width: 600px) {
    .rmUI-envelope {
        width: 280px;
        height: 200px;
    }
    .rmUI-heart-seal {
        font-size: 3rem;
    }
    .rmUI-letter-container.expanded {
        width: 90%;
        max-width: 380px;
    }
    .rmUI-logo {
        font-size: 1.6rem;
    }
}