@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;700;900&display=swap');

:root {
    --bg-primary: #1A1008;
    --bg-secondary: #201408;
    --bg-header: rgba(26, 16, 8, 0.92);
    --bg-footer: #140C06;
    --bg-card: #2C2418;
    --text-primary: #F2E8D5;
    --text-secondary: #8C7B6B;
    --accent: #E8621C;
    --accent-light: #F5A623;
    --accent-dark: #C0392B;
    --accent-glow: rgba(232, 98, 28, 0.25);
    --border-color: rgba(92, 61, 46, 0.5);
    --primitive-color: #E8621C;
    --primitive-bg: rgba(232, 98, 28, 0.12);
    --modern-color: #4A7C59;
    --modern-bg: rgba(74, 124, 89, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.hidden { display: none !important; }

/* ── Floating Background Emojis ── */
.bg-deco {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.float-emoji {
    position: absolute;
    font-size: 2.5em;
    opacity: 0.07;
    animation: floatAround 20s infinite ease-in-out;
}

.e1 { top: 10%; left: 5%; animation-delay: 0s; }
.e2 { top: 20%; right: 8%; animation-delay: -3s; }
.e3 { top: 50%; left: 10%; animation-delay: -7s; }
.e4 { top: 60%; right: 5%; animation-delay: -10s; }
.e5 { top: 80%; left: 15%; animation-delay: -14s; }
.e6 { top: 85%; right: 12%; animation-delay: -17s; }

@keyframes floatAround {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(5deg); }
    50% { transform: translateY(10px) rotate(-3deg); }
    75% { transform: translateY(-15px) rotate(4deg); }
}

/* ── Header ── */
header {
    padding: 12px 40px;
    background-color: var(--bg-header);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.main-nav {
    display: flex;
    gap: 20px;
}

.main-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 500;
    transition: color 0.3s;
    white-space: nowrap;
}

.main-nav a:hover {
    color: var(--accent);
}

.logo h1 {
    font-size: 3.5em;
    font-weight: 800;
    font-family: 'Noto Sans KR', sans-serif;
    color: var(--accent);
    letter-spacing: 0.06em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 0 20px rgba(232, 98, 28, 0.4);
}

.logo-emoji {
    font-size: 1.6em;
}

/* ── Hero ── */
#hero {
    padding: 80px 40px 40px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    background: var(--accent-dark);
    color: #fff;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 20px;
}

.hero-content h2 {
    font-size: 3.2em;
    font-weight: 800;
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.35;
    letter-spacing: 0.04em;
    margin-bottom: 0.3em;
    background: linear-gradient(135deg, var(--accent), var(--accent-light), var(--accent-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 20px rgba(232, 98, 28, 0.3));
}

.hero-desc {
    font-size: 1.15em;
    color: var(--text-secondary);
    font-weight: 300;
}

.hero-cta {
    display: inline-block;
    margin-top: 24px;
    padding: 14px 36px;
    font-size: 1.1em;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-primary);
    background: var(--accent);
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px var(--accent-glow);
}

/* ── Hero Summary & Update Date ── */
.hero-summary {
    font-size: 0.92em;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.8;
    max-width: 600px;
    margin: 16px auto 0;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(92, 61, 46, 0.3);
}

.last-updated {
    font-size: 0.78em;
    color: var(--text-secondary);
    opacity: 0.6;
    margin-top: 10px;
}

/* ── Section Snippets ── */
.section-snippet {
    font-size: 0.92em;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.7;
    max-width: 640px;
    margin: -0.5em auto 1.5em;
    text-align: center;
}

/* ── Source Links ── */
.source-link {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgba(232, 98, 28, 0.4);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.3s;
}

.source-link:hover {
    text-decoration-color: var(--accent);
}

/* ── Footer Developer Info ── */
.footer-developer {
    font-size: 0.82em;
    color: var(--text-secondary);
    margin-bottom: 8px;
    opacity: 0.8;
}

/* ── Detector ── */
#detector {
    padding: 30px 20px 80px;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.detector-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 36px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 60px var(--accent-glow);
}

