@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&family=Montserrat:wght@300;400;500&display=swap');


/* ========================================
   1. ОСНОВНЫЕ НАСТРОЙКИ
======================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    color: #f4e8d2;
    background-color: #211914;
    background-image:
        linear-gradient(
            rgba(25, 17, 13, 0.68),
            rgba(25, 17, 13, 0.82)
        ),
        url("background.jpg");
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
}

a {
    color: inherit;
}

[hidden] {
    display: none !important;
}

.screen {
    width: 100%;
    min-height: 100vh;
    padding: 45px 20px;
}


/* ========================================
   2. ОБЩИЕ ЭЛЕМЕНТЫ
======================================== */

h1,
h2,
h3 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
}

.eyebrow {
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #b99b72;
}

.ornament {
    width: 90px;
    height: 1px;
    margin: 22px auto;
    background: #b99b72;
    position: relative;
}

.ornament::before,
.ornament::after {
    content: "";
    position: absolute;
    top: -3px;
    width: 7px;
    height: 7px;
    border: 1px solid #b99b72;
    transform: rotate(45deg);
    background: #211914;
}

.ornament::before {
    left: 0;
}

.ornament::after {
    right: 0;
}

.primary-button {
    display: inline-block;
    padding: 14px 30px;
    border: 1px solid #c9aa7b;
    border-radius: 2px;
    background: #b28d5e;
    color: #261b14;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: 0.3s ease;
}

.primary-button:hover {
    background: #d5b98e;
    transform: translateY(-2px);
}

.primary-button:disabled {
    opacity: 0.5;
    transform: none;
}


/* КНОПКА НА ВСТУПИТЕЛЬНОЙ СТРАНИЦЕ */

#openCalendar {
    display: inline-block;
    margin-top: 10px;
    padding: 14px 30px;

    border: 1px solid #c9aa7b;
    border-radius: 2px;

    background: #b28d5e;
    color: #261b14;

    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;

    transition: 0.3s ease;
}

#openCalendar:hover {
    background: #d5b98e;
    transform: translateY(-2px);
}

#openCalendar:active {
    transform: translateY(0);
}


/* ========================================
   3. ПРИВЕТСТВЕННАЯ СТРАНИЦА
======================================== */

.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
}

.letter {
    width: 100%;
    max-width: 600px;
    padding: 55px 45px;
    text-align: center;
    color: #49372a;
    background: rgba(244, 232, 210, 0.96);
    border: 1px solid #cbb58e;
    box-shadow: 0 15px 60px rgba(0, 0, 0, 0.35);
    position: relative;
}

.letter::before {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(150, 116, 77, 0.3);
    pointer-events: none;
}

.letter .eyebrow {
    color: #98754f;
}

.letter h1 {
    font-size: clamp(38px, 7vw, 58px);
    line-height: 1.1;
    margin-top: 20px;
    color: #49372a;
}

.letter p {
    max-width: 420px;
    margin: 0 auto 25px;
    font-size: 13px;
    line-height: 2;
    color: #6b5543;
}

.envelope-icon {
    font-size: 55px;
    margin-bottom: 15px;
}

.letter .ornament {
    background: #a88b65;
}

.letter .ornament::before,
.letter .ornament::after {
    background: #f4e8d2;
    border-color: #a88b65;
}


/* ========================================
   4. СТРАНИЦА КАЛЕНДАРЯ
======================================== */

.calendar-screen {
    max-width: 1050px;
    margin: 0 auto;
}

.calendar-header {
    text-align: center;
    margin: 0 auto 30px;
}

.calendar-header h1,
.calendar-header h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(36px, 6vw, 54px);
    font-weight: 400;
    color: #f4e8d2;
    margin-top: 12px;
}

.calendar-header p {
    font-size: 12px;
    line-height: 1.8;
    color: #d1bda2;
    margin-top: 10px;
}


/* ========================================
   5. ПРОГРЕСС
======================================== */

.progress-container {
    width: 100%;
    max-width: 500px;
    margin: 25px auto 30px;
    text-align: center;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;

    font-size: 11px;
    color: #d8c3a5;
}

#progressCount {
    display: block;
    margin-bottom: 0;
    font-family: 'Cormorant Garamond', serif;
    font-size: 21px;
    color: #e8d4b5;
}

/* В HTML используется именно progress-track */

