:root {
  --bg: #f7fbff;
  --surface: #ffffff;
  --surface-2: #eef8ff;
  --text: #172033;
  --muted: #5f6f85;
  --line: #d8e6f3;
  --primary: #1e88e5;
  --primary-dark: #0f63b6;
  --mint: #16c7b7;
  --mint-soft: #dff9f6;
  --shadow: 0 18px 45px rgba(26, 87, 132, 0.12);
  --radius: 10px;
  --max: 1120px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", Roboto, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #fff 0%, var(--bg) 52%, #fff 100%);
  line-height: 1.68;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary-dark); }
button, input, textarea, select { font: inherit; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 14px max(24px, calc((100vw - var(--max)) / 2));
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; color: #fff; background: linear-gradient(135deg, var(--primary), var(--mint)); border-radius: var(--radius); box-shadow: 0 8px 20px rgba(30,136,229,.24); }
.main-nav { display: flex; align-items: center; justify-content: flex-end; gap: 4px; flex-wrap: wrap; }
.main-nav a { padding: 8px 10px; border-radius: var(--radius); color: var(--muted); font-weight: 800; font-size: .92rem; }
.main-nav a.active, .main-nav a:hover { color: var(--primary-dark); background: var(--surface-2); }
.nav-toggle { display: none; }
main { width: 100%; overflow: hidden; }
.hero, .page-hero, .section { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr); gap: 32px; align-items: center; padding: 64px 0 42px; min-height: calc(100vh - 130px); }
.hero h1, .page-hero h1 { margin: 0; font-size: clamp(2.25rem, 6vw, 4.8rem); line-height: 1.05; letter-spacing: 0; }
.hero-copy p, .page-hero p { color: var(--muted); font-size: 1.08rem; max-width: 780px; }
.hero-actions, .button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--radius); font-weight: 900; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: linear-gradient(135deg, var(--primary), var(--mint)); box-shadow: 0 12px 28px rgba(30,136,229,.24); }
.button.secondary { color: var(--primary-dark); background: #fff; border-color: var(--line); }
.button.ghost { color: var(--muted); background: var(--surface-2); border-color: var(--line); }
.hero-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 24px; background: linear-gradient(135deg, rgba(30,136,229,.08), rgba(22,199,183,.12)), #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.spark-card { min-height: 108px; display: grid; place-items: center; padding: 18px; color: var(--primary-dark); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); font-weight: 900; text-align: center; box-shadow: 0 10px 28px rgba(16,83,134,.08); }
.spark-card:nth-child(2), .spark-card:nth-child(3) { color: #087a72; background: var(--mint-soft); }
.page-hero { padding: 52px 0 20px; }
.page-hero.compact h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
.eyebrow { margin: 0 0 8px; color: var(--primary-dark); font-size: .82rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.section { padding: 32px 0; }
.section-heading { margin-bottom: 18px; }
.section-heading h2, .content-panel h2, .guide-card h2, .side-list h2, .two-column h2, .article-section h2, .faq-section h2 { margin: 0 0 10px; font-size: clamp(1.35rem, 3vw, 2rem); line-height: 1.25; letter-spacing: 0; }
.section-heading p { color: var(--muted); margin: 0; }
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tool-card, .article-card, .mini-card, .content-panel, .guide-card, .generator-card, .question-card, .roulette-visual, .side-list, .luck-card, .test-panel, .two-column > div, .faq-grid article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 34px rgba(18,78,122,.08); }
.tool-card { display: flex; min-height: 180px; flex-direction: column; gap: 10px; padding: 18px; transition: transform .18s ease, box-shadow .18s ease; }
.tool-card:hover, .article-card:hover, .mini-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tool-icon { display: grid; place-items: center; width: 42px; height: 42px; color: var(--primary-dark); background: var(--surface-2); border-radius: var(--radius); font-weight: 900; }
.tool-card span:last-child, .article-card p, .mini-card span, .side-list span { color: var(--muted); }
.split-section, .tool-workspace { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); gap: 18px; align-items: start; }
.content-panel, .guide-card, .generator-card, .side-list, .test-panel, .luck-card, .two-column > div, .faq-grid article { padding: 24px; }
.content-panel p, .article-section p { margin: 0 0 16px; color: #26364b; }
.content-panel a, .article-section a { color: var(--primary-dark); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.side-list ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.side-list li { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.side-list a { display: block; color: var(--primary-dark); font-weight: 900; }
.article-grid, .mini-grid, .faq-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.article-card, .mini-card { display: block; padding: 20px; transition: transform .18s ease, box-shadow .18s ease; }
.article-card h3, .faq-grid h3, .article-section h3 { margin: 0 0 8px; line-height: 1.3; letter-spacing: 0; }
.mini-card strong { display: block; margin-bottom: 6px; color: var(--primary-dark); }
.control-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 8px; }
label { display: block; margin: 0 0 7px; color: var(--text); font-weight: 900; }
select, input, textarea { width: 100%; padding: 12px 13px; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); outline: none; }
select:focus, input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(30,136,229,.12); }
textarea { resize: vertical; min-height: 180px; }
.result-box { margin-top: 18px; min-height: 130px; padding: 18px; background: linear-gradient(180deg, #fff, #f3fbff); border: 1px dashed #a9cde9; border-radius: var(--radius); }
.result-box.flash, .question-card.flash, .luck-card.flash { animation: pop .28s ease; }
@keyframes pop { from { transform: translateY(4px); opacity: .65; } to { transform: translateY(0); opacity: 1; } }
.result-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.result-list li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); font-weight: 900; }
.name-meaning { color: var(--muted); font-weight: 700; font-size: .9rem; text-align: right; }
.muted { color: var(--muted); }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.check-list, .warning-list, .step-list { padding-left: 20px; margin: 0; }
.check-list li, .warning-list li, .step-list li { margin-bottom: 10px; }
.warning-list li::marker { color: #0f8f82; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 0; margin: 0; list-style: none; }
.tag-list li { padding: 8px 10px; color: var(--primary-dark); background: var(--surface-2); border-radius: var(--radius); font-weight: 900; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { padding: 8px 12px; color: var(--primary-dark); background: #fff; border: 1px solid var(--line); border-radius: 999px; font-weight: 900; cursor: pointer; }
.chip.active, .chip:hover { color: #fff; background: var(--primary); border-color: var(--primary); }
.game-panel, .test-panel, .luck-panel { display: grid; gap: 16px; }
.question-card { min-height: 140px; padding: 28px; display: grid; place-items: center; text-align: center; font-size: clamp(1.3rem, 4vw, 2.1rem); font-weight: 900; line-height: 1.35; }
.roulette-visual { min-height: 320px; padding: 24px; display: grid; place-items: center; text-align: center; gap: 16px; }
.wheel { display: grid; place-items: center; width: 180px; height: 180px; border-radius: 50%; color: #fff; background: conic-gradient(from 0deg, var(--primary), var(--mint), #72a8ff, #13b39f, var(--primary)); box-shadow: 0 20px 36px rgba(30,136,229,.24); font-size: 2.5rem; font-weight: 900; }
.wheel.spin { animation: spin .9s cubic-bezier(.18,.78,.24,1); }
@keyframes spin { from { transform: rotate(0deg) scale(.96); } to { transform: rotate(1080deg) scale(1); } }
.team-result { margin: 0; min-height: 320px; }
.team-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.team-box { padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.team-box strong { display: block; margin-bottom: 8px; color: var(--primary-dark); }
.answer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.answer-grid button { min-height: 68px; padding: 14px; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); font-weight: 900; cursor: pointer; text-align: left; }
.answer-grid button:hover { border-color: var(--primary); box-shadow: 0 10px 24px rgba(30,136,229,.12); }
.progress { color: var(--muted); font-weight: 900; }
.luck-card { max-width: 940px; margin: 0 auto; background: linear-gradient(135deg, rgba(30,136,229,.09), rgba(22,199,183,.12)), #fff; }
.luck-card h2 { margin: 0 0 8px; font-size: clamp(1.7rem, 4vw, 2.5rem); letter-spacing: 0; }
.luck-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 22px 0; }
.luck-grid div { padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.luck-grid span { display: block; margin-bottom: 6px; color: var(--muted); font-size: .9rem; font-weight: 900; }
.article-page { width: min(860px, calc(100% - 32px)); margin: 0 auto; }
.ad-section { display: flex; justify-content: center; align-items: center; min-height: 124px; padding-top: 16px; padding-bottom: 16px; }
.ad-section .kakao_ad_area { margin: 0 auto; }
.article-page .page-hero { width: 100%; }
.article-section { padding: 24px 0; border-bottom: 1px solid var(--line); }
.site-footer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .8fr); gap: 24px; width: min(var(--max), calc(100% - 32px)); margin: 42px auto 0; padding: 28px 0 36px; color: var(--muted); border-top: 1px solid var(--line); }
.site-footer strong { color: var(--text); }
.site-footer p { margin: 6px 0 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: flex-end; }
.footer-links a { color: var(--muted); font-weight: 900; }
.footer-small, .site-note { font-size: .9rem; }
.footer-nav-wrap { text-align: right; }
code { padding: 1px 5px; background: var(--surface-2); border-radius: 6px; }
@media (max-width: 960px) {
  .site-header { align-items: flex-start; flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 12px; color: var(--primary-dark); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); font-weight: 900; }
  .main-nav { display: none; width: 100%; justify-content: flex-start; }
  .main-nav.open { display: flex; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 38px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-section, .tool-workspace, .two-column { grid-template-columns: 1fr; }
  .article-grid, .mini-grid, .faq-grid, .luck-grid { grid-template-columns: 1fr; }
  .site-footer { grid-template-columns: 1fr; }
  .footer-nav-wrap { text-align: left; }
  .footer-links { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .site-header { padding-left: 16px; padding-right: 16px; }
  .hero, .page-hero, .section, .article-page, .site-footer { width: min(100% - 24px, var(--max)); }
  .hero-panel, .tool-grid, .answer-grid { grid-template-columns: 1fr; }
  .hero h1, .page-hero h1 { font-size: 2.35rem; }
  .button { width: 100%; }
  .result-list li { display: grid; }
  .name-meaning { text-align: left; }
}