/* ── Upload Area ── */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(232, 98, 28, 0.04);
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: var(--accent);
    background: rgba(232, 98, 28, 0.08);
}

.upload-area.dragover {
    border-color: var(--accent-light);
    background: rgba(232, 98, 28, 0.12);
    transform: scale(1.02);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.upload-icon {
    font-size: 3.5em;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.upload-text {
    color: var(--text-secondary);
    font-size: 1em;
    line-height: 1.6;
}

.upload-hint {
    color: var(--text-secondary);
    font-size: 0.8em;
    opacity: 0.6;
}

.preview-image {
    width: 100%;
    max-height: 350px;
    object-fit: contain;
    border-radius: 12px;
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    background: linear-gradient(135deg, #E8621C, #C0392B);
    color: #fff;
    padding: 16px 40px;
    border: none;
    border-radius: 14px;
    font-size: 1.15em;
    font-weight: 700;
    font-family: 'Noto Sans KR', sans-serif;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 6px 25px var(--accent-glow);
    margin-top: 8px;
}

.btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 35px var(--accent-glow);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--border-color);
    box-shadow: none;
    font-size: 1em;
    padding: 12px 30px;
    color: var(--text-secondary);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: none;
}

/* ── Loading ── */
.loading {
    margin-top: 30px;
}

.loading p {
    color: var(--text-secondary);
    margin-top: 16px;
    font-size: 1.05em;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Results ── */
#result-container {
    margin-top: 30px;
    animation: fadeUp 0.6s ease-out;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-emoji {
    font-size: 5em;
    margin-bottom: 10px;
    animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes popIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.result-title {
    font-size: 1.8em;
    font-weight: 900;
    font-family: 'Noto Sans KR', sans-serif;
    letter-spacing: 0.04em;
    line-height: 1.4;
    margin-bottom: 12px;
}

.result-title.primitive { color: var(--primitive-color); }
.result-title.modern { color: var(--modern-color); }

.result-desc {
    font-size: 1.05em;
    color: var(--text-secondary);
    line-height: 1.8;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-weight: 400;
    word-break: keep-all;
}

.result-desc.primitive {
    background: var(--primitive-bg);
    border: 1px solid rgba(232, 98, 28, 0.2);
    color: #F5C5A3;
}

.result-desc.modern {
    background: var(--modern-bg);
    border: 1px solid rgba(74, 124, 89, 0.2);
    color: #A3D4B5;
}


.bars-wrapper {
    margin-top: 8px;
}

#label-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.prediction-bar { text-align: left; }

.prediction-bar .label-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.9em;
    font-weight: 700;
}

.prediction-bar .bar-bg {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    height: 14px;
    overflow: hidden;
}

.prediction-bar .bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.6s ease;
}

.prediction-bar.primitive .bar-fill {
    background: linear-gradient(90deg, #E8621C, #F5A623);
    box-shadow: 0 0 12px rgba(232, 98, 28, 0.4);
}

.prediction-bar.modern .bar-fill {
    background: linear-gradient(90deg, #4A7C59, #7BC89C);
}

/* ── Save Button ── */
.btn-save {
    margin-top: 24px;
    background: linear-gradient(135deg, #E8621C, #F5A623, #C0392B);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    width: 100%;
    font-size: 1.1em;
    box-shadow: 0 6px 30px rgba(232, 98, 28, 0.3);
}

.btn-save:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 40px rgba(232, 98, 28, 0.4);
}

/* ── Share Link Button ── */
.btn-share-link {
    margin-top: 10px;
    background: transparent;
    border: 2px solid var(--border-color);
    width: 100%;
    font-size: 1em;
    color: var(--text-secondary);
    box-shadow: none;
}

.btn-share-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-3px) scale(1.02);
    box-shadow: none;
}

/* ── Share Bottom Sheet ── */
.share-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2147483647;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
.share-sheet-overlay.hidden { display: none; }

.share-sheet {
    background: var(--bg-card);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 480px;
    padding: 20px 16px 32px;
    animation: slideUp 0.3s ease;
}
.share-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1.1em;
    font-weight: 700;
    color: var(--text-primary);
}
.share-sheet-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.6em;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.share-sheet-grid {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}
.share-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.8em;
    width: 68px;
    padding: 0;
}
.share-item:active { transform: scale(0.92); }
.share-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 14px 28px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    font-size: 0.95em;
    font-family: 'Noto Sans KR', sans-serif;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: bottom 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    white-space: nowrap;
}

