:root {
    --coral: #d97b73;
    --red: #e23b4e;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background: #fdf1ea;
    font-family: 'VT323', monospace;
    overflow: hidden;
    overflow-x: hidden;
}

h1 {
    font-family: 'Press Start 2P', monospace;
    font-size: 20px;
    line-height: 1.6;
    color: var(--red);
    text-align: center;
    margin-bottom: 6px;
}

p {
    font-family: 'Press Start 2P', monospace;
    font-size: 11px;
    line-height: 1.8;
    color: #d9a5ab;
    margin-top: 12px;
    letter-spacing: 0.5px;
}

.screen {
    display: none;
    width: 100%;
    min-height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    text-align: center;
}
.screen.active { display: flex; }

/* Тоглоомын талбай */
.game-area {
    width: 100%;
    max-width: 380px;
    min-height: 440px;
    margin-top: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0 20px;
}

/* Ард hovдог зүрхнүүд */
.hearts-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.floating-heart {
    position: absolute;
    bottom: -20px;
    opacity: 0.75;
    animation: floatUp linear forwards;
}
@keyframes floatUp {
    from { transform: translateY(0) translateX(0); opacity: 0.75; }
    to   { transform: translateY(-420px) translateX(var(--drift)); opacity: 0; }
}

.envelope {
    width: 190px;
    height: 130px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 6px 4px rgba(0,0,0,0.15));
}
.envelope-back {
    position: absolute;
    inset: 0;
    background: #fdf1ea;
    border: 3px solid var(--coral);
}
.envelope-flap {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 68%;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    background: #f2b8c6;
    border-top: 3px solid var(--coral);
}
.envelope-flap::before {
    content: "";
    position: absolute;
    inset: 0;
    clip-path: polygon(0 0, 50% 100%, 0 100%);
    border-left: 3px solid var(--coral);
}
.envelope-flap::after {
    content: "";
    position: absolute;
    inset: 0;
    clip-path: polygon(100% 0, 100% 100%, 50% 100%);
    border-right: 3px solid var(--coral);
}
.envelope-heart {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 55px;
    color: var(--red);
    z-index: 2;
}
.envelope.hit { animation: pop 0.4s ease; }
@keyframes pop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.arrow-head {
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 16px solid var(--red);
}
.arrow-shaft {
    width: 4px;
    height: 40px;
    background: #c9926a;
}
.arrow-fletch {
    width: 20px;
    height: 10px;
    margin-top: -2px;
    background: var(--coral);
    clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%);
}

.knob-fixed {
    width: 34px;
    height: 18px;
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    pointer-events: none;
}
.knob-fixed::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #6b4a34 0%, #3d2b1f 100%);
    border-radius: 8px;
    clip-path: polygon(
        15% 0%, 85% 0%,
        100% 15%, 100% 85%,
        85% 100%, 15% 100%,
        0% 85%, 0% 15%
    );
    box-shadow: 0 3px 4px rgba(0,0,0,0.25);
}

.drag-handle {
    width: 34px;
    height: 30px;
    background: transparent;
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    cursor: grab;
    touch-action: none;
    transition: top 0.25s ease;
    z-index: 3;
}
.drag-handle.dragging { transition: none; cursor: grabbing; }
.arrow {
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    transition: transform 0.6s ease-in, opacity 0.6s ease-in;
}
.arrow.fly {
    transform: translate(-50%, -260px);
    opacity: 0;
}

