/* 나의 외국 이름 — 여권·이름표 느낌의 깔끔한 카드
   Layout: 연한 하늘빛 바닥 위 한 단. 이름 카드는 나라마다 다른 옅은 띠색과 그 나라 글씨체(영어 이탤릭, 중국어 붓글씨, 일본어 붓글씨, 베트남어 굵은 고딕).
   한 가지 모습으로 고정 */
:root {
  color-scheme: light;
  --bg: #EEF3FB;       /* 바닥 */
  --card: #FFFFFF;     /* 카드 */
  --ink: #141A26;      /* 글자 */
  --muted: #5B6475;    /* 보조 */
  --line: #E3E7EE;     /* 선 */
  --accent: #2F6BFF;   /* 버튼 */
  --en: #2F6BFF; --zh: #D8432E; --ja: #C2457A; --vi: #1E8A57;   /* 나라별 띠색 */
  --f-body: "Gowun Dodum", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.65; padding-inline: 16px; padding-block: 16px 40px; word-break: keep-all; overflow-wrap: anywhere; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.page { max-width: 480px; margin: 0 auto; display: grid; gap: 20px; }
.tohub { justify-self: start; font-size: 14px; color: var(--muted); text-decoration: none; }
.tohub:hover { color: var(--accent); }
.screen { display: grid; gap: 16px; }
.kicker { margin: 0; text-align: center; font-family: "Be Vietnam Pro", sans-serif; font-weight: 800; font-size: 13px; letter-spacing: .2em; color: var(--accent); }
.title { margin: 0; text-align: center; font-weight: 400; font-size: clamp(32px, 9vw, 40px); line-height: 1.2; }
.sample { margin: -6px 0 0; text-align: center; font-size: 52px; line-height: 1.1; color: var(--muted); opacity: .8; }
.s-en .nc-big, .sample.s-en { font-family: "Playfair Display", serif; font-style: italic; font-weight: 700; }
.s-zh .nc-big, .sample.s-zh { font-family: "Ma Shan Zheng", "Noto Serif KR", serif; }
.s-ja .nc-big, .sample.s-ja { font-family: "Yuji Syuku", "Noto Serif KR", serif; }
.s-vi .nc-big, .sample.s-vi { font-family: "Be Vietnam Pro", sans-serif; font-weight: 800; letter-spacing: -.01em; }
.hook { margin: 0; text-align: center; color: var(--muted); text-wrap: balance; }
.form { display: grid; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; }
.field > span, .field legend { font-size: 14px; font-weight: 700; padding: 0; }
input[type="text"], select { width: 100%; min-height: 48px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; padding: 10px 12px; font-size: 16px; }
input[type="text"]:focus, select:focus { border-color: var(--accent); outline: none; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: grid; place-items: center; min-height: 44px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-size: 14px; cursor: pointer; }
.seg input:checked + span { border-color: var(--accent); background: var(--accent); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.err { margin: 0; color: #C2412E; font-size: 14px; }
.btn { appearance: none; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; min-height: 54px; padding: 12px 18px;
  border-radius: 14px; background: var(--accent); color: #fff; font-size: 17px; font-weight: 700; box-shadow: 0 6px 16px rgba(47, 107, 255, .25); }
.btn:active { transform: translateY(2px); }
.btn.ghost { background: var(--card); color: var(--ink); border: 1.5px solid var(--line); box-shadow: none; }
.note { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.loading { justify-items: center; padding: 40px 0; text-align: center; }
.brush { width: 220px; height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.brush i { display: block; height: 100%; width: 40%; border-radius: 99px; background: var(--accent); animation: go 1s ease-in-out infinite; }
@keyframes go { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.loading p { margin: 0; }

.namecard { display: grid; gap: 12px; }
.nc-paper { --band: var(--en); position: relative; background: var(--card); border-radius: 20px; padding: 26px 18px 24px; text-align: center; border: 1px solid var(--line); overflow: hidden; box-shadow: 0 10px 30px rgba(20, 26, 38, .06); }
.nc-paper::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: var(--band); }
.nc-paper.s-zh { --band: var(--zh); } .nc-paper.s-ja { --band: var(--ja); } .nc-paper.s-vi { --band: var(--vi); }
.nc-flag { margin: 0; font-family: "Be Vietnam Pro", sans-serif; font-weight: 800; font-size: 12px; letter-spacing: .2em; color: var(--band); }
.nc-big { margin: 6px 0 0; font-size: clamp(48px, 14vw, 66px); line-height: 1.12; }
.s-zh .nc-big { font-size: clamp(66px, 20vw, 92px); }
.s-ja .nc-big { font-size: clamp(56px, 17vw, 78px); }
.nc-ko { margin: 6px 0 0; font-size: 22px; font-weight: 700; }
.nc-sub { margin: 4px 0 0; font-family: "Be Vietnam Pro", "Noto Serif KR", sans-serif; font-weight: 600; font-size: 15px; color: var(--muted); }
.nc-line { margin: 0; text-align: center; font-size: 17px; text-wrap: balance; }
.nc-rows { margin: 0; display: grid; gap: 6px; }
.nc-rows div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.nc-rows dt { display: grid; justify-items: center; text-align: center; }
.nc-rows .ch { font-family: "Be Vietnam Pro", "Noto Serif KR", serif; font-weight: 800; font-size: 20px; line-height: 1.2; }
.nc-rows small { font-size: 12px; color: var(--muted); }
.nc-rows dd { margin: 0; font-size: 15px; display: grid; gap: 2px; }
.nc-rows dd span { font-size: 13px; color: var(--muted); font-family: "Be Vietnam Pro", "Noto Serif KR", sans-serif; }
.listen { justify-self: center; appearance: none; cursor: pointer; border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 6px 16px; font-size: 14px; }
.listen:hover { border-color: var(--accent); }
.actions { display: grid; gap: 10px; }
.sharebox { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 14px; resize: none; background: #fff; }
.ribbon { justify-self: center; margin: 0; padding: 4px 14px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 14px; }

.others h2, .about h2, .index h2, .pairs h2 { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.olist { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.page > .olist, .others .olist:only-child { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.olist a { display: grid; gap: 4px; justify-items: center; text-align: center; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 6px; border-top: 5px solid var(--en); }
.olist .o-zh { border-top-color: var(--zh); } .olist .o-ja { border-top-color: var(--ja); } .olist .o-vi { border-top-color: var(--vi); }
.olist a span { font-size: 22px; line-height: 1.2; }
.olist .o-en span { font-family: "Playfair Display", serif; font-style: italic; font-weight: 700; }
.olist .o-zh span { font-family: "Ma Shan Zheng", serif; font-size: 28px; }
.olist .o-ja span { font-family: "Yuji Syuku", serif; }
.olist .o-vi span { font-family: "Be Vietnam Pro", sans-serif; font-weight: 800; font-size: 18px; }
.olist a b { font-size: 13px; font-weight: 400; color: var(--muted); }
.olist a:hover { border-color: var(--accent); }
.about, .index, .pairs { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px 18px 8px; }
.about p { margin: 0 0 16px; }
.index h3 { margin: 10px 0 6px; font-size: 13px; color: var(--muted); font-weight: 400; }
.index ul, .pairs ul { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.index a { display: inline-flex; gap: 6px; align-items: baseline; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; font-size: 14px; background: #fff; }
.index a b { font-family: "Be Vietnam Pro", "Noto Serif KR", sans-serif; font-weight: 800; }
.index a[aria-current] { border-color: var(--accent); background: var(--accent); color: #fff; }
.pairs li { border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px; font-size: 14px; background: #fff; }
.pairs li b { font-family: "Be Vietnam Pro", "Noto Serif KR", sans-serif; margin-right: 4px; }
.ad { border: 1px dashed #C9D2E0; border-radius: 12px; min-height: 90px; display: grid; place-items: center; font-size: 12px; letter-spacing: .1em; color: #8A93A3; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 99px; padding: 10px 18px; font-size: 14px; z-index: 5; max-width: calc(100% - 32px); text-align: center; }
.foot { max-width: 480px; margin: 22px auto 0; text-align: center; font-size: 12.5px; color: var(--muted); }
.foot p { margin: 4px 0; }
.foot a { color: inherit; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