.toast.show {
    bottom: 40px;
}

/* ── Info Section ── */
#info {
    padding: 80px 40px;
    text-align: center;
    background: var(--bg-secondary);
    position: relative;
    z-index: 1;
}

#info h2 {
    font-size: 2.2em;
    font-weight: 900;
    font-family: 'Noto Sans KR', sans-serif;
    letter-spacing: 0.04em;
    margin-bottom: 1em;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.info-item {
    padding: 28px 18px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: transform 0.3s;
}

.info-item:hover { transform: translateY(-5px); }

.info-icon { font-size: 2.5em; margin-bottom: 0.4em; }

.info-item h3 {
    font-size: 1.05em;
    font-weight: 700;
    margin-bottom: 0.4em;
}

.info-item p {
    color: var(--text-secondary);
    font-size: 0.88em;
    font-weight: 300;
    line-height: 1.6;
}

/* ── About Section ── */
#about {
    padding: 80px 40px;
    position: relative;
    z-index: 1;
}

.about-content {
    max-width: 760px;
    margin: 0 auto;
}

#about h2 {
    font-size: 2.2em;
    font-weight: 900;
    font-family: 'Noto Sans KR', sans-serif;
    letter-spacing: 0.04em;
    margin-bottom: 1em;
    text-align: center;
}

.about-text p {
    color: var(--text-secondary);
    font-size: 0.95em;
    line-height: 1.9;
    margin-bottom: 1em;
}

.about-text h3 {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--text-primary);
    margin: 1.5em 0 0.7em;
}

.about-text ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.about-text ul li {
    color: var(--text-secondary);
    font-size: 0.92em;
    line-height: 1.7;
    padding-left: 20px;
    position: relative;
}

.about-text ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

/* ── Tips Section ── */
#tips {
    padding: 80px 40px;
    background: var(--bg-secondary);
    position: relative;
    z-index: 1;
}

#tips h2 {
    font-size: 2.2em;
    font-weight: 900;
    font-family: 'Noto Sans KR', sans-serif;
    letter-spacing: 0.04em;
    margin-bottom: 1em;
    text-align: center;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 760px;
    margin: 0 auto;
}

.tip-item {
    padding: 28px 24px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: transform 0.3s;
}

.tip-item:hover { transform: translateY(-4px); }

.tip-number {
    font-size: 2em;
    font-weight: 900;
    font-family: 'Noto Sans KR', sans-serif;
    letter-spacing: 0.05em;
    color: var(--accent);
    opacity: 0.4;
    margin-bottom: 8px;
}

.tip-item h3 {
    font-size: 1.05em;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.tip-item p {
    color: var(--text-secondary);
    font-size: 0.88em;
    line-height: 1.7;
}

/* ── FAQ Section ── */
#faq {
    padding: 80px 40px;
    position: relative;
    z-index: 1;
}

#faq h2 {
    font-size: 2.2em;
    font-weight: 900;
    font-family: 'Noto Sans KR', sans-serif;
    letter-spacing: 0.04em;
    margin-bottom: 1em;
    text-align: center;
}

