@import url("https://fonts.googleapis.com/css2?family=Gowun+Dodum&family=Nunito:wght@500;700;800&display=swap");

:root {
    --ink: #443b57;
    --muted: #756d86;
    --coral: #ff718a;
    --coral-dark: #e95470;
    --lavender: #8e78d8;
    --line: rgba(116, 91, 154, 0.14);
    --surface: rgba(255, 255, 255, 0.78);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    padding: 32px 20px;
    color: var(--ink);
    font-family: "Nunito", "Gowun Dodum", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 10% 12%, rgba(255, 211, 137, 0.72), transparent 25%),
        radial-gradient(circle at 88% 15%, rgba(203, 188, 255, 0.76), transparent 27%),
        radial-gradient(circle at 84% 88%, rgba(255, 184, 199, 0.58), transparent 26%),
        linear-gradient(145deg, #fffaf0 0%, #fff7fb 48%, #f4f0ff 100%);
    background-attachment: fixed;
}

body::before,
body::after {
    content: "";
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    filter: blur(2px);
}

body::before { width: 150px; height: 150px; left: -45px; bottom: 12%; background: rgba(135, 222, 202, 0.28); }
body::after { width: 110px; height: 110px; right: 5%; top: 6%; background: rgba(255, 255, 255, 0.55); }

.app {
    width: min(100%, 960px);
    margin: 0 auto;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 30px;
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(105, 80, 140, 0.14), inset 0 1px 0 #fff;
    backdrop-filter: blur(18px);
}

.topbar { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; }
.topbar > a:not(.lang-link) { color: var(--muted); font-weight: 800; text-decoration: none; }
.topbar > a:not(.lang-link):hover { color: var(--coral-dark); }
.lang-link {
    padding: 8px 14px;
    color: var(--lavender);
    border: 1px solid #ded4f7;
    border-radius: 999px;
    background: #fff;
    font-weight: 800;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease;
}
.lang-link:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(142, 120, 216, .18); }

h1 { margin: 4px 0 10px; font-size: clamp(2rem, 5vw, 3.15rem); line-height: 1.15; letter-spacing: -.04em; }
h2 { color: #514260; font-size: clamp(1.55rem, 4vw, 2.2rem); }
.intro { max-width: 650px; margin: 0 0 28px; color: var(--muted); font-size: 1.04rem; line-height: 1.75; }
.screen { padding-top: 8px; }
.hidden { display: none; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.test-card {
    position: relative;
    overflow: hidden;
    min-height: 168px;
    padding: 20px;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 10px 28px rgba(96, 74, 128, .08);
    cursor: pointer;
    text-align: left;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.test-card::after { content: "→"; position: absolute; right: 18px; bottom: 14px; color: #c2b3d7; font-size: 1.2rem; }
.test-card:nth-child(3n+1) { background: linear-gradient(145deg, #fff, #fff6df); }
.test-card:nth-child(3n+2) { background: linear-gradient(145deg, #fff, #f5efff); }
.test-card:nth-child(3n) { background: linear-gradient(145deg, #fff, #fff0f4); }
.test-card:hover { transform: translateY(-6px); border-color: rgba(255, 113, 138, .35); box-shadow: 0 18px 35px rgba(96, 74, 128, .14); }
.test-card:focus-visible, .option-btn:focus-visible, .btn:focus-visible, .lang-link:focus-visible { outline: 3px solid rgba(255, 113, 138, .35); outline-offset: 3px; }
.test-emoji { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 16px; background: rgba(255,255,255,.78); font-size: 1.8rem; box-shadow: 0 6px 16px rgba(95, 70, 125, .1); }
.test-title { margin-bottom: 7px; font-size: 1.06rem; font-weight: 800; }
.test-desc { padding-right: 10px; color: var(--muted); font-size: .92rem; line-height: 1.55; }

.quiz-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 24px; color: var(--lavender); font-weight: 800; }
.option-list { display: grid; gap: 13px; margin-top: 22px; }
.option-btn {
    width: 100%;
    padding: 17px 18px;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 17px;
    background: rgba(255,255,255,.9);
    box-shadow: 0 6px 18px rgba(94, 70, 125, .06);
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.option-btn:hover { transform: translateX(5px); border-color: #ffb0be; background: #fff7f9; }

.btn { padding: 11px 17px; border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 800; transition: transform .18s ease, box-shadow .18s ease; }
.btn:hover { transform: translateY(-2px); }
.primary { color: #fff; background: linear-gradient(135deg, var(--coral), #ff8f72); box-shadow: 0 9px 20px rgba(233, 84, 112, .25); }
.secondary { color: #6b5789; border: 1px solid #e3d9f2; background: #fff; }

.result-card { padding: clamp(22px, 5vw, 38px); border: 1px solid rgba(255,255,255,.9); border-radius: 25px; background: linear-gradient(145deg, rgba(255,255,255,.94), rgba(255,241,246,.86)); box-shadow: 0 18px 45px rgba(107, 78, 137, .12); }
.result-card h2 { margin-top: 0; }
.result-badge { display: inline-block; margin: 4px 0 14px; padding: 9px 14px; color: #c34560; border-radius: 999px; background: #ffe5eb; font-weight: 800; }
.result-advice { color: #685d78; line-height: 1.7; }
.result-block { margin-top: 12px; padding: 14px 16px; border: 1px solid rgba(142,120,216,.1); border-radius: 15px; background: rgba(255,255,255,.7); line-height: 1.55; }
.result-label { margin-bottom: 5px; color: var(--lavender); font-weight: 800; }
.result-mbti { margin-top: 10px; color: var(--coral-dark); font-weight: 800; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.editorial { display: grid; gap: 16px; margin-top: 42px; }
.editorial section { padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.66); }
.editorial h2 { margin: 0 0 8px; font-size: 1.3rem; }
.editorial p, .content-page p, .content-page li { color: var(--muted); line-height: 1.78; }
.site-footer { margin-top: 38px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; text-align: center; }
.site-footer div { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; }
.site-footer a, .content-page a { color: #725bb5; }
.content-page { max-width: 760px; margin: 0 auto; }
.content-page h1 { margin-top: 20px; }
.content-page h2 { margin: 30px 0 8px; font-size: 1.35rem; }
.content-page .updated { margin-bottom: 28px; color: #8d8498; font-size: .9rem; }
.notice { padding: 16px 18px; border-left: 4px solid #ff8aa0; border-radius: 10px; background: #fff5f7; }

@media (max-width: 760px) {
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
    body { padding: 14px; }
    .app { padding: 20px 17px; border-radius: 23px; }
    .grid { grid-template-columns: 1fr; }
    .test-card { min-height: 145px; }
    .quiz-header { align-items: flex-start; }
    .actions .btn { flex: 1; }
    .topbar { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