.progress-track {
    width: 100%;
    height: 5px;
    background: rgba(244, 232, 210, 0.15);
    border-radius: 10px;
    overflow: hidden;
}

#progressFill {
    width: 0;
    height: 100%;
    background: #c4a276;
    transition: width 0.5s ease;
}


/* ========================================
   6. ТАЙМЕР ОБРАТНОГО ОТСЧЁТА
======================================== */

#nextGiftTimer {
    width: 100%;
    max-width: 650px;
    margin: 25px auto 35px;
    padding: 25px 15px;
    text-align: center;
    background: rgba(244, 232, 210, 0.08);
    border: 1px solid rgba(220, 190, 145, 0.35);
    border-radius: 8px;
    color: #f4e8d2;
}

.countdown-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 25px;
    font-weight: 400;
    margin-bottom: 5px;
}

.countdown-date {
    font-family: 'Cormorant Garamond', serif;
    font-size: 19px;
    color: #d8b98b;
    margin-bottom: 18px;
}

.countdown-clock {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    min-width: 55px;
}

.countdown-unit span {
    font-family: 'Cormorant Garamond', serif;
    font-size: 35px;
    font-weight: 400;
    color: #f4e8d2;
}

.countdown-unit small {
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #c4a77e;
}

.countdown-separator {
    font-size: 25px;
    color: #c4a77e;
    padding-bottom: 14px;
}

.countdown-message {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    line-height: 1.8;
    margin-top: 10px;
    color: #d8c3a5;
}


/* ========================================
   7. СЕТКА КАЛЕНДАРЯ
======================================== */

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
}


/* ========================================
   8. КОНВЕРТЫ
======================================== */

.gift-card {
    min-width: 0;
    min-height: 145px;
    padding: 18px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    position: relative;
    overflow: hidden;

    border: 1px solid rgba(220, 190, 145, 0.5);
    border-radius: 4px;

    background:
        linear-gradient(
            145deg,
            rgba(244, 232, 210, 0.98),
            rgba(220, 199, 167, 0.96)
        );

    color: #49372a;
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.2);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        background 0.3s ease;
}

.gift-card::before {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(130, 94, 59, 0.25);
    pointer-events: none;
}

.gift-card.available {
    cursor: pointer;
}

.gift-card.available:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.35);
    background: #fff0d5;
}

.gift-card.locked {
    background: rgba(90, 70, 55, 0.85);
    color: #c8b49a;
    border-color: rgba(200, 170, 130, 0.2);
    opacity: 0.7;
}

.gift-card.opened {
    background: #c4a276;
    color: #332319;
    border-color: #e0c08f;
}

.gift-number {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(15px, 2vw, 21px);
    color: inherit;
    text-align: center;
}

.gift-icon {
    font-size: 27px;
}

.gift-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: inherit;
}


/* ========================================
   9. НИЖНЯЯ ЧАСТЬ КАЛЕНДАРЯ
======================================== */

.calendar-footer {
    text-align: center;
    margin: 40px auto 20px;

    font-family: 'Cormorant Garamond', serif;
    font-size: 19px;
    color: #d6c1a4;
}

.back-button {
    display: inline-block;
    margin-top: 15px;
    padding: 11px 24px;
    border: 1px solid rgba(210, 180, 140, 0.55);
    background: transparent;
    color: #e8d4b5;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: 0.3s ease;
}

.back-button:hover {
    background: rgba(220, 190, 145, 0.15);
    border-color: #d8b98b;
}


/* ========================================
   10. ПАНЕЛЬ ПРЕДПРОСМОТРА
======================================== */

#previewPanel {
    width: 100%;
    max-width: 650px;
    margin: 25px auto;
    padding: 22px;
    background: rgba(244, 232, 210, 0.1);
    border: 1px solid rgba(220, 190, 145, 0.35);
    border-radius: 5px;
    text-align: center;
}

.preview-heading {
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    color: #e8d4b5;
    margin-bottom: 8px;
}

.preview-description {
    font-size: 11px;
    color: #cbb99e;
    margin-bottom: 18px;
}

#previewSlider {
    width: 100%;
    accent-color: #c4a276;
    cursor: pointer;
}

.preview-range {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 9px;
    color: #cbb99e;
}

#resetPreview {
    margin-top: 18px;
    padding: 10px 18px;
    background: transparent;
    border: 1px solid #b99b72;
    color: #e8d4b5;
    font-size: 10px;
    letter-spacing: 1px;
    transition: 0.3s ease;
}