.faq-list {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.faq-item summary {
    padding: 18px 24px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95em;
    color: var(--text-primary);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color 0.3s;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
    content: '+';
    font-size: 1.3em;
    color: var(--accent);
    font-weight: 400;
    flex-shrink: 0;
    margin-left: 12px;
}

.faq-item[open] summary::after { content: '-'; }

.faq-item summary:hover { color: var(--accent); }

.faq-item p {
    padding: 0 24px 18px;
    color: var(--text-secondary);
    font-size: 0.9em;
    line-height: 1.8;
}

/* ── Disclaimer ── */
#disclaimer {
    padding: 30px 40px;
    text-align: center;
    position: relative;
    z-index: 1;
    background: rgba(26, 16, 8, 0.6);
    border-top: 1px solid var(--border-color);
}

.disclaimer-content {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.disclaimer-content p {
    font-size: 0.8em;
    color: var(--text-secondary);
    opacity: 0.7;
    line-height: 1.6;
}

/* ── Footer ── */
footer {
    padding: 40px 40px 24px;
    background-color: var(--bg-footer);
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.footer-inner {
    max-width: 760px;
    margin: 0 auto;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    margin-bottom: 30px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.footer-title {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.footer-tagline {
    font-size: 0.82em;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85em;
    transition: color 0.3s;
}

.footer-links a:hover { color: var(--accent); }

.footer-bottom {
    text-align: center;
}

.footer-bottom p {
    font-size: 0.8em;
    margin: 4px 0;
    color: var(--text-secondary);
    opacity: 0.7;
}

.footer-link {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-link:hover { color: var(--accent-light); }

/* ── Policy Modals ── */
.policy-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.policy-modal.hidden { display: none; }

.policy-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    max-width: 640px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.policy-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    border-radius: 16px 16px 0 0;
}

.policy-modal-header h2 {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--text-primary);
}

.policy-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.6em;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.policy-close-btn:hover { color: var(--text-primary); }

.policy-body {
    padding: 24px;
}

.policy-body h3 {
    font-size: 1em;
    font-weight: 700;
    color: var(--text-primary);
    margin: 1.5em 0 0.5em;
}

.policy-body h3:first-of-type { margin-top: 0.8em; }

.policy-body p {
    color: var(--text-secondary);
    font-size: 0.88em;
    line-height: 1.8;
    margin-bottom: 0.6em;
}

.policy-body ul {
    padding-left: 20px;
    margin: 0.5em 0;
}

.policy-body ul li {
    color: var(--text-secondary);
    font-size: 0.88em;
    line-height: 1.8;
}

.policy-body a {
    color: var(--accent);
    text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    header { padding: 10px 16px; }
    .header-inner { flex-direction: column; gap: 8px; }
    .main-nav { gap: 14px; }
    .main-nav a { font-size: 0.8em; }
    .logo h1 { font-size: 3em; }
    .logo-emoji { font-size: 1.2em; }
    .logo { gap: 8px; }

    #hero { padding: 50px 16px 24px; }
    .hero-content h2 { font-size: 2em; }
    .hero-desc { font-size: 0.95em; }
    .hero-badge { font-size: 0.78em; padding: 5px 14px; margin-bottom: 14px; }

    .hero-summary { font-size: 0.85em; padding: 10px 16px; }
    .section-snippet { font-size: 0.85em; }

    #detector { padding: 20px 12px 60px; }
    .detector-card {
        padding: 20px 14px;
        margin: 0;
        border-radius: 12px;
        max-width: 100%;
    }

    .upload-area { min-height: 200px; border-radius: 12px; }
    .upload-icon { font-size: 2.8em; }
    .upload-text { font-size: 0.9em; }
    .preview-image { max-height: 280px; }

    .btn { padding: 14px 28px; font-size: 1em; border-radius: 12px; width: 100%; }
    .btn-secondary { width: 100%; }
    .btn-save { font-size: 1em; }
    .btn-share-link { font-size: 0.92em; }

    .result-emoji { font-size: 3.2em; }
    .result-title { font-size: 1.3em; }
    .result-desc { font-size: 0.92em; padding: 14px 16px; line-height: 1.7; }

    .prediction-bar .label-row { font-size: 0.82em; }
    .prediction-bar .bar-bg { height: 10px; }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 0;
    }

    #info { padding: 50px 16px; }
    #info h2 { font-size: 1.6em; }
    .info-item { padding: 22px 16px; }
    .info-icon { font-size: 2em; }

    #about { padding: 50px 16px; }
    #about h2 { font-size: 1.6em; }
    .about-text p { font-size: 0.9em; }

    #tips { padding: 50px 16px; }
    #tips h2 { font-size: 1.6em; }
    .tips-grid { grid-template-columns: 1fr; gap: 14px; }
    .tip-item { padding: 22px 18px; }

    #faq { padding: 50px 16px; }
    #faq h2 { font-size: 1.6em; }
    .faq-item summary { padding: 14px 18px; font-size: 0.9em; }
    .faq-item p { padding: 0 18px 14px; font-size: 0.85em; }

    .footer-top { flex-direction: column; gap: 20px; align-items: center; text-align: center; }
    .footer-links { align-items: center; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 12px; }
    footer { padding: 30px 16px 20px; }

    #disclaimer { padding: 24px 16px; }
    .disclaimer-content p { font-size: 0.75em; }

    .float-emoji { font-size: 1.8em; }

    .policy-modal { padding: 10px; }
    .policy-modal-content { max-height: 90vh; }
}

@media (max-width: 380px) {
    .hero-content h2 { font-size: 1.7em; }
    .logo h1 { font-size: 2.5em; }
    .detector-card { padding: 16px 12px; }
    .result-emoji { font-size: 2.8em; }
    .result-title { font-size: 1.15em; }
}

/* ===== 쿠키 동의 배너 ===== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(26, 16, 8, 0.97);
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
    display: flex;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.cookie-banner-inner {
    max-width: 960px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.cookie-text {
    flex: 1;
    min-width: 200px;
}
.cookie-text strong {
    display: block;
    color: var(--accent-light);
    font-size: 0.95rem;
    margin-bottom: 4px;
}
.cookie-text p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}
.cookie-text a {
    color: var(--accent-light);
    text-decoration: underline;
}
.cookie-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}
.cookie-btn {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    border: none;
    font-family: inherit;
}
.cookie-btn-accept {
    background: var(--accent);
    color: #fff;
}
.cookie-btn-accept:hover {
    background: var(--accent-dark);
}
.cookie-btn-more {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    display: inline-block;
    line-height: 1;
}
.cookie-btn-more:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}
@media (max-width: 600px) {
    .cookie-banner-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* ===== AI 기술 소개 섹션 ===== */
#ai-info {
    padding: 60px 24px;
    background: var(--bg-secondary);
}

/* ═══════════ 주간 랭킹 ═══════════ */
#ranking {
    padding: 80px 24px;
    text-align: center;
    position: relative;
    z-index: 1;
}

