:root {
    --bg-base: #f7efe5;
    --bg-accent: #ffd7a8;
    --surface: rgba(255, 252, 246, 0.84);
    --surface-strong: #fffaf3;
    --text-main: #2c1c12;
    --text-soft: #6f5646;
    --shadow: 0 24px 60px rgba(114, 73, 33, 0.16);
    --line: rgba(119, 77, 38, 0.12);
    --primary: #d6672f;
    --primary-hover: #bb5624;
    --chip: rgba(255, 240, 224, 0.9);
    --chip-active: #2f241d;
    --chip-active-text: #fff8f1;
}

body.dark-mode {
    --bg-base: #201714;
    --bg-accent: #5c3629;
    --surface: rgba(41, 29, 24, 0.8);
    --surface-strong: #34251f;
    --text-main: #fff2e8;
    --text-soft: #d8b7a3;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
    --line: rgba(255, 224, 197, 0.1);
    --primary: #ff9b54;
    --primary-hover: #ff8a37;
    --chip: rgba(95, 62, 48, 0.88);
    --chip-active: #ffe9d7;
    --chip-active-text: #2b1d16;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 32px 20px;
    font-family: "Trebuchet MS", "Noto Sans KR", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.65), transparent 28%),
        linear-gradient(135deg, var(--bg-base), var(--bg-accent));
    position: relative;
    overflow-x: hidden;
}

.ambient {
    position: fixed;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    filter: blur(16px);
    opacity: 0.45;
    pointer-events: none;
}

.ambient-left {
    top: 40px;
    left: -80px;
    background: rgba(255, 214, 161, 0.6);
}

.ambient-right {
    right: -80px;
    bottom: 60px;
    background: rgba(211, 109, 63, 0.24);
}

.container {
    width: min(920px, 100%);
    margin: 0 auto;
    display: grid;
    gap: 18px;
    position: relative;
    z-index: 1;
}

.panel,
.hero {
    backdrop-filter: blur(14px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.hero {
    padding: 32px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}

.eyebrow {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.78rem;
    color: var(--text-soft);
}

h1 {
    margin: 0;
    font-size: clamp(2.2rem, 5vw, 4rem);
    line-height: 1.02;
}

.description {
    margin: 16px 0 0;
    max-width: 520px;
    line-height: 1.6;
    color: var(--text-soft);
}

#theme-toggle,
.primary-button,
.chip {
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

#theme-toggle {
    padding: 14px 18px;
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--text-main);
    border: 1px solid var(--line);
    white-space: nowrap;
}

.controls {
    padding: 24px;
    display: grid;
    gap: 20px;
}

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    padding: 12px 16px;
    border-radius: 999px;
    background: var(--chip);
    color: var(--text-main);
    font-size: 0.95rem;
}

.chip.active {
    background: var(--chip-active);
    color: var(--chip-active-text);
}

.primary-button {
    padding: 18px 24px;
    border-radius: 20px;
    background: var(--primary);
    color: #fff9f4;
    font-size: 1.05rem;
    font-weight: 700;
}

.primary-button:hover,
#theme-toggle:hover,
.chip:hover {
    transform: translateY(-2px);
}

.primary-button:hover {
    background: var(--primary-hover);
}

.result-card {
    padding: 28px;
    background: var(--surface-strong);
}

.result-label {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.92rem;
}

.result-card h2 {
    margin: 10px 0 12px;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.menu-description {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.7;
}

.tags {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--chip);
    color: var(--text-main);
    font-size: 0.9rem;
}

.history {
    padding: 24px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-end;
}

.history-header h3,
.history-header p {
    margin: 0;
}

.history-header p {
    color: var(--text-soft);
}

#history-list {
    list-style: none;
    padding: 0;
    margin: 18px 0 0;
    display: grid;
    gap: 12px;
}

#history-list li {
    padding: 16px 18px;
    border-radius: 18px;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

#history-list li span {
    color: var(--text-soft);
    font-size: 0.95rem;
}

.history-empty {
    justify-content: center !important;
    color: var(--text-soft);
}

@media (max-width: 720px) {
    body {
        padding: 18px 14px 28px;
    }

    .hero,
    .history-header {
        flex-direction: column;
        align-items: stretch;
    }

    .hero,
    .panel {
        border-radius: 24px;
    }

    #theme-toggle,
    .primary-button {
        width: 100%;
    }

    #history-list li {
        flex-direction: column;
        align-items: flex-start;
    }
}
