/* ============================================================
   ORBITA · космическое приглашение
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg:          #05070d;
    --bg-2:        #0a0e1a;
    --panel:       rgba(14, 18, 30, 0.72);
    --panel-edge:  rgba(120, 180, 255, 0.18);
    --line:        rgba(140, 180, 230, 0.14);
    --text:        #e8eef8;
    --text-dim:    #9fb0c8;
    --text-soft:   #5f7089;

    --star:        #cfe4ff;
    --star-2:      #8ab6ff;
    --cyan:        #6ee7ff;
    --violet:      #a78bfa;
    --rose:        #fb7185;

    --sans: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', monospace;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: radial-gradient(ellipse at 50% 40%, var(--bg-2) 0%, var(--bg) 70%);
    overflow: hidden;
    position: relative;
}

#stars {
    position: fixed;
    inset: 0;
    z-index: 0;
    display: block;
}

/* ===== Туманности ===== */
.nebula {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 1;
    opacity: 0.55;
    mix-blend-mode: screen;
}
.nebula-1 {
    width: 55vw; height: 55vw;
    top: -15vw; left: -10vw;
    background: radial-gradient(circle, rgba(110, 231, 255, 0.35) 0%, transparent 65%);
    animation: drift1 40s ease-in-out infinite alternate;
}
.nebula-2 {
    width: 60vw; height: 60vw;
    bottom: -20vw; right: -15vw;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.30) 0%, transparent 65%);
    animation: drift2 50s ease-in-out infinite alternate;
}
.nebula-3 {
    width: 40vw; height: 40vw;
    top: 40%; left: 55%;
    background: radial-gradient(circle, rgba(251, 113, 133, 0.18) 0%, transparent 65%);
    animation: drift3 60s ease-in-out infinite alternate;
}
@keyframes drift1 {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(6vw, 4vw) scale(1.15); }
}
@keyframes drift2 {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-5vw, -4vw) scale(1.1); }
}
@keyframes drift3 {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-4vw, 6vw) scale(1.2); }
}

/* ===== Плавающие эмодзи ===== */
.floaters {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}
.floaters span {
    position: absolute;
    bottom: -80px;
    font-size: 26px;
    line-height: 1;
    opacity: 0;
    filter: drop-shadow(0 0 10px rgba(140, 180, 255, 0.5));
    animation: floatUp linear infinite;
}
@keyframes floatUp {
    0%   { transform: translateY(0) rotate(-5deg); opacity: 0; }
    10%  { opacity: 0.85; }
    90%  { opacity: 0.85; }
    100% { transform: translateY(-110vh) rotate(15deg); opacity: 0; }
}