#resetPreview:hover {
    background: rgba(220, 190, 145, 0.15);
}


/* ========================================
   11. СТРАНИЦА ПОДАРКА
======================================== */

.gift-screen {
    max-width: 900px;
    margin: 0 auto;
}

.gift-screen .calendar-header {
    margin-bottom: 35px;
}

#giftPageDate {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #c4a276;
}

#giftPageTitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(35px, 6vw, 52px);
    font-weight: 400;
    color: #f4e8d2;
    margin-top: 12px;
}

#giftPageDescription {
    max-width: 550px;
    margin: 12px auto 0;
    color: #d1bda2;
    font-size: 12px;
    line-height: 1.8;
}


/* ========================================
   12. ТРИ ЭТАПА ПОДАРКА
======================================== */

.gift-flow {
    width: 100%;
    max-width: 650px;
    margin: 10px auto 30px;
}

.gift-stage {
    width: 100%;
    padding: 35px;
    background: rgba(244, 232, 210, 0.96);
    color: #3c2b20;
    border: 1px solid #cbb58e;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
    animation: stageAppear 0.5s ease;
}

@keyframes stageAppear {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stage-number {
    margin-bottom: 15px;
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #a1845e;
}

.gift-stage h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 34px;
    font-weight: 400;
    color: #49372a;
    margin-bottom: 18px;
}

.gift-stage p {
    font-size: 12px;
    line-height: 2;
    color: #6b5543;
}


/* ========================================
   13. ПЕРВОЕ ПИСЬМО
======================================== */

.message-paper {
    padding: 25px;
    margin: 20px 0 25px;
    background: rgba(255, 250, 239, 0.8);
    border: 1px solid rgba(160, 125, 85, 0.25);
}

.message-paper p {
    white-space: pre-wrap;
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    line-height: 1.8;
    color: #49372a;
}


/* ========================================
   14. ЗАДАНИЯ
======================================== */

#activityText {
    margin-bottom: 22px;
}

#activityArea {
    margin: 20px 0;
}

#activityAnswer {
    display: block;
    width: 100%;
    min-height: 110px;
    padding: 15px;
    resize: vertical;

    background: #fffaf0;
    border: 1px solid #cbb58e;
    border-radius: 2px;

    color: #49372a;
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    outline: none;
}

#activityAnswer:focus {
    border-color: #a1845e;
}

#activityAnswer::placeholder {
    color: #a99883;
}


/* ========================================
   15. ВАРИАНТЫ ОТВЕТОВ
======================================== */

.activity-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 10px 0;
    padding: 14px;

    background: rgba(255, 250, 239, 0.8);
    border: 1px solid rgba(160, 125, 85, 0.3);

    color: #49372a;
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;

    cursor: pointer;
    transition: 0.2s ease;
}

.activity-option:hover {
    background: #f1e2c9;
}

.activity-option input {
    accent-color: #98754f;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}


/* ========================================
   16. РИСОВАНИЕ
======================================== */

#drawingCanvas {
    display: block;
    width: 100%;
    height: auto;
    min-height: 180px;

    background: #fffaf0;
    border: 1px solid #cbb58e;
    border-radius: 2px;

    touch-action: none;
    cursor: crosshair;
}

.clear-drawing {
    display: block;
    margin-top: 12px;
    padding: 9px 15px;

    background: transparent;
    border: 1px solid #a1845e;
    color: #76583d;

    font-size: 10px;
    letter-spacing: 1px;
    transition: 0.3s ease;
}

.clear-drawing:hover {
    background: #f1e2c9;
}


/* ========================================
   17. КНОПКИ НА СТРАНИЦЕ ПОДАРКА
======================================== */

#toActivity,
#completeActivity {
    display: inline-block;
    margin-top: 15px;
    padding: 13px 25px;

    background: #9d7951;
    border: 1px solid #9d7951;
    color: #fff4e2;

    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 1.5px;
    text-transform: uppercase;

    transition: 0.3s ease;
}

#toActivity:hover,
#completeActivity:hover {
    background: #795638;
    border-color: #795638;
}

#completeActivity:disabled {
    opacity: 0.5;
    cursor: default;
}

#activityFeedback {
    margin-top: 15px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    color: #98754f;
}


