:root {
    --bg-gradient: linear-gradient(135deg, #f97316 0%, #ef4444 50%, #ec4899 100%);
    --container-bg: #ffffff;
    --text-color: #1f2937;
    --subtitle-color: #6b7280;
    --title-color: #ef4444;
    --card-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    --btn-bg: linear-gradient(135deg, #f97316, #ef4444);
    --btn-shadow: rgba(239, 68, 68, 0.4);
    --filter-bg: #f3f4f6;
    --filter-active-bg: #ef4444;
    --filter-active-text: #ffffff;
    --filter-text: #374151;
    --card-bg: #fff7ed;
    --card-border: #fed7aa;
    --history-bg: #fef2f2;
    --history-border: #fecaca;
    --reroll-bg: #f3f4f6;
    --reroll-color: #374151;
    --tag-bg: #fee2e2;
    --tag-color: #dc2626;
}

body.dark-mode {
    --bg-gradient: linear-gradient(135deg, #1c1917 0%, #1e1b4b 100%);
    --container-bg: #1f2937;
    --text-color: #f9fafb;
    --subtitle-color: #9ca3af;
    --title-color: #fb923c;
    --card-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    --btn-bg: linear-gradient(135deg, #ea580c, #dc2626);
    --btn-shadow: rgba(234, 88, 12, 0.4);
    --filter-bg: #374151;
    --filter-active-bg: #ea580c;
    --filter-active-text: #ffffff;
    --filter-text: #d1d5db;
    --card-bg: #292524;
    --card-border: #44403c;
    --history-bg: #1c1917;
    --history-border: #44403c;
    --reroll-bg: #374151;
    --reroll-color: #e5e7eb;
    --tag-bg: #431407;
    --tag-color: #fb923c;
}

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

body {
    font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 4rem 1rem 2rem;
    transition: background 0.3s;
}

.top-controls {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 100;
}

.ctrl-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
    backdrop-filter: blur(4px);
    font-family: inherit;
    letter-spacing: 0.03em;
}

.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: white;
    transform: scale(1.1);
}

/* keep old selector working for JS that references themeToggle */
.theme-toggle { font-size: 1.3rem; }

.container {
    background: var(--container-bg);
    padding: 2rem;
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    width: 100%;
    max-width: 600px;
    transition: background 0.3s, box-shadow 0.3s;
}

h1 {
    color: var(--title-color);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0.4rem;
}

.subtitle {
    color: var(--subtitle-color);
    text-align: center;
    margin-bottom: 1.8rem;
    font-size: 0.95rem;
}

.filters {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.8rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--subtitle-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: none;
    background: var(--filter-bg);
    color: var(--filter-text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.filter-btn:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--filter-active-bg);
    color: var(--filter-active-text);
    font-weight: 600;
    box-shadow: 0 2px 8px var(--btn-shadow);
}

.result-area {
    margin-bottom: 1.5rem;
}

.result-card {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.result-card.revealed {
    border-color: var(--filter-active-bg);
    box-shadow: 0 0 0 3px var(--btn-shadow);
}

.card-placeholder {
    text-align: center;
    color: var(--subtitle-color);
}

.question-mark {
    font-size: 4rem;
    display: block;
    margin-bottom: 0.8rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

@keyframes spin-in {
    0% { transform: rotateY(90deg) scale(0.8); opacity: 0; }
    60% { transform: rotateY(-10deg) scale(1.05); opacity: 1; }
    100% { transform: rotateY(0deg) scale(1); opacity: 1; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.card-result {
    text-align: center;
    width: 100%;
    animation: spin-in 0.5s ease-out;
}

.card-result.hidden,
.card-placeholder.hidden {
    display: none;
}

.food-emoji {
    font-size: 4.5rem;
    margin-bottom: 0.8rem;
    display: block;
    line-height: 1;
}

.food-name {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--title-color);
    margin-bottom: 0.8rem;
}

.food-tags {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 0.7rem;
}

.tag {
    background: var(--tag-bg);
    color: var(--tag-color);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.food-desc {
    color: var(--subtitle-color);
    font-size: 0.9rem;
    line-height: 1.5;
}

.recipe-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--card-border);
    text-align: left;
}

.recipe-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--subtitle-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
    text-align: center;
}

.recipe-steps {
    counter-reset: recipe;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recipe-steps li {
    counter-increment: recipe;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.83rem;
    color: var(--subtitle-color);
    line-height: 1.5;
}

.recipe-steps li::before {
    content: counter(recipe);
    background: var(--card-border);
    color: var(--title-color);
    font-size: 0.72rem;
    font-weight: 800;
    min-width: 1.3rem;
    height: 1.3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.pick-btn {
    width: 100%;
    padding: 1rem;
    background: var(--btn-bg);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 20px var(--btn-shadow);
    font-family: inherit;
    letter-spacing: 0.03em;
}

.pick-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px var(--btn-shadow);
}

.pick-btn:active {
    transform: translateY(0);
    animation: shake 0.3s ease;
}

.reroll-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--reroll-bg);
    color: var(--reroll-color);
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.reroll-btn:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.restaurant-btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.restaurant-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

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

/* ── Location input ── */
.location-input-wrap {
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.location-row {
    display: flex;
    gap: 0.5rem;
}

.location-input {
    flex: 1;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    border: 2px solid var(--card-border);
    background: var(--filter-bg);
    color: var(--text-color);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.location-input:focus {
    border-color: var(--filter-active-bg);
}

.location-input::placeholder {
    color: var(--subtitle-color);
    opacity: 0.65;
}

.locate-btn {
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    background: var(--filter-active-bg);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
    box-shadow: 0 2px 8px var(--btn-shadow);
}

.locate-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.locate-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.hidden {
    display: none !important;
}

.history {
    background: var(--history-bg);
    border: 1px solid var(--history-border);
    border-radius: 16px;
    padding: 1rem 1.2rem;
}

.history-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--subtitle-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

#history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.history-item {
    background: var(--tag-bg);
    color: var(--tag-color);
    font-size: 0.85rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-weight: 500;
}

.app-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-radius: 16px;
    padding: 1rem 1.2rem;
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(109, 40, 217, 0.25);
}
.app-link:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(109, 40, 217, 0.35); }

.app-link-emoji { font-size: 1.8rem; flex-shrink: 0; }

.app-link-text {
    display: flex; flex-direction: column; gap: 0.2rem;
}
.app-link-title {
    font-size: 0.95rem; font-weight: 800;
    color: #ffffff;
}
.app-link-desc {
    font-size: 0.8rem; color: rgba(255,255,255,0.75);
}

.comments-section {
    margin-top: 1.5rem;
    border-top: 1px solid var(--history-border);
    padding-top: 1.2rem;
}

.comments-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--subtitle-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

#disqus_thread {
    color-scheme: light;
}

body.dark-mode #disqus_thread {
    color-scheme: dark;
}

