:root {
    /* Пастельная бежево-карамельная тема */
    --bg: #f8e3c8;
    --bg-soft: #f4d9b8;
    --card-bg: #fdf2dd;
    --card-stroke: #f0cfa2;
    --accent: #d78246;
    --accent-soft: rgba(215, 130, 70, 0.12);
    --accent-strong: #b66432;

    --text-main: #5a3a24;
    --text-soft: #8c6a49;
    --text-muted: #b58c63;

    --radius-lg: 26px;
    --radius-md: 18px;
    --radius-pill: 999px;

    --shadow-soft: 0 14px 30px rgba(203, 152, 92, 0.25);
}

/* Сброс */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
        sans-serif;
    background: radial-gradient(circle at top, var(--bg), var(--bg-soft));
    color: var(--text-main);
}

/* Каркас приложения */

.app {
    min-height: 100vh;
    max-width: 420px;
    margin: 0 auto;
    padding: 16px 14px 80px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-beige {
    background: transparent;
}

/* Общий стиль карточек */

.card {
    background-color: var(--card-bg);
    background-image: var(--snow-cap);
    background-repeat: no-repeat;
    background-size: 100% var(--snow-cap-height);
    background-position: 0 0;
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--card-stroke);
    box-shadow: var(--shadow-soft);
    padding: 14px 16px;
    overflow: hidden;
    /* на всякий случай обрезаем всё, что вылезает за карту */
}

/* Вопрос про отношения */

.question-card {
    padding: 10px 12px;
    border-radius: 22px;
}

.question-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.question-title h1 {
    margin: 0;
    font-size: 18px;
    line-height: 1.25;
    font-weight: 700;
}

.icon-btn {
    border: none;
    background: transparent;
    color: var(--text-soft);
    font-size: 16px;
    padding: 4px 6px;
    border-radius: var(--radius-pill);
    cursor: pointer;
}

.question-subtitle {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-soft);
}

.mood-row {
    margin-top: 8px;
}

.mood-buttons {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: 999px;
    background: #faebd5;
    border: 1px solid rgba(236, 192, 138, 0.9);
}

.mood-buttons button {
    flex: 1;
    border-radius: 999px;
    border: none;
    background: transparent;
    font-size: 18px;
    padding: 4px 0;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.12s ease,
        box-shadow 0.12s ease;
}

/* выбранное настроение */
.mood-buttons button.selected {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 6px rgba(183, 132, 81, 0.35);
}

.mood-buttons button:hover:not(.selected) {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 6px rgba(183, 132, 81, 0.35);
}

.mood-buttons button:active {
    transform: translateY(0);
    background: rgba(250, 222, 189, 0.8);
}

/* Дом отношений */

.home-card {
    padding: 18px 18px;
    border-radius: 26px;
    min-height: 170px;
    overflow: hidden;
    /* ничего не вылезает за края */
}

.home-inner {
    display: grid;
    /* две колонки: кот и текст */
    grid-template-columns: minmax(96px, 120px) minmax(0, 1fr);
    /* две строки: 1 — кот + текст, 2 — мета-блок */
    grid-template-rows: auto auto;
    gap: 18px 18px;
    align-items: flex-start;
    height: 100%;
}

.home-illustration {
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    background: #fbe8ca;
    border-radius: 24px;
}

.home-cat-img {
    width: 90px;
    height: 90px;
    object-fit: contain;
}

.home-text h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.home-text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-soft);
}

/* внутренняя карточка с данными */

.home-meta {
    margin-top: 0;
    /* отступ сделаем через gap грида */
    padding: 10px 14px 12px;
    border-radius: 18px;
    background: #fffaf1;
    border: 1px solid rgba(232, 186, 119, 0.7);
    box-shadow: 0 8px 16px rgba(203, 152, 92, 0.16);
    display: flex;
    flex-direction: column;
    gap: 6px;

    /* занять всю ширину карточки */
    grid-column: 1 / -1;
    /* обе колонки грида */
    width: 100%;
    max-width: none;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: var(--text-soft);
}

.meta-label {
    opacity: 0.8;
}

.meta-value {
    font-weight: 600;
    color: var(--text-main);
    text-align: right;
}

/* строка с инпутом и кнопкой */

.link-row {
    margin-top: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.link-row input {
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(232, 186, 119, 0.7);
    background: #fdf7ec;
    font-size: 14px;
}

.link-hint {
    margin: 4px 0 0;
    font-size: 12px;
    color: #b6493a;
}

/* Карточка "Ивент дня" */

.info-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.info-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-action-btn {
    border: 1px solid rgba(232, 186, 119, 0.9);
    background: #fdf2dd;
    color: var(--text-soft);
    width: 30px;
    height: 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
}

.info-title {
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-icon {
    width: 32px;
    height: 32px;
    display: block;
    object-fit: contain;
}

.info-label {
    font-size: 15px;
    font-weight: 600;
}

.pill {
    border-radius: var(--radius-pill);
    padding: 4px 10px;
    font-size: 11px;
    border: 1px solid rgba(230, 183, 124, 0.9);
}

.pill-soft {
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-muted);
}

.info-body {
    margin-top: 4px;
}

/* квот для ивента дня */
.event-quote {
    margin: 0;
    padding: 8px 10px;
    border-radius: 18px;
    background: #fbeed9;
    border: 1px solid rgba(232, 186, 119, 0.7);
}

.event-quote .card-title {
    margin: 0 0 4px;
}

.event-quote .card-text {
    margin: 0;
}

/* Дневная серия */

.streak-card {
    padding: 14px 16px;
    cursor: pointer;
}

.streak-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.streak-icon {
    display: block;
    width: 54px;
    height: 54px;
    object-fit: contain;
}

.streak-title {
    font-size: 16px;
    font-weight: 700;
}

.streak-subtitle {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-soft);
}

