:root {
  --pitch: #0f3d2e;
  --pitch-2: #145239;
  --line: rgba(255, 255, 255, 0.14);
  --lime: #c6f432;
  --coral: #ff6b8b;
  --ink: #15201b;
  --muted: #5c6b64;
  --card: #ffffff;
  --soft: #f3f7f1;
  --radius: 20px;
  --paper: #fbfaf4;
  --rule: #dcdcd2;
  --lime-dark: #9fd10f;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background:
    repeating-linear-gradient(90deg, var(--pitch) 0 60px, var(--pitch-2) 60px 120px);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  position: relative;
}

.screen { display: none; }
.screen.active { display: block; animation: fade 0.35s ease; }

@keyframes fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 공통 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

.btn {
  font: inherit;
  border: 0;
  cursor: pointer;
  border-radius: 14px;
  padding: 15px 18px;
  font-weight: 700;
  font-size: 16px;
  width: 100%;
  transition: transform 0.1s ease, filter 0.2s ease;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--lime); color: var(--pitch); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: rgba(255, 255, 255, 0.12); color: #fff; border: 1.5px solid rgba(255, 255, 255, 0.4); }
.btn.icon {
  width: 40px; height: 40px; padding: 0; flex: none;
  background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 18px; border-radius: 12px;
}

/* ---------- 시작 ---------- */
#screen-intro { text-align: center; color: #fff; padding-top: 24px; }

.pitch-badge {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.12em;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
}

h1 {
  font-size: 56px;
  line-height: 1;
  margin: 18px 0 12px;
  letter-spacing: -0.03em;
  font-weight: 900;
}
.hl { color: var(--lime); }

.lead { font-size: 17px; line-height: 1.6; opacity: 0.92; margin: 0 0 24px; }
.lead b { color: var(--lime); }


#name-form { text-align: left; margin-top: 20px; color: var(--ink); }
#name-form label { font-weight: 700; display: block; margin-bottom: 10px; }
#name-form input {
  width: 100%;
  font: inherit;
  font-size: 17px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1.5px solid #dfe6e1;
  background: var(--soft);
  margin-bottom: 12px;
  outline: none;
}
#name-form input:focus { border-color: var(--pitch-2); background: #fff; }
.hint { text-align: center; color: var(--muted); font-size: 13px; margin: 10px 0 0; }


/* ---------- 문항 ---------- */
.quiz-top { display: flex; align-items: center; gap: 12px; color: #fff; }
.progress { flex: 1; height: 10px; background: rgba(255, 255, 255, 0.15); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--lime); border-radius: 999px; transition: width 0.3s ease; }
.progress-text { font-size: 13px; font-weight: 700; min-width: 40px; text-align: right; }

.question-wrap { margin-top: 48px; }
.question-wrap.enter { animation: fade 0.3s ease; }

.q-num { color: var(--lime); font-weight: 900; font-size: 20px; margin: 0 0 8px; }
.q-text {
  color: #fff;
  font-size: 25px;
  line-height: 1.4;
  margin: 0 0 32px;
  min-height: 70px;
  letter-spacing: -0.01em;
}