/* ── Site Footer ── */
.site-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--history-border);
    text-align: center;
}

.site-footer nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.3rem 1.2rem;
    margin-bottom: 0.75rem;
}

.site-footer nav a {
    font-size: 0.82rem;
    color: var(--subtitle-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.site-footer nav a:hover {
    color: var(--title-color);
}

.site-footer p {
    font-size: 0.75rem;
    color: var(--subtitle-color);
    opacity: 0.7;
}

/* ── Info Section ── */
.info-section {
    background: var(--filter-bg);
    border-radius: 16px;
    padding: 1.2rem 1.4rem;
    margin-bottom: 1.5rem;
}

.info-section h2 {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 0.8rem;
    letter-spacing: 0.02em;
}

.info-section ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.info-section ul li {
    font-size: 0.85rem;
    color: var(--subtitle-color);
    padding-left: 0.1rem;
}

.step-list {
    counter-reset: steps;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.step-list li {
    counter-increment: steps;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--subtitle-color);
}

.step-list li::before {
    content: counter(steps);
    background: var(--filter-active-bg);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

/* ── Static pages (about, contact, privacy) ── */
.page-container {
    background: var(--container-bg);
    padding: 2rem;
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    width: 100%;
    max-width: 680px;
    transition: background 0.3s, box-shadow 0.3s;
}

.page-back {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--subtitle-color);
    text-decoration: none;
    margin-bottom: 1.5rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: var(--filter-bg);
    border: 1px solid var(--history-border);
    transition: all 0.2s;
}

.page-back:hover { opacity: 0.75; transform: translateX(-2px); }

.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--history-border);
}

.page-header h1 {
    font-size: 1.6rem;
    text-align: left;
    margin-bottom: 0.4rem;
}

.page-header p {
    font-size: 0.9rem;
    color: var(--subtitle-color);
}

.page-section {
    margin-bottom: 1.8rem;
}

.page-section h2 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 0.7rem;
    padding-left: 0.7rem;
    border-left: 3px solid var(--filter-active-bg);
}

.page-section p, .page-section li {
    font-size: 0.9rem;
    color: var(--subtitle-color);
    line-height: 1.75;
}

.page-section ul {
    padding-left: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.contact-card {
    background: var(--filter-bg);
    border-radius: 14px;
    padding: 1.2rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.contact-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-color);
}

.contact-row span:first-child {
    font-size: 1.3rem;
    width: 2rem;
    text-align: center;
    flex-shrink: 0;
}

.contact-row a {
    color: var(--title-color);
    text-decoration: none;
    font-weight: 600;
}

.contact-row a:hover { text-decoration: underline; }

@media (max-width: 480px) {
    body {
        padding: 3.5rem 0.75rem 1.5rem;
    }
    .container {
        padding: 1.5rem 1.2rem;
    }
    h1 {
        font-size: 1.6rem;
    }
    .food-emoji {
        font-size: 3.5rem;
    }
    .food-name {
        font-size: 1.5rem;
    }
    .page-container {
        padding: 1.5rem 1.2rem;
    }
}


/* ── SEO and GEO content blocks ── */
.seo-content p,
.faq-section p {
    font-size: 0.88rem;
    color: var(--subtitle-color);
    line-height: 1.75;
}

.quick-answer {
    margin-bottom: 1rem;
}

.seo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.seo-grid > div,
.faq-list article {
    background: var(--container-bg);
    border: 1px solid var(--history-border);
    border-radius: 12px;
    padding: 0.9rem 1rem;
}

.seo-grid h3,
.faq-list h3 {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 0.4rem;
    line-height: 1.45;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (max-width: 560px) {
    .seo-grid {
        grid-template-columns: 1fr;
    }
}