/* ========================================
   18. ПОСЛЕДНИЙ ЭТАП — ПОДАРОК
======================================== */

#giftPageIcon {
    margin: 15px 0;
    font-size: 50px;
    text-align: center;
}

#rewardTitle {
    text-align: center;
}

#rewardDescription {
    text-align: center;
    margin-bottom: 20px;
}

#giftPageContent {
    margin-top: 20px;
    text-align: center;
}

#giftPageContent p {
    font-family: 'Cormorant Garamond', serif;
    font-size: 21px;
    line-height: 1.8;
    color: #49372a;
    white-space: pre-wrap;
}

#giftPageContent img {
    display: block;
    max-width: 100%;
    max-height: 600px;
    margin: 15px auto;
    object-fit: contain;
    border: 1px solid rgba(160, 125, 85, 0.3);
}

#giftPageContent video {
    display: block;
    width: 100%;
    max-width: 550px;
    margin: 20px auto;
}

#giftPageContent a {
    display: inline-block;
    margin: 15px;
    padding: 14px 25px;

    background: #9d7951;
    color: #fff4e2;
    text-decoration: none;

    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;

    transition: 0.3s ease;
}

#giftPageContent a:hover {
    background: #795638;
}

.gift-content-code {
    display: inline-block;
    max-width: 100%;
    margin: 15px auto;
    padding: 18px 25px;

    background: #fffaf0;
    border: 1px dashed #a1845e;

    color: #49372a;
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    overflow-wrap: anywhere;
}


/* ========================================
   19. АНИМАЦИИ
======================================== */

@keyframes envelopeFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.envelope-icon {
    animation: envelopeFloat 3s ease-in-out infinite;
}


/* ========================================
   20. АДАПТИВНОСТЬ — ПЛАНШЕТЫ
======================================== */

@media (max-width: 768px) {

    .screen {
        padding: 30px 15px;
    }

    .letter {
        padding: 45px 30px;
    }

    .calendar-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 13px;
    }

    .gift-card {
        min-height: 125px;
    }

    .gift-stage {
        padding: 28px 22px;
    }

    .gift-stage h2 {
        font-size: 30px;
    }
}


/* ========================================
   21. АДАПТИВНОСТЬ — ТЕЛЕФОНЫ
======================================== */

@media (max-width: 480px) {

    body {
        background-attachment: scroll;
    }

    .screen {
        padding: 25px 12px;
    }

    .letter {
        padding: 40px 22px;
    }

    .letter h1 {
        font-size: 39px;
    }

    .letter p {
        font-size: 12px;
    }

    .calendar-header h1,
    .calendar-header h2 {
        font-size: 38px;
    }

    .calendar-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 9px;
    }

    .gift-card {
        min-height: 105px;
        padding: 12px 5px;
        gap: 6px;
    }

    .gift-number {
        font-size: 15px;
    }

    .gift-icon {
        font-size: 22px;
    }

    .gift-label {
        font-size: 8px;
        letter-spacing: 0.5px;
    }

    #nextGiftTimer {
        margin: 20px auto 25px;
        padding: 20px 8px;
    }

    .countdown-title {
        font-size: 22px;
    }

    .countdown-clock {
        gap: 4px;
    }

    .countdown-unit {
        min-width: 45px;
    }

    .countdown-unit span {
        font-size: 29px;
    }

    .countdown-unit small {
        font-size: 8px;
    }

    .countdown-separator {
        font-size: 20px;
    }

    .gift-flow {
        margin-top: 15px;
    }

    .gift-stage {
        padding: 25px 18px;
    }

    .gift-stage h2 {
        font-size: 29px;
    }

    .message-paper {
        padding: 18px;
    }

    .message-paper p {
        font-size: 18px;
    }

    #activityAnswer {
        font-size: 16px;
    }

    #giftPageContent p {
        font-size: 19px;
    }
}


/* ========================================
   22. МАЛЕНЬКИЕ ТЕЛЕФОНЫ
======================================== */

@media (max-width: 360px) {

    .calendar-grid {
        gap: 7px;
    }

    .gift-card {
        min-height: 95px;
    }

    .gift-number {
        font-size: 13px;
    }

    .gift-label {
        font-size: 7px;
    }

    .countdown-unit {
        min-width: 38px;
    }

    .countdown-unit span {
        font-size: 25px;
    }

    .countdown-separator {
        font-size: 17px;
    }
}