#ranking h2 {
    font-size: 2.2em;
    font-weight: 900;
    letter-spacing: 0.04em;
    margin-bottom: 0.6em;
}

.ranking-week {
    font-size: 0.9em;
    color: var(--accent-light);
    font-weight: 700;
    margin-bottom: 1.4em;
}

.btn-ranking {
    margin-top: 10px;
    width: 100%;
    background: linear-gradient(135deg, #F5A623, #E8621C);
    color: #fff;
    font-size: 1.05em;
}
.btn-ranking:hover { transform: translateY(-3px) scale(1.02); }
.btn-ranking:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ranking-tabs {
    display: inline-flex;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 6px;
    margin-bottom: 28px;
}

.ranking-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.95em;
    font-weight: 700;
    padding: 10px 22px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s;
}
.ranking-tab.active {
    background: linear-gradient(135deg, #E8621C, #C0392B);
    color: #fff;
}
.ranking-board[data-cat="modern"] ~ .ranking-tabs .ranking-tab,
.ranking-tab[data-cat="modern"].active {
    /* modern 탭 활성 시 색조 */
}

.ranking-boards {
    max-width: 520px;
    margin: 0 auto;
}

.ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.ranking-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 10px;
    transition: transform 0.2s;
}
.ranking-row:hover { transform: translateX(4px); }
.ranking-row.primitive { border-left: 4px solid var(--primitive-color); }
.ranking-row.modern { border-left: 4px solid var(--modern-color); }

