/* ===== Mobile First: базовые стили — для телефона ===== */
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
    -webkit-tap-highlight-color: transparent;
}
html, body{
    width: 100%;
}
body{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;
    padding: 12px;
    background: linear-gradient(135deg, #ffe6f0, #fff5f8);
    overflow-x: hidden;
}
button{
    touch-action: manipulation; /* убирает задержку/зум по двойному тапу */
}

.window{
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 800px;
    border-radius: 24px;
    box-shadow: 0px 1px 1px 2px #bfbfbf;
    background-color: #fff;
    padding: 22px 14px;
    animation: appear 0.4s ease;
}
.window.active{
    display: flex;
}
@keyframes appear{
    from{ opacity: 0; transform: scale(0.9); }
    to{ opacity: 1; transform: scale(1); }
}

.image-window{
    display: flex;
    justify-content: center;
    align-items: center;
}
.image-window img{
    width: min(48vw, 190px);
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: cover;
    border-radius: 20px;
}

.text-window{
    text-align: center;
    padding: 0 6px;
    font-weight: bold;
}
.text-window h1{
    font-size: clamp(1.3rem, 6vw, 2.2rem);
}
.text-window .hint{
    font-size: clamp(0.85rem, 3.5vw, 1rem);
    font-weight: normal;
    color: #999;
    margin-top: 8px;
}
.text-window .summary{
    font-size: clamp(0.9rem, 4vw, 1.2rem);
    font-weight: normal;
    color: #e0559a;
    margin-top: 12px;
    line-height: 1.5;
}

.button-window{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    width: 100%;
}
.btn{
    padding: 0.8em 1.6em;
    cursor: pointer;
    font-size: clamp(1.15rem, 5vw, 2rem);
    font-weight: bold;
    border-radius: 40px;
    border: none;
    transition: transform 0.3s ease;
}

.btn-yes{
    background-color: rgb(25, 224, 25);
}
.btn-yes:hover{
    background-color: rgb(13, 187, 13);
}

.btn-no{
    background-color: rgb(233, 70, 70);
}
.btn-no:hover{
    background-color: rgb(214, 25, 25);
}
.btn-no.escaping{
    position: fixed;
    z-index: 100;
    transition: left 0.15s ease, top 0.15s ease;
}
.btn-no.flipped{
    animation: flip 0.5s ease;
    background-color: rgb(25, 224, 25);
}
@keyframes flip{
    from{ transform: rotateY(0deg); }
    to{ transform: rotateY(360deg); }
}

/* ===== Окно хотелок: сетка 2 колонки ===== */
.menu-window-grid{
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 500px;
}
.menu-item{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px;
    border: 3px solid transparent;
    border-radius: 18px;
    background-color: #f7f7f7;
    cursor: pointer;
    font-size: clamp(0.95rem, 4vw, 1.15rem);
    font-weight: bold;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.menu-item img{
    width: 100%;
    max-width: 140px;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: cover;
    border-radius: 14px;
}
.menu-item:hover{
    transform: scale(1.05);
}
.menu-item.selected{
    border-color: rgb(25, 224, 25);
    background-color: #e8ffe8;
}
.menu-item.selected span::after{
    content: " ✅";
}

/* ===== Окно даты и времени: билет на свидание ===== */
.date-window .image-window img{
    width: min(38vw, 150px); /* билет — главный герой окна, стикер поменьше */
}

.ticket{
    width: 100%;
    max-width: 440px;
    background-color: #fff0f6;
    border: 2px solid #f7c9de;
    border-radius: 22px;
    overflow: hidden;
}
.ticket-header{
    padding: 12px 16px 0;
    text-align: center;
}
.ticket-eyebrow{
    display: inline-block;
    font-size: clamp(0.7rem, 3vw, 0.8rem);
    font-weight: bold;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #e0559a;
}
.ticket-body{
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px 16px;
}

.chip-row{
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}
.chip{
    padding: 8px 14px;
    font-size: clamp(0.85rem, 3.6vw, 0.95rem);
    font-weight: bold;
    color: #b03d78;
    background-color: #fff;
    border: 2px solid #f3b8d2;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.chip:hover{
    transform: scale(1.06);
}
.chip:focus-visible{
    outline: 3px solid #e0559a;
    outline-offset: 2px;
}
.chip.selected{
    border-color: #e0559a;
    background-color: #e0559a;
    color: #fff;
}

.datetime-fields{
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.datetime-field{
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-weight: bold;
    color: #b03d78;
    font-size: clamp(0.8rem, 3.4vw, 0.9rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.datetime-field input{
    width: 100%;
    padding: 12px 14px;
    font-size: 1.05rem;
    font-weight: bold;
    color: #4a2338;
    border: 2px solid #f3b8d2;
    border-radius: 14px;
    background-color: #fff;
    appearance: none;
    -webkit-appearance: none;
}
.datetime-field input:focus{
    outline: none;
    border-color: #e0559a;
    box-shadow: 0 0 0 3px #f7c9de;
}

/* отрывная линия с вырезами по краям (вырезы — цвета белой карточки окна) */
.ticket-tear{
    position: relative;
    border-top: 3px dashed #f3b8d2;
    margin: 0 10px;
}
.ticket-tear::before,
.ticket-tear::after{
    content: "";
    position: absolute;
    top: -12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #fff;
    border: 2px solid #f7c9de;
}
.ticket-tear::before{ left: -24px; }
.ticket-tear::after{ right: -24px; }

.ticket-stub{
    padding: 14px 16px;
    text-align: center;
    font-weight: bold;
    font-size: clamp(0.95rem, 4vw, 1.15rem);
    color: #e0559a;
}
.ticket-stub .ready{
    animation: pop 0.3s ease;
}
@keyframes pop{
    from{ transform: scale(0.85); }
    to{ transform: scale(1); }
}

/* ===== Окно места: сетка 2x2 ===== */
.place-window-grid{
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 500px;
}
.place-item{
    padding: 16px 10px;
    border: 3px solid transparent;
    border-radius: 18px;
    background-color: #f7f7f7;
    cursor: pointer;
    font-size: clamp(0.95rem, 4vw, 1.2rem);
    font-weight: bold;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.place-item:hover{
    transform: scale(1.05);
}
.place-item.selected{
    border-color: rgb(25, 224, 25);
    background-color: #e8ffe8;
}

/* ===== Дрожание, если ничего не выбрано ===== */
.shake{
    animation: shake 0.4s ease;
}
@keyframes shake{
    0%, 100%{ transform: translateX(0); }
    25%{ transform: translateX(-10px); }
    75%{ transform: translateX(10px); }
}

/* ===== Летающие сердечки на финале ===== */
.heart{
    position: fixed;
    bottom: -50px;
    font-size: 2em;
    animation: fly 4s linear forwards;
    pointer-events: none;
    z-index: 200;
}
@keyframes fly{
    to{
        transform: translateY(-110vh) rotate(360deg);
        opacity: 0;
    }
}

/* ===== Планшет и больше ===== */
@media (min-width: 600px){
    body{
        padding: 20px;
    }
    .window{
        min-height: 0;
        height: 700px;
        max-height: 92vh;
        justify-content: space-around;
        gap: 0;
        border-radius: 40px;
        padding: 24px;
    }
    .image-window img{
        width: 300px;
    }
    .menu-window-grid,
    .place-window-grid{
        gap: 20px;
    }
    .datetime-fields{
        flex-direction: row;
    }
    .datetime-field{
        flex: 1;
    }
    .date-window{
        height: auto;
        min-height: 700px;
        max-height: none;
        gap: 14px;
    }
}

/* ===== Уважение к reduced motion ===== */
@media (prefers-reduced-motion: reduce){
    *, *::before, *::after{
        animation: none !important;
        transition: none !important;
    }
}
