/* 우리의 2027 — 양떼 들판. 그림만 도트, 글씨는 일반 고딕. 그림자·그라디언트 쓰지 않음. */
:root {
  --paper: #f6f5f1; --ink: #1d1b19; --ink-2: #3e3a36; --ink-3: #5e5a55; --ink-4: #6f6a64;
  --rule: #e2dfd8; --rule-2: #cfcbc3; --white: #fff;
  --grass: #b4c590; --sky: #d9e7ea;
  --warm: #b9501e; --clash: #2f5a8f;
  --sans: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--sans); letter-spacing: -0.01em; word-break: keep-all; overflow-wrap: anywhere; }
h1, h2, p, ol, ul, dl, dd, fieldset { margin: 0; padding: 0; }
ol, ul { list-style: none; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--warm); outline-offset: 2px; }
.wrap { width: 100%; max-width: 520px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 12px; top: 12px; z-index: 50; padding: 8px 14px; background: var(--ink); color: var(--paper); }
[hidden] { display: none !important; }

/* 머리 */
.top { border-bottom: 1px solid var(--rule); }
.top-in { display: flex; align-items: center; gap: 8px; min-height: 52px; font-size: 15px; }
.top a { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.top-jeom { font-weight: 800; }
.top-sep { color: var(--rule-2); }
.top-here { color: var(--ink-3); }

/* 공통 글 */
.kicker { margin-top: 28px; font-size: 14px; font-weight: 700; color: var(--warm); }
h1 { margin-top: 10px; font-size: 28px; line-height: 1.32; font-weight: 800; letter-spacing: -0.035em; }
.lede { margin-top: 10px; font-size: 15px; color: var(--ink-3); }
.lede.small { font-size: 14px; }
.fine { margin-top: 12px; font-size: 14px; line-height: 1.5; color: var(--ink-4); text-align: center; }
.sec { margin: 40px 0 12px; font-size: 14px; font-weight: 800; color: var(--ink-3); }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 18px; border-radius: 8px; border: 0; cursor: pointer; font-weight: 700; font-size: 16px; text-decoration: none; }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn-main { width: 100%; margin-top: 20px; background: var(--ink); color: var(--paper); font-weight: 800; }
.btn-main:hover { background: #33302c; }
.btn-main:disabled { background: #a9a59e; cursor: default; }
.btn-line { min-height: 48px; background: var(--white); border: 1px solid var(--rule-2); font-size: 15px; font-weight: 600; }
.btn-line:hover { border-color: var(--ink-3); }
.btn-ghost { width: 100%; min-height: 48px; margin-top: 8px; background: transparent; border: 1px dashed var(--rule-2); color: var(--ink-2); font-size: 15px; font-weight: 600; }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-small { flex: none; min-height: 44px; padding: 0 14px; background: var(--paper); color: var(--ink); font-size: 14px; font-weight: 800; white-space: nowrap; }

/* 들판 */
.field { position: relative; width: 100%; aspect-ratio: 1000 / 1120; margin-top: 20px; border-radius: 12px; overflow: hidden; background: var(--grass); user-select: none; -webkit-user-select: none; }
.field-mini { aspect-ratio: 1000 / 560; margin-top: 16px; }
.field > svg.decor, .field > svg.links { position: absolute; inset: 0; width: 100%; height: 100%; }
.sheep { position: absolute; display: flex; flex-direction: column; align-items: center; padding: 0; border: 0; background: none; cursor: default; transition: left .6s cubic-bezier(.3,.7,.2,1), top .6s cubic-bezier(.3,.7,.2,1); }
button.sheep { cursor: pointer; }
.sheep svg { display: block; width: 100%; height: auto; }
button.sheep:hover svg, button.sheep:focus-visible svg { transform: translateY(-3%); }
.sheep .nm { margin-top: 2px; max-width: 140%; padding: 2px 9px; border-radius: 10px; background: var(--white); font-size: 13px; font-weight: 800; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.field-mini .sheep .nm { font-size: 12px; padding: 1px 7px; }
.tag { position: absolute; transform: translate(-50%, -50%); padding: 4px 7px; border-radius: 3px; color: var(--white); font-size: 12px; font-weight: 800; line-height: 1.3; white-space: nowrap; pointer-events: none; }
.tag.warm { background: var(--warm); }
.tag.clash { background: var(--clash); }
.links path { stroke-width: 3px; stroke-linecap: round; }
.links path.warm { stroke: var(--warm); }
.links path.clash { stroke: var(--clash); stroke-dasharray: 7 6; }

/* 걸어 들어오는 양 */
.sheep.walk-in { animation: walkIn .55s cubic-bezier(.3,.7,.2,1) both; }
@keyframes walkIn { from { opacity: 0; transform: translateX(-40%); } to { opacity: 1; transform: none; } }
.field.drawing .links path { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw .5s ease-out .6s forwards; }
.field.drawing .links path.clash { animation-name: drawDash; }
.field.drawing .tag { opacity: 0; animation: fade .2s ease-out 1.05s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes drawDash { 0% { stroke-dasharray: 1400; stroke-dashoffset: 1400; } 99% { stroke-dasharray: 1400; stroke-dashoffset: 0; } 100% { stroke-dasharray: 7 6; stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }

/* 모임 종류 */
.types { margin-top: 28px; border: 0; }
.types legend { padding: 0; font-size: 15px; font-weight: 800; }
.type-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.type { position: relative; }
.type input { position: absolute; opacity: 0; inset: 0; }
.type span { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 64px; border: 1px solid var(--rule-2); border-radius: 8px; background: var(--white); cursor: pointer; }
.type b { font-size: 16px; font-weight: 800; }
.type i { font-style: normal; font-size: 14px; color: var(--ink-4); }
.type input:checked + span { border: 2px solid var(--ink); }
.type input:checked + span i { color: var(--warm); font-weight: 700; }
.type input:focus-visible + span { outline: 2px solid var(--warm); outline-offset: 2px; }

.about { margin-top: 56px; padding-top: 28px; padding-bottom: 8px; border-top: 1px solid var(--rule); }
.about h2 { margin: 28px 0 10px; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.about h2:first-child { margin-top: 0; }
.about p { margin-top: 10px; font-size: 15px; color: var(--ink-2); }
.how { counter-reset: n; }
.how li { counter-increment: n; position: relative; padding: 10px 0 10px 36px; font-size: 15px; color: var(--ink-2); border-bottom: 1px solid var(--rule); }
.how li::before { content: counter(n); position: absolute; left: 0; top: 10px; width: 24px; height: 24px; border-radius: 3px; background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.how b { color: var(--ink); }

/* 멤버 넣기 */
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin-top: 12px; padding: 0; border: 0; background: none; color: var(--ink-3); font-size: 15px; cursor: pointer; }
.back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.h-step { margin-top: 4px; font-size: 24px; }
.gname { display: block; margin-top: 20px; }
.gname span { display: block; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.gname em { font-style: normal; font-weight: 400; color: var(--ink-4); }
.gname input, .mem input[type="text"] { width: 100%; min-height: 48px; margin-top: 6px; padding: 0 12px; border: 1px solid var(--rule-2); border-radius: 8px; background: var(--white); font-size: 16px; }
.gname input:focus, .mem input:focus { outline: none; border-color: var(--ink); }
.members { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.mem { display: grid; grid-template-columns: 40px minmax(0, 1fr) 44px; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--white); }
.mem-face { width: 40px; margin-top: 4px; }
.mem-face svg { display: block; width: 100%; height: auto; }
.mem-body { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr); gap: 8px; }
.mem input[type="text"] { margin-top: 0; padding: 0 10px; }
.mem .cal { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--rule-2); border-radius: 6px; overflow: hidden; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; font-size: 14px; color: var(--ink-3); cursor: pointer; }
.seg input:checked + span { background: var(--ink); color: var(--paper); font-weight: 700; }
.seg input:focus-visible + span { outline: 2px solid var(--warm); outline-offset: -2px; }
.leap { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 6px; font-size: 14px; color: var(--ink-3); }
.leap input { width: 18px; height: 18px; accent-color: var(--ink); }
.mem-x { width: 44px; height: 44px; border: 0; background: none; color: var(--ink-4); cursor: pointer; display: grid; place-items: center; }
.mem-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mem-x:disabled { visibility: hidden; }
.mem-msg { grid-column: 1 / -1; font-size: 14px; color: var(--warm); }
.mem.bad { border-color: var(--warm); }
.err { margin-top: 12px; font-size: 14px; font-weight: 700; color: var(--warm); }

/* 대기 */
.wait { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font-size: 15px; color: var(--ink-3); }
.wait-sheep { width: 96px; animation: hop .5s ease-in-out infinite alternate; }
.wait-sheep svg { display: block; width: 100%; height: auto; }
@keyframes hop { to { transform: translateY(-10px); } }

/* 결과 */
.shared-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 12px 12px 14px; border-radius: 8px; background: var(--ink); color: var(--paper); font-size: 14px; }
.pill { display: inline-block; margin-top: 24px; padding: 4px 8px; border-radius: 3px; background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 700; }
.h-result { margin-top: 12px; font-size: 26px; }
.legend { display: flex; gap: 18px; margin-top: 12px; font-size: 14px; color: var(--ink-3); }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg i { display: inline-block; width: 20px; height: 0; border-top: 3px solid var(--warm); }
.lg-clash i { border-top: 3px dashed var(--clash); }
.lg b { font-weight: 400; }
.rels { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.rels li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: baseline; font-size: 15px; color: var(--ink-2); }
.rels li b { font-size: 14px; font-weight: 800; color: var(--warm); }
.rels li.clash b { color: var(--clash); }

.awards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.aw { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 14px; border: 1px solid var(--rule); border-radius: 8px; background: var(--white); text-align: left; cursor: pointer; }
.aw:hover { border-color: var(--rule-2); }
.aw-who { display: flex; align-items: center; gap: 8px; }
.aw-who svg { width: 36px; height: auto; flex: none; }
.aw-who b { font-size: 16px; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aw-t { font-size: 14px; font-weight: 800; color: var(--warm); }
.aw-l { font-size: 14px; line-height: 1.5; color: var(--ink-2); }

.weather { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.weather li { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0 8px; border: 1px solid var(--rule); border-radius: 6px; background: var(--white); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.weather li.best { border: 2px solid var(--warm); padding: 9px 0 7px; }
.weather svg { width: 26px; height: 26px; }
.weather-note { margin-top: 12px; font-size: 15px; color: var(--ink-2); }

.actions { margin-top: 36px; }
.actions .btn-main { margin-top: 0; }
.act-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.toast { min-height: 22px; margin-top: 10px; font-size: 14px; font-weight: 700; color: var(--ink-2); text-align: center; }

.shop-list { display: flex; flex-direction: column; gap: 8px; }
.shop-item { display: grid; grid-template-columns: 72px minmax(0, 1fr) 20px; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--white); text-decoration: none; }
.shop-item img { width: 72px; height: 72px; border-radius: 6px; object-fit: cover; background: var(--rule); }
.shop-item b { display: block; font-size: 15px; }
.shop-item span span { display: block; font-size: 14px; color: var(--ink-3); line-height: 1.45; }
.shop-item svg { width: 18px; height: 18px; fill: none; stroke: var(--ink-4); stroke-width: 2; }
.shop-note { margin-top: 10px; font-size: 14px; color: var(--ink-4); }

.more { margin-top: 32px; }
.more-link { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 2px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); text-decoration: none; font-size: 15px; font-weight: 700; }
.more-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* 개인 카드 */
.card { width: min(440px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 0; border: 0; border-radius: 12px; background: var(--paper); color: var(--ink); }
.card::backdrop { background: rgba(29, 27, 25, .55); }
.card-in { position: relative; padding: 28px 20px 22px; }
.card-x { position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--ink-3); }
.card-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.card-sheep { width: 120px; margin: 0 auto; }
.card-sheep svg { display: block; width: 100%; height: auto; }
.card-award { margin-top: 12px; text-align: center; font-size: 14px; font-weight: 800; color: var(--warm); }
.card-name { margin-top: 2px; text-align: center; font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.card-meta { margin-top: 2px; text-align: center; font-size: 14px; color: var(--ink-4); }
.card-head { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 18px; font-weight: 800; }
.card-line { margin-top: 6px; font-size: 15px; color: var(--ink-2); }
.card-months { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.card-months div { padding: 10px 12px; border-radius: 8px; background: var(--white); border: 1px solid var(--rule); }
.card-months dt { font-size: 14px; color: var(--ink-4); }
.card-months dd { font-size: 17px; font-weight: 800; }
.card-more { margin-top: 14px; font-size: 14px; color: var(--ink-3); }
.pick-list { margin-top: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pick-list button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 56px; padding: 6px 10px; border: 1px solid var(--rule-2); border-radius: 8px; background: var(--white); cursor: pointer; font-size: 16px; font-weight: 800; text-align: left; }
.pick-list svg { width: 36px; height: auto; flex: none; }

.foot { margin-top: 48px; padding: 24px 0 40px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--ink-4); }
.foot p + p { margin-top: 8px; }

@media (min-width: 600px) {
  h1 { font-size: 32px; }
  .h-result { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .sheep, .sheep.walk-in, .wait-sheep { transition: none; animation: none; }
  .field.drawing .links path, .field.drawing .tag { animation: none; stroke-dashoffset: 0; opacity: 1; }
  .field.drawing .links path.clash { stroke-dasharray: 7 6; }
}