/* Модалка daily streak */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(60, 42, 26, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 50;
}

.modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    width: min(360px, 92vw);
    background: var(--card-bg);
    border-radius: 22px;
    border: 1.5px solid var(--card-stroke);
    box-shadow: var(--shadow-soft);
    padding: 18px 16px 16px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
}

.streak-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.streak-modal-flame {
    width: 56px;
    height: 56px;
    display: block;
    object-fit: contain;
}

.streak-modal-count {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
}

.streak-modal-title {
    font-size: 12px;
    color: var(--text-soft);
}

.streak-calendar {
    background: #fffaf1;
    border: 1px solid rgba(232, 186, 119, 0.7);
    border-radius: 16px;
    padding: 10px;
}

.streak-weekdays,
.streak-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.streak-weekdays span {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
}

.streak-day {
    height: 26px;
    border-radius: 9px;
    border: 1px solid rgba(232, 186, 119, 0.7);
    background: #fdf7ec;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
}

.streak-day.is-filled {
    background: #ffe2b5;
    color: var(--text-main);
    border-color: rgba(210, 150, 90, 0.8);
    font-weight: 600;
}

.streak-day.is-today {
    box-shadow: 0 0 0 2px rgba(210, 150, 90, 0.4);
}

.streak-modal-hint {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-soft);
    text-align: center;
}

/* общий футер/подпись под карточками (используется и в идеях) */
.info-footer {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.cards-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.cards-icon {
    padding: 4px 8px;
    border-radius: 12px;
    background: #f7dec1;
    border: 1px solid rgba(232, 186, 119, 0.9);
}

/* Случайная идея */

.idea-card {
    padding: 14px 16px 18px;
}

.idea-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.idea-icon {
    font-size: 16px;
}

.idea-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

/* Квот для идеи */
.idea-quote {
    margin: 4px 0 10px;
    padding: 9px 11px;
    border-radius: 18px;
    background: #fbe8ca;
    border: 1px solid rgba(232, 186, 119, 0.9);
}

.idea-quote .card-title {
    margin: 0 0 3px;
    font-size: 14px;
}

.idea-quote .card-text {
    margin: 0;
    font-size: 13px;
    color: var(--text-soft);
}

/* Вишлист превью */

.wishlist-card {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.wishlist-preview-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wishlist-preview-icon {
    width: 56px;
    height: 56px;
    display: block;
    object-fit: contain;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.6);
}

.wishlist-preview-text h2 {
    margin: 0;
    font-size: 16px;
}

.wishlist-preview-text p {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--text-soft);
}

.wishlist-card .primary-btn {
    width: 100%;
}

.plus-banner {
    border-radius: 20px;
    border: 1px solid rgba(232, 186, 119, 0.9);
    background: linear-gradient(135deg, rgba(253, 242, 221, 0.95), #fbe8ca);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    color: var(--text-main);
}

.plus-banner-text {
    font-weight: 600;
}

/* Общие тексты в карточках */

.card-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

.card-text {
    font-size: 13px;
    color: var(--text-soft);
    margin-top: 2px;
}

/* Основные кнопки */

.primary-btn {
    border-radius: var(--radius-pill);
    border: none;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #fffdf6;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(170, 105, 60, 0.55);
    transition: transform 0.12s ease, box-shadow 0.12s ease,
        filter 0.12s ease;
    white-space: nowrap;
}

.primary-btn:active {
    filter: brightness(0.96);
}

/* Вспомогательная кнопка ("Привязать") в карточке дома */
.secondary-btn {
    border-radius: 14px;
    padding: 8px 14px;
    border: 1px solid rgba(232, 186, 119, 0.9);
    background: #fffdf6;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(196, 145, 94, 0.35);
    transition: transform 0.12s ease, box-shadow 0.12s ease,
        filter 0.12s ease;
    white-space: nowrap;
}

.secondary-btn:active {
    filter: brightness(0.97);
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(196, 145, 94, 0.3);
}

/* bounce-анимация для кнопки перетасовки */
.primary-btn.btn-bounce {
    animation: btn-bounce 0.18s ease-out;
}

@keyframes btn-bounce {
    0% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(1px) scale(0.97);
    }

    100% {
        transform: translateY(0) scale(1);
    }
}

/* Нижняя навигация */

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 10px;
    max-width: 420px;
    margin: 0 auto;
    padding: 6px 14px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.beige-nav {
    background: transparent;
    backdrop-filter: none;
}

.nav-btn {
    flex: 1;
    border-radius: 999px;
    border: 1px solid rgba(231, 189, 138, 0.9);
    background: #fdf2dd;
    color: var(--text-soft);
    padding: 6px 0 7px;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(200, 150, 100, 0.15);
    transition: transform 0.1s ease, box-shadow 0.1s ease,
        background 0.1s ease;
}

.nav-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(200, 150, 100, 0.28);
}

.nav-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(200, 150, 100, 0.22);
}

.nav-btn-active {
    background: #f9e0bf;
    color: var(--text-main);
}

.nav-icon {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.nav-icon img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.nav-label {
    font-size: 11px;
}

/* Анимация скрытия блока настроения */

.fade-out {
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Адаптив для маленьких экранов */

@media (max-width: 390px) {
    .app {
        padding-inline: 10px;
    }

    .home-meta {
        width: 100%;
        max-width: 100%;
        grid-column: 1 / -1;
        margin-left: 0;
    }

    .home-meta {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
    }

    .wishlist-card {
        width: 100%;
    }
}
