:root {
    --bg-deep: #090909;
    --card-bg: #111111;
    --gold: #c9a45d;
    --gold-dark: #8e6c34;
    --gold-mid: #a68142;
    --text-primary: #e7d9b5;
    --text-secondary: #b8a88a;
    --text-muted: #7a6e5a;
    --border-subtle: #1f1f1f;
    --status-free: #5a9e6f;
    --status-booked: #c45b5b;
    --transition-smooth: 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: "Playfair Display", "Georgia", "Times New Roman", serif;
    font-weight: 400;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 24px 16px 60px;
    position: relative;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Фоновые слои */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-noise {
    position: absolute;
    inset: 0;
    opacity: 0.035;
    background: repeating-conic-gradient(#fff 0 0.0001%, transparent 0 0.0002%) 0 0 / 200px 200px;
    mix-blend-mode: overlay;
    animation: noiseShift 0.15s steps(3) infinite;
}

@keyframes noiseShift {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-1px, 1px); }
    66% { transform: translate(1px, -1px); }
}

.bg-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 35%, rgba(0,0,0,0.75) 78%, #000 100%);
    z-index: 2;
}

.bg-smoke {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.04;
    z-index: 1;
    animation: smokeDrift 28s ease-in-out infinite alternate;
}

.smoke-1 { width: 700px; height: 700px; background: radial-gradient(circle, rgba(201,164,93,0.5) 0%, transparent 70%); top: -15%; left: -10%; animation-duration: 32s; }
.smoke-2 { width: 600px; height: 600px; background: radial-gradient(circle, rgba(180,140,70,0.45) 0%, transparent 70%); bottom: -12%; right: -8%; animation-duration: 36s; animation-delay: -8s; animation-direction: alternate-reverse; }
.smoke-3 { width: 500px; height: 500px; background: radial-gradient(circle, rgba(201,164,93,0.35) 0%, transparent 70%); top: 45%; left: 35%; animation-duration: 40s; animation-delay: -16s; }

@keyframes smokeDrift {
    0% { transform: translate(0,0) scale(1); }
    25% { transform: translate(40px, -30px) scale(1.08); }
    50% { transform: translate(-20px, 25px) scale(0.94); }
    75% { transform: translate(-35px, -15px) scale(1.05); }
    100% { transform: translate(15px, 20px) scale(0.97); }
}

/* Рамка Art Deco */
.frame {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 38px 34px;
    border: 1px solid rgba(201,164,93,0.35);
    background: rgba(9,9,9,0.65);
    backdrop-filter: blur(1px);
    box-shadow: inset 0 0 80px rgba(0,0,0,0.5), 0 0 60px rgba(0,0,0,0.7);
}

.corner { position: absolute; width: 44px; height: 44px; z-index: 5; pointer-events: none; }
.corner-tl { top: 10px; left: 10px; border-top: 2px solid var(--gold); border-left: 2px solid var(--gold); }
.corner-tr { top: 10px; right: 10px; border-top: 2px solid var(--gold); border-right: 2px solid var(--gold); }
.corner-bl { bottom: 10px; left: 10px; border-bottom: 2px solid var(--gold); border-left: 2px solid var(--gold); }
.corner-br { bottom: 10px; right: 10px; border-bottom: 2px solid var(--gold); border-right: 2px solid var(--gold); }
.corner::after { content: ""; position: absolute; width: 16px; height: 16px; border-color: var(--gold-dark); border-style: solid; }
.corner-tl::after { top: 10px; left: 10px; border-width: 1px 0 0 1px; }
.corner-tr::after { top: 10px; right: 10px; border-width: 1px 1px 0 0; }
.corner-bl::after { bottom: 10px; left: 10px; border-width: 0 0 1px 1px; }
.corner-br::after { bottom: 10px; right: 10px; border-width: 0 1px 1px 0; }

.content { position: relative; z-index: 3; }

/* Шапка */
.header { text-align: center; padding: 20px 0 40px; opacity: 0; transform: translateY(24px); animation: fadeInUp 1.1s cubic-bezier(0.25,0.46,0.45,0.94) forwards 0.2s; }
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }

.title { font-family: "Cinzel", serif; font-weight: 600; font-size: clamp(2.6rem, 6vw, 4.2rem); letter-spacing: 0.12em; color: var(--gold); text-shadow: 0 0 60px rgba(201,164,93,0.25), 0 2px 4px rgba(0,0,0,0.8); margin-bottom: 8px; line-height: 1.15; }
.subtitle { font-family: "Cinzel", serif; font-weight: 500; font-size: clamp(1.1rem, 2.2vw, 1.55rem); letter-spacing: 0.22em; color: var(--text-secondary); text-transform: uppercase; margin-bottom: 28px; }
.header-divider { font-size: 1.6rem; color: var(--gold); letter-spacing: 0.4em; margin-bottom: 15px; opacity: 0.8; }
.intro { font-family: "Playfair Display", serif; font-style: italic; font-size: 1.05rem; color: var(--text-secondary); max-width: 620px; margin: 0 auto; line-height: 1.9; }

/* Разделитель между карточками */
.card-divider {
    text-align: center;
    font-size: 1.3rem;
    letter-spacing: 0.05em;
    color: var(--gold);
    opacity: 0.45;
    margin: 48px 0 48px; /* увеличен отступ */
    user-select: none;
}

/* Карточка подарка */
.gift-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    padding: 34px 30px 30px;
    margin-top: 20px;
    margin-bottom: 40px; /* дополнительный отступ */
    transition: all var(--transition-smooth);
    opacity: 0;
    transform: translateY(48px);
    will-change: transform, opacity, box-shadow;
}
.gift-card:last-child { margin-bottom: 0; }

.gift-card.visible { opacity: 1; transform: translateY(0); }
.gift-card:hover {
    transform: translateY(-3px) scale(1.012);
    border-color: rgba(201,164,93,0.45);
    box-shadow: 0 18px 50px rgba(0,0,0,0.6), 0 0 50px rgba(201,164,93,0.08), inset 0 0 30px rgba(201,164,93,0.015);
}

.lot-badge {
    position: absolute;
    top: -16px; left: 26px;
    font-family: "Cinzel", serif;
    font-weight: 600; font-size: 0.8rem; letter-spacing: 0.14em;
    color: #0d0b06;
    background: linear-gradient(160deg, #d4b06a 0%, #8e6c34 30%, #c9a45d 55%, #6b4f28 85%, #b8923e 100%);
    padding: 8px 22px;
    clip-path: polygon(6% 0%, 94% 0%, 100% 50%, 94% 100%, 6% 100%, 0% 50%);
    box-shadow: 0 3px 12px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.25), 0 0 18px rgba(201,164,93,0.3);
    z-index: 4;
}

.card-inner { display: flex; gap: 30px; align-items: flex-start; }
.card-image { flex-shrink: 0; width: 280px; height: 280px; overflow: hidden; border: 1px solid rgba(201,164,93,0.2); background: #0a0a0a; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: filter 0.5s ease, transform 0.5s ease; filter: brightness(0.75) saturate(0.7); }
.gift-card:hover .card-image img { filter: brightness(0.92) saturate(0.9); transform: scale(1.04); }

.card-details { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; width: 100%;}
.gift-name { font-family: "Cinzel", serif; font-weight: 600; font-size: 1.35rem; letter-spacing: 0.06em; color: var(--text-primary); }
.gift-status { display: inline-flex; align-items: center; gap: 9px; font-family: "Cinzel", serif; font-size: 0.82rem; letter-spacing: 0.09em; text-transform: uppercase; font-weight: 500; }
.gift-status .dot { width: 9px; height: 9px; border-radius: 50%; }
.gift-status.free { color: var(--status-free); }
.gift-status.free .dot { background: var(--status-free); box-shadow: 0 0 10px var(--status-free); }
.gift-status.booked { color: var(--status-booked); }
.gift-status.booked .dot { background: var(--status-booked); box-shadow: 0 0 10px var(--status-booked); }

.gift-description { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.gift-link { color: var(--gold); text-decoration: none; font-family: "Cinzel", serif; font-size: 0.8rem; letter-spacing: 0.08em; border-bottom: 1px solid transparent; padding-bottom: 2px; transition: 0.3s; }
.gift-link:hover { color: #e0c87a; border-bottom-color: rgba(201,164,93,0.5); }
.booking {width: 100%; display: flex; align-items: center; justify-content:center ; } 
/* Кнопка — центрирована */
.book-btn {
    display: inline-block;
    align-self: center;
    margin-top: 8px;
    font-family: "Cinzel", serif;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    color: #0d0b06;
    background: linear-gradient(160deg, #d4b06a 0%, #8e6c34 25%, #c9a45d 50%, #6b4f28 80%, #b8923e 100%);
    border: 1px solid rgba(201,164,93,0.6);
    padding: 13px 28px;
    cursor: pointer;
    text-align: center;
    text-transform: uppercase;
    clip-path: polygon(3% 0%, 97% 0%, 100% 50%, 97% 100%, 3% 100%, 0% 50%);
    box-shadow: 0 4px 18px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.2), 0 0 24px rgba(201,164,93,0.2);
    transition: all 0.35s cubic-bezier(0.25,0.46,0.45,0.94);
    position: relative;
    overflow: hidden;
}
.book-btn::after {
    content: "";
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
    transition: left 0.6s ease;
}
.book-btn:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 8px 30px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.3), 0 0 40px rgba(201,164,93,0.45); border-color: var(--gold); }
.book-btn:hover::after { left: 100%; }
.book-btn:active { transform: scale(0.97); transition: transform 0.1s ease; }

.book-btn.unbook {
    background: linear-gradient(160deg, #b8a88a 0%, #7a6e5a 25%, #8e6c34 50%, #5e4a2b 80%, #8a7348 100%);
    border-color: rgba(180,150,100,0.5);
    box-shadow: 0 2px 12px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.15);
    color: #f0e7d2;
}
.book-btn.unbook:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.25), 0 0 30px rgba(201,164,93,0.3); border-color: var(--gold-dark); }

