/* 전체 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
    background: linear-gradient(160deg, #fff8f0 0%, #ffe8d6 50%, #ffd4b8 100%);
    min-height: 100vh;
    color: #4a3728;
    line-height: 1.6;
}

.container {
    max-width: 520px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

/* 헤더 */
.header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.title {
    font-size: 1.85rem;
    font-weight: 800;
    color: #e85d04;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 0.95rem;
    color: #8b6914;
    opacity: 0.9;
}

/* 추천 카드 */
.result-section {
    margin-bottom: 1.5rem;
}

.result-section.hidden {
    display: none;
}

.menu-card {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(232, 93, 4, 0.15);
    overflow: hidden;
    animation: cardPop 0.5s ease-out;
}

@keyframes cardPop {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.card-image-wrap {
    position: relative;
    width: 100%;
    height: 220px;
    background: #fff5eb;
    overflow: hidden;
}

.menu-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.menu-image.hidden {
    display: none;
}

.image-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    background: #fff5eb;
}

.image-fallback.hidden {
    display: none;
}

.card-body {
    padding: 1.35rem 1.5rem 1.5rem;
}

.menu-name {
    font-size: 1.6rem;
    font-weight: 800;
    color: #e85d04;
    margin-bottom: 0.6rem;
}

.menu-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
}

.tag-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #c44d00;
    background: #ffe8d6;
    border-radius: 999px;
}

.menu-description {
    font-size: 0.95rem;
    color: #5c4a3a;
    margin-bottom: 0.75rem;
}

.reason-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #e85d04;
    margin-bottom: 0.25rem;
}

.menu-reason {
    font-size: 0.9rem;
    color: #6b5344;
    background: #fff8f0;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    border-left: 4px solid #ffb347;
}

/* 버튼 */
.btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    border-radius: 14px;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    color: #fff;
    background: linear-gradient(135deg, #ff6b35, #e85d04);
    box-shadow: 0 8px 24px rgba(232, 93, 4, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 12px 28px rgba(232, 93, 4, 0.45);
}

.btn-secondary {
    padding: 0.7rem 1.25rem;
    font-size: 0.9rem;
    color: #e85d04;
    background: #fff;
    border: 2px solid #ffb347;
}

.btn-secondary:hover {
    background: #fff8f0;
}

.btn-outline {
    padding: 0.45rem 0.85rem;
    font-size: 0.78rem;
    color: #8b6914;
    background: transparent;
    border: 1.5px solid #d4a574;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.6);
}

.recommend-wrap {
    text-align: center;
    margin-bottom: 2.5rem;
}

.action-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
    position: relative;
}

.copy-toast {
    position: absolute;
    top: -2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #2d6a4f;
    color: #fff;
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    animation: fadeInOut 2s ease forwards;
}

.copy-toast.hidden {
    display: none;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(8px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    85% { opacity: 1; }
    100% { opacity: 0; }
}

/* 추천 기록 */
.history-section {
    background: rgba(255, 255, 255, 0.65);
    border-radius: 20px;
    padding: 1.25rem 1.15rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.history-title {
    font-size: 1rem;
    font-weight: 700;
    color: #5c4a3a;
}

.history-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    padding: 0.6rem 0.85rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(232, 93, 4, 0.08);
    animation: cardPop 0.35s ease-out;
}

.history-thumb {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    background: #fff5eb;
    flex-shrink: 0;
}

.history-thumb-emoji {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: #fff5eb;
    border-radius: 10px;
    flex-shrink: 0;
}

.history-info {
    flex: 1;
    min-width: 0;
}

.history-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #4a3728;
}

.history-time {
    font-size: 0.72rem;
    color: #9a7b5a;
}

.history-empty {
    text-align: center;
    font-size: 0.88rem;
    color: #9a7b5a;
    padding: 0.5rem;
}

/* 반응형 */
@media (max-width: 480px) {
    .container {
        padding: 1.5rem 1rem 2.5rem;
    }

    .title {
        font-size: 1.55rem;
    }

    .card-image-wrap {
        height: 180px;
    }

    .menu-name {
        font-size: 1.4rem;
    }

    .history-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 560px;
        padding-top: 2.5rem;
    }

    .card-image-wrap {
        height: 260px;
    }
}