.ranking-rank {
    font-size: 1.4em;
    min-width: 36px;
    text-align: center;
    flex-shrink: 0;
}
.ranking-rank .rank-num {
    display: inline-block;
    font-size: 0.62em;
    font-weight: 700;
    color: var(--text-secondary);
}

.ranking-photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.ranking-name {
    flex: 1;
    font-weight: 700;
    font-size: 0.98em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-score {
    font-weight: 900;
    font-size: 1.05em;
    flex-shrink: 0;
}
.ranking-row.primitive .ranking-score { color: var(--primitive-color); }
.ranking-row.modern .ranking-score { color: var(--modern-color); }

.ranking-empty {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9em;
    font-weight: 300;
    padding: 40px 16px;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: 14px;
    line-height: 1.7;
}

.ranking-hint {
    margin-top: 24px;
    font-size: 0.85em;
    color: var(--text-secondary);
    font-weight: 300;
}
.ranking-hint strong { color: var(--accent-light); }

/* ── 랭킹 등록 모달 ── */
.ranking-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.ranking-modal.hidden { display: none; }

.ranking-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.ranking-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
}
.ranking-modal-header h2 { font-size: 1.2em; font-weight: 700; }

.ranking-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.6em;
    cursor: pointer;
    line-height: 1;
}
.ranking-modal-close:hover { color: var(--text-primary); }

.ranking-modal-body {
    padding: 22px;
    text-align: center;
}

.ranking-modal-preview {
    width: 120px;
    height: 120px;
    border-radius: 16px;
    object-fit: cover;
    border: 2px solid var(--border-color);
    margin: 0 auto 14px;
    display: block;
    background: var(--bg-secondary);
}

.ranking-modal-category {
    font-weight: 900;
    font-size: 1.1em;
    color: var(--accent-light);
    margin-bottom: 18px;
}

.ranking-field {
    display: block;
    text-align: left;
    margin-bottom: 16px;
}
.ranking-field span {
    display: block;
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 700;
}
.ranking-field input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1em;
}
.ranking-field input:focus {
    outline: none;
    border-color: var(--accent);
}

.ranking-consent-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    font-size: 0.82em;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 18px;
    cursor: pointer;
}
.ranking-consent-row input {
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.ranking-modal-note {
    margin-top: 14px;
    font-size: 0.75em;
    color: var(--text-secondary);
    opacity: 0.8;
    line-height: 1.5;
}

@media (max-width: 768px) {
    #ranking { padding: 50px 16px; }
    #ranking h2 { font-size: 1.6em; }
    .ranking-tab { padding: 9px 16px; font-size: 0.85em; }
    .ranking-photo { width: 42px; height: 42px; }
    .ranking-name { font-size: 0.9em; }
}

/* ═══════════ 원시인 타로 ═══════════ */
#tarot {
    padding: 80px 24px;
    text-align: center;
    background: var(--bg-secondary);
    position: relative;
    z-index: 1;
}

#tarot h2 {
    font-size: 2.2em;
    font-weight: 900;
    letter-spacing: 0.04em;
    margin-bottom: 0.6em;
}

.tarot-intro {
    margin: 0 auto 24px;
}
.tarot-webtoon {
    max-width: 220px;
    width: 100%;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}
.tarot-shaman-fallback {
    font-size: 3.5em;
    opacity: 0.9;
}