.bow-slider {
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 1;
}
.bow {
    width: 240px;
    height: 100px;
    position: relative;
}
.bow-shape {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.slider-knob {
    width: 44px;
    height: 28px;
    border-radius: 50%;
    background: #3d2b1f;
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    cursor: grab;
    touch-action: none;
    transition: top 0.25s ease;
    z-index: 2;
}
.slider-knob.dragging { transition: none; cursor: grabbing; }

.hint {
    font-family: 'Press Start 2P', monospace;
    font-size: 11px;
    line-height: 1.8;
    color: #d9a5ab;
    margin-top: 12px;
    letter-spacing: 0.5px;
}

/* screen2 */

.love-window {
    width: 320px;
    max-width: 92vw;
    background: #fff;
    border: 4px solid var(--coral);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.window-titlebar {
    background: var(--coral);
    color: #fff;
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.window-controls { display: flex; gap: 6px; }
.win-btn {
    width: 20px; height: 20px;
    background: #fff;
    color: var(--coral);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.window-heartbar {
    background: #f9d2da;
    text-align: center;
    padding: 6px;
    color: var(--red);
    letter-spacing: 6px;
}
.window-body {
    background:
        repeating-conic-gradient(#fbdde3 0% 25%, #f6c6d0 0% 50%) 50% / 20px 20px;
    padding: 24px 10px 30px;
    text-align: center;
}
.love-question {
    font-family: 'Press Start 2P', monospace;
    font-size: 13px;
    color: var(--red);
    line-height: 1.8;
    margin-bottom: 10px;
}

.pixel-cat-svg {
    width: 220px;
    height: auto;
    max-width: 100%;
}

/* Товчнууд */
.btn-row {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    height: 56px;
}
.btn-no, .btn-yes {
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    padding: 12px 20px;
    border: 3px dashed var(--coral);
    background: #fff;
    color: var(--red);
    border-radius: 6px;
    cursor: pointer;
    position: relative;
}
.btn-yes { border-style: solid; }
#yesBtn {
    transition: left 0.15s ease, top 0.15s ease;
}

/* screen3 */

.lego-scene {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto;
}
.lego-heart-svg {
    width: 100px;
    height: 100px;
    display: block;
}

.day-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 24px;
}
.day-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
    line-height: 1.6;
    padding: 12px 4px;
    border: 2px solid var(--coral);
    background: #fff;
    color: var(--red);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.day-btn span { font-size: 10px; color: #d9a5ab; }
.day-btn.selected { background: var(--coral); color: #fff; }
.day-btn.selected span { color: #fff; }

/* toast */
.toast {
    position: fixed;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%) translateY(20px);
    background: #2b2b2b;
    color: #fff;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 20;
    text-align: center;
    max-width: 260px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.time-section {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.3s ease, margin-top 0.35s ease;
    margin-top: 0;
}
.time-section.show {
    max-height: 300px;
    opacity: 1;
    margin-top: 20px;
}
.time-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: #d9a5ab;
    margin-bottom: 12px;
}
.time-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.time-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    padding: 10px 4px;
    border: 2px solid var(--coral);
    background: #fff;
    color: var(--red);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.time-btn .time-name { font-size: 8px; }
.time-btn span:last-child { font-size: 7px; color: #d9a5ab; }
.time-btn.selected { background: var(--coral); color: #fff; }
.time-btn.selected span { color: #fff; }
@media (max-width: 380px) {
    .love-window { max-width: 96vw; }
    .window-body { padding: 20px 6px 24px; }

    .day-btn {
        font-size: 8px;
        padding: 10px 2px;
    }
    .day-btn span { font-size: 7px; }

    .time-btn {
        font-size: 7px;
        padding: 8px 2px;
        gap: 2px;
    }
    .time-btn .time-name { font-size: 7px; }
    .time-btn span:last-child { font-size: 6px; }

    .love-question { font-size: 11px; }
    .lego-scene { width: 110px; height: 110px; }
}

/* screen4*/

.place-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 24px;
}
.place-btn {
    font-family: 'Press Start 2P', monospace;
    padding: 16px 8px;
    border: 2px solid var(--coral);
    background: #fff;
    color: var(--red);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}
.place-icon {
    width: 26px;
    height: 26px;
    color: var(--red);
}
.place-btn.selected .place-icon {
    color: #fff;
}
.place-name { font-size: 10px; }
.place-sub { font-size: 7px; color: #d9a5ab; line-height: 1.4; }
.place-btn.selected { background: var(--coral); }
.place-btn.selected .place-name { color: #fff; }
.place-btn.selected .place-sub { color: #fce8ea; }
.place-icon-big {
    width: 100px;
    height: 100px;
}

/* screen5 */

.place-icon-big {
    width: 90px;
    height: 90px;
}

/* screen7 — ticket */
.ticket-card {
    display: flex;
    width: 320px;
    max-width: 92vw;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(0,0,0,0.25);
    margin-top: 16px;
}
.ticket-stub {
    width: 34%;
    background: linear-gradient(180deg, #fbdde3, #f6c6d0);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 8px;
    border-right: 2px dashed var(--coral);
}
.ticket-heart { font-size: 30px; color: var(--red); }
.ticket-admit {
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    color: var(--red);
    text-align: center;
}
.ticket-no { font-family: 'VT323', monospace; font-size: 12px; color: #b5828a; }
.ticket-main {
    flex: 1;
    padding: 16px 14px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ticket-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
    color: var(--coral);
    margin-bottom: 4px;
}
.ticket-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px dashed #f2d9dd;
    padding-bottom: 6px;
}
.ticket-key { font-family: 'Press Start 2P', monospace; font-size: 7px; color: #d9a5ab; align-self: center; }
.ticket-val { font-family: 'VT323', monospace; font-size: 16px; color: #3d2b1f; text-align: right; }

.countdown-label { font-family: 'Press Start 2P', monospace; font-size: 9px; color: #d9a5ab; margin-top: 24px; }
.countdown { font-family: 'Press Start 2P', monospace; font-size: 16px; color: var(--red); margin-top: 8px; }

.ticket-actions { display: flex; gap: 12px; margin-top: 24px; }
.btn-calendar {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    padding: 12px 18px;
    border: none;
    background: var(--coral);
    color: #fff;
    border-radius: 24px;
    cursor: pointer;
}
.btn-share {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    padding: 12px 18px;
    border: 2px solid var(--coral);
    background: transparent;
    color: var(--red);
    border-radius: 24px;
    cursor: pointer;
}