/* Футер */
.footer { text-align: center; padding: 50px 20px 20px; opacity: 0; transform: translateY(20px); animation: fadeInUp 1s ease forwards 1s; }
.footer-divider { font-size: 1.4rem; color: var(--gold); margin-bottom: 20px; opacity: 0.6; }
.footer p { font-family: "Playfair Display", serif; font-style: italic; color: var(--text-secondary); font-size: 1rem; }
.footer-motto { font-family: "Cinzel", serif !important; font-style: normal !important; font-weight: 500; font-size: 0.85rem !important; letter-spacing: 0.14em !important; color: var(--gold-dark) !important; text-transform: uppercase; margin-top: 8px !important; }

/* Модальное окно */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.modal.active { display: flex; }
.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
}
.modal-box {
    position: relative;
    background: #111;
    border: 1px solid rgba(201,164,93,0.4);
    padding: 20px;
    width: 90%;
    max-width: 340px;
    border-radius: 12px;
    text-align: center;
    z-index: 1;
}
.modal-box h3 {
    color: var(--gold);
    margin-bottom: 12px;
    font-family: "Cinzel", serif;
}
.modal-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 14px;
    border: 1px solid #333;
    background: #0a0a0a;
    color: var(--text-primary);
    border-radius: 8px;
    outline: none;
}
.modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.modal-actions button {
    flex: 1;
    padding: 10px;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    font-family: "Cinzel", serif;
}
#modalConfirm { background: var(--gold); color: #000; }
#modalCancel { background: #333; color: #fff; }

/* Адаптивность */
@media (max-width: 768px) {
    body { padding: 12px 10px 40px; align-items: stretch; }
    .frame { padding: 18px 14px; border: none; background: rgba(9,9,9,0.85); box-shadow: none; }
    .header { padding: 10px 0 24px; }
    .subtitle { font-size: 0.9rem; letter-spacing: 0.18em; }
    .title { font-size: 2.2rem; letter-spacing: 0.08em; }
    .intro { font-size: 0.95rem; line-height: 1.6; }

    .gift-card { padding: 18px; border-radius: 14px; margin-bottom: 28px; }
    .card-inner { flex-direction: column; gap: 14px; }
    .card-image { width: 100%; height: 100%; border-radius: 12px; }
    .card-image img { border-radius: 12px; }
    .gift-name { font-size: 1.15rem; }
    .gift-description { font-size: 0.9rem; line-height: 1.5; }
    .gift-status { font-size: 0.75rem; }

    .book-btn {
        align-self: center;
        width: 100%;
        padding: 14px 16px;
        font-size: 0.7rem;
        border-radius: 12px;
        clip-path: none;
    }
    .gift-link { font-size: 0.75rem; }
    .card-divider { margin: 32px 0; font-size: 0.9rem; opacity: 0.3; }
    .bg-smoke, .bg-noise { display: none; }
    .bg-vignette { opacity: 0.6; }
}