.options { display: grid; gap: 12px; }
.option {
  font: inherit;
  text-align: left;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 600;
  padding: 20px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.2s ease, background 0.2s ease;
}
/* 터치 기기에서는 탭한 버튼에 hover가 남아 다음 문항까지 켜져 보이므로 마우스 기기에서만 적용 */
@media (hover: hover) {
  .option:hover { border-color: var(--lime); }
}
.option:active { transform: scale(0.98); }
.option.picked { border-color: var(--lime); background: #f6fde4; }

/* ---------- 결과: 선수 리포트 ---------- */
.report {
  background: var(--paper);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
}

.report-head {
  display: flex;
  justify-content: space-between;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--lime);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.report-hero { padding: 26px 22px 18px; border-bottom: 2px solid var(--ink); }
.result-owner { margin: 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.result-name { font-size: 40px; line-height: 1.1; margin: 6px 0 8px; font-weight: 900; letter-spacing: -0.035em; }

.letters { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 2px solid var(--ink); }
.letter {
  padding: 14px 6px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.letter + .letter { border-left: 1px solid var(--rule); }
.letter b { font-size: 34px; line-height: 1; font-weight: 900; }
.letter span { font-size: 12px; font-weight: 700; color: var(--muted); }
.letter i {
  display: block;
  width: 70%;
  height: 4px;
  margin-top: 4px;
  background: linear-gradient(90deg, var(--ink) var(--w), var(--rule) var(--w));
}
.letter small { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.report-body { padding: 6px 22px 24px; }

.quote-box { margin: 18px 0 14px; padding-left: 14px; border-left: 4px solid var(--lime-dark); }
.quote-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.result-quote {
  margin: 4px 0 0;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.4;
}
.result-desc { margin: 0; font-size: 15px; line-height: 1.75; color: #2a3530; }

/* 추천 포지션 + 경기장 */
.position {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  padding: 16px;
  background: #eef2ea;
  border-radius: 6px;
}
.position h3 { margin: 0; font-size: 12px; color: var(--muted); font-weight: 700; }
.position-name { margin: 4px 0 10px; font-size: 22px; font-weight: 900; letter-spacing: -0.02em; }
.position ul { margin: 0; padding: 0; list-style: none; }
.position li { font-size: 13px; line-height: 1.55; color: #2a3530; }
.position li + li { margin-top: 6px; }
.pitch { width: 100%; display: block; background: var(--pitch-2); border-radius: 4px; }
.pitch .pl { fill: none; stroke: rgba(255, 255, 255, 0.55); stroke-width: 1.2; }
.pitch .pd { fill: rgba(255, 255, 255, 0.55); }
.pitch .spot circle { fill: rgba(255, 255, 255, 0.25); }
.pitch .spot text { display: none; font-size: 9px; font-weight: 800; fill: #fff; text-anchor: middle; font-family: inherit; }
.pitch .spot.on circle { fill: var(--lime); stroke: #fff; stroke-width: 1.5; }
.pitch .spot.on text { display: block; }
.pitch .spot.gk:not(.on) circle { fill: rgba(255, 255, 255, 0.15); }
.pitch .spot.gk text { text-anchor: start; }

/* 닮은 선수 */
.player {
  margin-top: 12px;
  padding: 16px;
  background: var(--ink);
  color: #fff;
  border-radius: 6px;
}
.player-label { margin: 0; font-size: 12px; font-weight: 700; color: var(--lime); }
.player-name { margin: 4px 0 8px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.player-name b { font-size: 22px; font-weight: 900; letter-spacing: -0.02em; }
.player-name span { font-size: 13px; color: rgba(255, 255, 255, 0.6); }
.player-why { margin: 0; font-size: 14px; line-height: 1.6; color: rgba(255, 255, 255, 0.88); }

.block { padding-top: 22px; }
.block h3 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 10px; font-size: 16px; font-weight: 800; }
.block h3 em { font-style: normal; font-size: 12px; color: var(--pitch-2); font-weight: 900; letter-spacing: 0.05em; }
.block ul { list-style: none; margin: 0; padding: 0; }
.block li {
  font-size: 15px;
  line-height: 1.6;
  padding: 7px 0;
  border-bottom: 1px dashed var(--rule);
}
.block li:last-child { border-bottom: 0; }
.block li.gk-line { margin-top: 6px; padding: 10px 12px; background: #eef2ea; border-radius: 6px; border-bottom: 0; }
.block li.gk-line b { display: block; font-size: 12px; color: var(--pitch-2); margin-bottom: 2px; }

/* ---------- 궁합 카드 ---------- */
.match-heading { color: #fff; font-size: 20px; margin: 32px 0 12px; }
.match-grid { display: grid; gap: 12px; }
.match { border-radius: 6px; padding: 20px; }
.match.good { background: #eefbcf; }
.match.bad { background: #ffe1e8; }
.match-kicker {
  display: inline-block;
  margin: 0;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  padding: 4px 8px;
  border-radius: 4px;
  color: #fff;
}
.good .match-kicker { background: var(--pitch-2); }
.bad .match-kicker { background: #d63a5f; }
.match-code { margin: 12px 0 0; font-size: 13px; font-weight: 900; letter-spacing: 0.2em; color: var(--muted); }
.match-name { margin: 2px 0 4px; font-size: 24px; font-weight: 900; letter-spacing: -0.02em; }
.match-line { margin: 0 0 16px; font-size: 14px; color: #3d4a44; }
.match-scene {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 600;
}
.match h4 { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.match ol { margin: 0; padding: 0; list-style: none; counter-reset: r; }
.match li {
  counter-increment: r;
  position: relative;
  padding: 8px 0 8px 26px;
  font-size: 14px;
  line-height: 1.6;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.match li::before {
  content: counter(r);
  position: absolute;
  left: 0;
  top: 9px;
  font-size: 12px;
  font-weight: 900;
}
.good li::before { color: var(--pitch-2); }
.bad li::before { color: #d63a5f; }

.actions { display: grid; gap: 10px; margin-top: 24px; }

/* ---------- 기타 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

footer {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  padding: 0 16px 32px;
}

@media (max-width: 360px) {
  h1 { font-size: 46px; }
  .q-text { font-size: 22px; }
  }