.tarot-stage {
    max-width: 560px;
    margin: 0 auto;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ── 펼쳐진 카드 덱 ── */
.tarot-deck {
    position: relative;
    width: 100%;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

.tarot-back {
    --i: 0;
    --n: 7;
    position: absolute;
    width: 110px;
    height: 170px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    background: linear-gradient(145deg, #3a2a18, #241809);
    border: 2px solid var(--accent-light);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateX(0) rotate(0deg);
    transition: transform 0.55s cubic-bezier(.2,.8,.3,1), opacity 0.4s, box-shadow 0.25s;
}

/* 펼쳐진 상태(부채꼴) */
.tarot-deck.dealt .tarot-back {
    opacity: 1;
    /* 중앙 기준으로 좌우로 펼침 */
    transform:
        translateX(calc((var(--i) - (var(--n) - 1) / 2) * 62px))
        translateY(calc(abs(var(--i) - (var(--n) - 1) / 2) * 6px))
        rotate(calc((var(--i) - (var(--n) - 1) / 2) * 7deg));
}

.tarot-deck.dealt .tarot-back:hover {
    transform:
        translateX(calc((var(--i) - (var(--n) - 1) / 2) * 62px))
        translateY(-18px)
        rotate(calc((var(--i) - (var(--n) - 1) / 2) * 7deg))
        scale(1.06);
    box-shadow: 0 14px 34px var(--accent-glow);
    z-index: 5;
}

.tarot-deck.chosen .tarot-back { opacity: 0; pointer-events: none; }

.tarot-back-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.tarot-back-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 2.6em;
    color: var(--accent-light);
}

/* ── 공개된 카드 ── */
.tarot-result {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tarot-card-reveal {
    width: 180px;
    height: 270px;
    border-radius: 16px;
    overflow: hidden;
    border: 3px solid var(--accent-light);
    box-shadow: 0 16px 48px var(--accent-glow);
    margin-bottom: 20px;
    background: linear-gradient(160deg, #2C2418, #1A1008);
}

.tarot-card-reveal.flip-in {
    animation: tarotFlip 0.7s cubic-bezier(.2,.8,.3,1);
}
@keyframes tarotFlip {
    0% { transform: rotateY(90deg) scale(0.9); opacity: 0; }
    60% { transform: rotateY(-8deg) scale(1.02); opacity: 1; }
    100% { transform: rotateY(0) scale(1); opacity: 1; }
}

.tarot-card-face {
    width: 100%;
    height: 100%;
}
.tarot-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.tarot-card-emoji {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 5em;
}

.tarot-card-name {
    font-size: 1.6em;
    font-weight: 900;
    color: var(--accent-light);
    margin-bottom: 6px;
}
.tarot-card-keywords {
    font-size: 0.9em;
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}
.tarot-card-fortune {
    max-width: 460px;
    font-size: 1em;
    line-height: 1.8;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 22px;
}

@media (max-width: 768px) {
    #tarot { padding: 50px 16px; }
    #tarot h2 { font-size: 1.6em; }
    .tarot-deck { height: 230px; }
    .tarot-back { width: 84px; height: 130px; }
    .tarot-deck.dealt .tarot-back {
        transform:
            translateX(calc((var(--i) - (var(--n) - 1) / 2) * 44px))
            translateY(calc(abs(var(--i) - (var(--n) - 1) / 2) * 5px))
            rotate(calc((var(--i) - (var(--n) - 1) / 2) * 7deg));
    }
    .tarot-deck.dealt .tarot-back:hover {
        transform:
            translateX(calc((var(--i) - (var(--n) - 1) / 2) * 44px))
            translateY(-14px)
            rotate(calc((var(--i) - (var(--n) - 1) / 2) * 7deg))
            scale(1.06);
    }
    .tarot-card-reveal { width: 150px; height: 225px; }
    .tarot-card-name { font-size: 1.35em; }
    .tarot-card-fortune { font-size: 0.92em; padding: 14px 16px; }
}