/* ===== Экраны ===== */
.screen {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 5;
    animation: fadeIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: auto;
}
.screen.active { display: flex; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   ЭКРАН 1 — ОРБИТА
   ============================================================ */
.orbit-stage {
    position: relative;
    width: min(720px, 92vw);
    height: min(720px, 92vh);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto;
}

.orbit {
    position: absolute;
    inset: 0;
    animation: orbit-spin 60s linear infinite;
}
@keyframes orbit-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.orbit-photo {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    margin: -60px 0 0 -60px;
    transform: rotate(var(--a)) translateX(var(--r)) rotate(calc(-1 * var(--a)));
}

.orbit-photo.p1 { --a:   0deg; --r: 250px; }
.orbit-photo.p2 { --a:  60deg; --r: 250px; }
.orbit-photo.p3 { --a: 120deg; --r: 250px; }
.orbit-photo.p4 { --a: 180deg; --r: 250px; }
.orbit-photo.p5 { --a: 240deg; --r: 250px; }
.orbit-photo.p6 { --a: 300deg; --r: 250px; }

.ph {
    width: 100%;
    height: 100%;
    border-radius: 18px;
    background-image: var(--img);
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(190, 215, 255, 0.25);
    box-shadow:
        0 0 0 4px rgba(10, 14, 26, 0.6),
        0 10px 30px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(110, 231, 255, 0.15);
    animation: photo-counter 60s linear infinite;
}
@keyframes photo-counter {
    0%, 100% { transform: rotate(0deg); }
    25%      { transform: rotate(4deg); }
    75%      { transform: rotate(-4deg); }
}

.core {
    position: relative;
    width: min(380px, 82vw);
    padding: 40px 28px 32px;
    border-radius: 24px;
    text-align: center;
    background: rgba(10, 14, 26, 0.7);
    border: 1px solid rgba(140, 180, 230, 0.22);
    box-shadow:
        0 0 0 1px rgba(110, 231, 255, 0.06) inset,
        0 30px 80px rgba(0, 0, 0, 0.7),
        0 0 100px rgba(110, 231, 255, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 3;
}

.core-glow {
    position: absolute;
    inset: -1px;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(135deg,
        rgba(110, 231, 255, 0.6),
        rgba(167, 139, 250, 0.4) 40%,
        transparent 60%,
        rgba(251, 113, 133, 0.5));
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
    opacity: 0.8;
}

h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.2;
    margin-bottom: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #b8c8e0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
h2 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.2px;
    margin-bottom: 22px;
    color: var(--text);
}
.name {
    background: linear-gradient(90deg, #6ee7ff 0%, #a78bfa 60%, #fb7185 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
}
.question {
    font-size: 15px;
    color: var(--text-dim);
    margin-bottom: 26px;
    line-height: 1.55;
}

/* ===== Кнопки ===== */
.buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    min-height: 52px;
}
.buttons-row {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
}
.btn {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    border-radius: 12px;
    padding: 13px 28px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    border: 1px solid transparent;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}
.btn-yes {
    color: #061019;
    background: linear-gradient(135deg, #6ee7ff 0%, #a78bfa 100%);
    box-shadow:
        0 6px 20px rgba(110, 231, 255, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}
.btn-yes:hover {
    transform: translateY(-2px);
    box-shadow:
        0 10px 28px rgba(110, 231, 255, 0.5),
        0 0 40px rgba(167, 139, 250, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.25) inset;
}
.btn-yes:active { transform: translateY(0); }

.btn-no {
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
}
.btn-no:hover {
    color: var(--rose);
    border-color: rgba(251, 113, 133, 0.4);
    background: rgba(251, 113, 133, 0.06);
}
.btn-back {
    color: var(--text-dim);
    background: transparent;
    border: 1px solid var(--line);
    padding: 11px 20px;
    font-size: 13px;
}
.btn-back:hover {
    color: var(--cyan);
    border-color: rgba(110, 231, 255, 0.4);
    background: rgba(110, 231, 255, 0.06);
}

.hint {
    margin-top: 16px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-soft);
    min-height: 16px;
}
.hint:not(:empty) { color: var(--cyan); }

/* ============================================================
   ПАНЕЛИ
   ============================================================ */
.panel {
    width: min(460px, 92vw);
    padding: 30px 28px 28px;
    border-radius: 20px;
    background: var(--panel);
    border: 1px solid var(--panel-edge);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.7),
        0 0 80px rgba(110, 231, 255, 0.05);
    position: relative;
    text-align: left;
}
.panel-label {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 1.5px;
    color: var(--cyan);
    text-transform: lowercase;
    margin-bottom: 12px;
    opacity: 0.85;
}

.field {
    display: block;
    margin-bottom: 16px;
}
.field span {
    display: block;
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text-soft);
    margin-bottom: 6px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.field input,
.field textarea {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--sans);
    font-size: 14px;
    color: var(--text);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
    transition: all 0.2s ease;
    resize: vertical;
}
.field input:focus,
.field textarea:focus {
    border-color: rgba(110, 231, 255, 0.5);
    background: rgba(0, 0, 0, 0.55);
    box-shadow:
        0 0 0 3px rgba(110, 231, 255, 0.12),
        0 0 20px rgba(110, 231, 255, 0.15);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-soft); }
.field input[type="date"],
.field input[type="time"] { color-scheme: dark; }
.field-textarea textarea {
    min-height: 120px;
    line-height: 1.55;
}

/* ============================================================
   ЭКРАН 3 — КОЛЛАЖ
   ============================================================ */
.collage {
    position: fixed;
    inset: 0;
    z-index: 3;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}
.collage.visible { opacity: 1; }

.collage-grid {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 4px;
    filter: saturate(1.05) contrast(1.02) brightness(0.85);
    animation: slowzoom 30s ease-in-out infinite alternate;
}
@keyframes slowzoom {
    from { transform: scale(1); }
    to   { transform: scale(1.05); }
}
.cg {
    background-image: var(--img);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.collage-veil {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 50%,
            transparent 30%,
            rgba(5, 7, 13, 0.55) 75%,
            rgba(5, 7, 13, 0.9) 100%);
    pointer-events: none;
}

.panel-glass {
    background: rgba(10, 14, 26, 0.78);
    border-color: rgba(140, 180, 230, 0.28);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.85),
        0 0 0 1px rgba(110, 231, 255, 0.08) inset,
        0 0 120px rgba(110, 231, 255, 0.1);
}

.activities {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.activity {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 14px;
    font-family: var(--sans);
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    text-align: left;
    position: relative;
    overflow: hidden;
}
.activity::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--cyan), var(--violet));
    opacity: 0.4;
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
}
.activity:hover {
    transform: translateY(-2px);
    border-color: rgba(110, 231, 255, 0.5);
    background: rgba(110, 231, 255, 0.06);
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(110, 231, 255, 0.2);
}
.activity:hover::before {
    opacity: 1;
    box-shadow: 0 0 14px var(--cyan);
}
.act-icon { font-size: 24px; line-height: 1; }
.act-text { display: flex; flex-direction: column; }
.act-text b { font-size: 14px; font-weight: 600; }
.act-text i {
    font-style: normal;
    font-size: 11px;
    color: var(--text-soft);
    margin-top: 2px;
}

/* ============================================================
   ЭКРАН 5 — ФИНАЛ
   ============================================================ */
.panel-final {
    text-align: center;
    overflow: hidden;
}
.constellation {
    position: relative;
    height: 120px;
    margin-bottom: 8px;
    border-radius: 14px;
    background:
        radial-gradient(circle at 30% 40%, rgba(110, 231, 255, 0.08), transparent 40%),
        radial-gradient(circle at 70% 60%, rgba(167, 139, 250, 0.08), transparent 40%),
        rgba(0, 0, 0, 0.3);
    border: 1px solid var(--line);
    overflow: hidden;
}
.constellation::before,
.constellation::after {
    content: '';
    position: absolute;
    width: 3px; height: 3px;
    border-radius: 50%;
    background: var(--star);
    box-shadow:
        80px 30px 0 0 var(--star-2),
        160px 70px 0 0 var(--star),
        240px 20px 0 0 var(--star-2),
        320px 55px 0 0 var(--star),
        60px 80px 0 0 var(--star-2),
        200px 90px 0 0 var(--star),
        280px 40px 0 0 var(--star-2),
        360px 80px 0 0 var(--star),
        130px 15px 0 0 var(--star-2),
        300px 95px 0 0 var(--star);
    animation: twinkle 3s ease-in-out infinite alternate;
}
.constellation::before { top: 10px; left: 20px; }
.constellation::after  {
    top: 20px; left: 40px;
    opacity: 0.7;
    animation-delay: 1.5s;
}
@keyframes twinkle {
    from { opacity: 0.4; }
    to   { opacity: 1; }
}

.final-title {
    font-size: 26px;
    text-align: center;
    margin-bottom: 18px;
}
.final-meta {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}
.meta-item {
    padding: 12px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    text-align: left;
}
.meta-key {
    display: block;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 1.5px;
    color: var(--cyan);
    margin-bottom: 4px;
}
.meta-val {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wish-box {
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(110, 231, 255, 0.04);
    border: 1px solid rgba(110, 231, 255, 0.16);
    text-align: left;
    margin-bottom: 12px;
}
.wish-label {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--cyan);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.wish-text {
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    padding-left: 10px;
    border-left: 2px solid var(--violet);
}
.small {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-soft);
    text-align: center;
}

.burst-heart {
    position: fixed;
    pointer-events: none;
    z-index: 999;
    font-size: 28px;
    line-height: 1;
    filter: drop-shadow(0 0 10px rgba(110, 231, 255, 0.7));
    animation: burstUp 2.5s ease-out forwards;
}
@keyframes burstUp {
    0%   { transform: translateY(0) scale(0.4) rotate(-15deg); opacity: 0; }
    20%  { opacity: 1; transform: translateY(-80px) scale(1.15); }
    100% { transform: translateY(-70vh) scale(0.9) rotate(25deg); opacity: 0; }
}

/* ============================================================
   Мобильная адаптация
   ============================================================ */
@media (max-width: 640px) {
    .orbit-stage {
        width: 100vw;
        height: 100vh;
    }
    .orbit-photo {
        width: 70px;
        height: 70px;
        margin: -35px 0 0 -35px;
    }
    .orbit-photo.p1 { --r: 160px; }
    .orbit-photo.p2 { --r: 160px; }
    .orbit-photo.p3 { --r: 160px; }
    .orbit-photo.p4 { --r: 160px; }
    .orbit-photo.p5 { --r: 160px; }
    .orbit-photo.p6 { --r: 160px; }

    .core { padding: 30px 22px 26px; border-radius: 20px; }
    h1 { font-size: 22px; }
    h2 { font-size: 17px; }
    .question { font-size: 14px; }

    .panel { padding: 24px 20px 22px; }

    .btn {
        padding: 12px 22px;
        font-size: 13px;
    }
    .btn-back { padding: 10px 14px; font-size: 12px; }

    .activities { grid-template-columns: 1fr; }

    .final-title { font-size: 22px; }
    .final-meta { grid-template-columns: 1fr; }
    .meta-item { padding: 10px 12px; }

    .floaters span { font-size: 20px; }
}

@media (max-height: 700px) {
    .orbit-photo {
        width: 90px;
        height: 90px;
        margin: -45px 0 0 -45px;
    }
    .orbit-photo.p1 { --r: 200px; }
    .orbit-photo.p2 { --r: 200px; }
    .orbit-photo.p3 { --r: 200px; }
    .orbit-photo.p4 { --r: 200px; }
    .orbit-photo.p5 { --r: 200px; }
    .orbit-photo.p6 { --r: 200px; }
}
