/* 광주YWCA 폭력예방 자가진단 - 공통 스타일 (모바일 전용) */
:root{
  --lime:#d9ec4b;        /* 포인트 라임 */
  --lime-bg:#eef6cf;     /* 연한 라임 배경(임의) */
  --navy:#3b3f8f;
  --ink:#2b2f6b;
}
*{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
/* 모든 버튼/링크: 길게 눌러도 선택·콜아웃·탭음영 안 나오게 */
button, a{ -webkit-touch-callout:none; -webkit-user-select:none; user-select:none; -webkit-tap-highlight-color:transparent; }
html,body{ margin:0; padding:0; }
body{
  background:var(--lime-bg);
  font-family:'Noto Sans KR','Apple SD Gothic Neo','Malgun Gothic',sans-serif;
  color:var(--ink);
  display:flex;                 /* 항상 가운데 정렬(넓은 화면 대응) */
  justify-content:center;
}
/* 모바일 폭 기준으로 가운데 정렬 */
.wrap{
  width:100%;
  max-width:480px !important;   /* 모바일 폭 고정 */
  margin:0 auto;
  min-height:100vh;
  min-height:100dvh;
  background:var(--lime-bg);
  position:relative;
  overflow-x:hidden;
}
/* 이미지 + 오버레이 컨테이너 */
.imgwrap{ position:relative; width:100%; line-height:0; }
.imgwrap > img{ display:block; width:100%; height:auto; }

/* 투명 오버레이 버튼(이미지 위 클릭영역) */
.hot{
  position:absolute;
  background:transparent;
  border:0; padding:0; margin:0;
  cursor:pointer;
  border-radius:14px;
  -webkit-appearance:none; appearance:none;
  -webkit-user-select:none; user-select:none;   /* 꾹 눌러도 선택영역 안 잡히게 */
  -webkit-touch-callout:none;
}
.hot:active{ background:transparent; }           /* 누름 시 사각형 음영 제거 */
.hot:focus{ outline:none; }
.hot:focus-visible{ outline:3px solid rgba(59,63,143,.6); outline-offset:-3px; }

/* 결과지 상단 A~F 앵커 아이콘 클릭영역 */
.anchor-mark{ position:absolute; left:0; width:1px; height:1px; }

/* 팝업 */
.modal-back{
  position:fixed; inset:0; z-index:50;
  background:rgba(30,30,60,.45);
  display:flex; align-items:center; justify-content:center;
  padding:24px;
  opacity:0; pointer-events:none; transition:opacity .18s ease;
}
.modal-back.on{ opacity:1; pointer-events:auto; }
.modal{
  width:100%; max-width:380px;
  background:#fff; border-radius:22px;
  padding:30px 24px 18px;
  text-align:center;
  box-shadow:0 20px 50px rgba(20,20,60,.28);
  transform:translateY(12px) scale(.98); transition:transform .18s ease;
}
.modal-back.on .modal{ transform:none; }
.modal .m-tag{ font-size:14px; font-weight:700; color:#9aa0c8; letter-spacing:.02em; }
.modal .m-title{ font-size:23px; font-weight:800; color:var(--navy); margin:6px 0 14px; }
.modal .m-body{ font-size:17px; line-height:1.7; color:#4a4f7a; white-space:pre-line; word-break:keep-all; }
.modal .m-ok{
  margin-top:22px; width:100%;
  border:0; border-radius:14px;
  background:var(--lime); color:var(--navy);
  font-size:19px; font-weight:800; font-family:inherit;
  padding:15px 0; cursor:pointer;
}
.modal .m-ok:active{ filter:brightness(.95); }

/* 하단 컨트롤(재시작/다른 진단) */
.controls{
  display:flex; gap:10px; justify-content:center;
  padding:18px 16px calc(28px + env(safe-area-inset-bottom));
  background:var(--lime-bg);
}
.controls .btn{
  flex:1; max-width:220px;
  border:0; border-radius:30px;
  padding:14px 10px; font-size:16px; font-weight:700;
  font-family:inherit; cursor:pointer; text-decoration:none; text-align:center;
}
.controls .btn.primary{ background:var(--navy); color:#fff; }
.controls .btn.ghost{ background:#fff; color:var(--navy); border:1.5px solid #cfd3ee; }
.controls .btn:active{ filter:brightness(.96); }

/* 허브(index) */
.hub{ padding:36px 22px calc(40px + env(safe-area-inset-bottom)); }
.hub .brand{ text-align:center; margin-bottom:26px; }
.hub .brand .w{ font-weight:900; color:var(--navy); font-size:18px; letter-spacing:.02em; }
.hub .brand h1{ font-size:24px; font-weight:900; color:var(--navy); margin:12px 0 6px; }
.hub .brand p{ font-size:15px; color:#6b70a0; margin:0; }
.hub .menu{ display:grid; gap:12px; margin-top:26px; }
.hub .menu a{
  display:flex; align-items:center; gap:14px;
  background:#fff; border-radius:18px; padding:20px 20px;
  text-decoration:none; color:var(--navy);
  box-shadow:0 8px 20px rgba(59,63,143,.08);
}
.hub .menu a:active{ transform:scale(.99); }
.hub .menu .no{
  width:40px; height:40px; flex:0 0 40px; border-radius:12px;
  background:var(--lime); color:var(--navy);
  display:flex; align-items:center; justify-content:center;
  font-weight:900; font-size:18px;
}
.hub .menu .t{ font-size:19px; font-weight:800; }
.hub .menu .arw{ margin-left:auto; color:#b7bbdf; font-size:22px; }
.hub .foot{ text-align:center; margin-top:30px; font-size:13px; color:#9297c4; line-height:1.6; }

/* ===================== 애니메이션 ===================== */
/* 화면 진입 */
@keyframes screenIn{ from{ opacity:0; transform:translateY(16px) scale(.985);} to{ opacity:1; transform:none;} }
@keyframes slideIn{ from{ opacity:0; transform:translateX(28px);} to{ opacity:1; transform:none;} }
.imgwrap.screen-in{ animation:screenIn .40s cubic-bezier(.22,.61,.36,1) both; }
.imgwrap.slide-in{ animation:slideIn .40s cubic-bezier(.22,.61,.36,1) both; }

/* 버튼 탭 리플 */
.hot{ overflow:hidden; }
.ripple{
  position:absolute; border-radius:50%;
  background:rgba(59,63,143,.22);
  transform:scale(0); opacity:.9; pointer-events:none;
  animation:ripple .6s ease-out forwards;
}
@keyframes ripple{ to{ transform:scale(1); opacity:0; } }

/* 시작 버튼 유도 펄스 */
.pulse-hint{
  position:absolute; pointer-events:none;
  border-radius:44px;
  box-shadow:0 0 0 0 rgba(59,63,143,.45);
  animation:pulseHint 1.8s ease-out infinite;
}
@keyframes pulseHint{
  0%{ box-shadow:0 0 0 0 rgba(59,63,143,.40); }
  70%{ box-shadow:0 0 0 22px rgba(59,63,143,0); }
  100%{ box-shadow:0 0 0 0 rgba(59,63,143,0); }
}

/* 결과 대상 유형 강조 */
.target-glow{
  position:absolute; left:3%; width:94%; height:12.7%;
  border-radius:26px; pointer-events:none; opacity:0;
  box-shadow:0 0 0 3px rgba(217,236,75,.95), 0 0 30px 8px rgba(217,236,75,.55);
  animation:targetGlow 2.3s ease-out forwards;
}
@keyframes targetGlow{
  0%{ opacity:0; } 12%{ opacity:1; }
  30%{ opacity:.35; } 48%{ opacity:1; }
  70%{ opacity:.5; } 100%{ opacity:0; }
}

/* 팝업 스프링 + 배경 블러 */
.modal-back.on{ backdrop-filter:blur(2px); -webkit-backdrop-filter:blur(2px); }
.modal{ transition:transform .32s cubic-bezier(.34,1.56,.64,1), opacity .2s ease; }

/* 허브 메뉴 등장(스태거) */
@keyframes hubIn{ from{ opacity:0; transform:translateY(14px);} to{ opacity:1; transform:none;} }
.hub .brand{ animation:hubIn .5s .02s both; }
.hub .menu a{ animation:hubIn .5s both; }
.hub .menu a:nth-child(1){ animation-delay:.06s; }
.hub .menu a:nth-child(2){ animation-delay:.12s; }
.hub .menu a:nth-child(3){ animation-delay:.18s; }
.hub .menu a:nth-child(4){ animation-delay:.24s; }
.hub .menu a:nth-child(5){ animation-delay:.30s; }
.hub .foot{ animation:hubIn .5s .36s both; }
.hub .menu a{ transition:transform .15s ease, box-shadow .15s ease; }
.hub .menu a:active{ transform:scale(.98); }
.hub .menu a .arw{ transition:transform .2s ease; }
.hub .menu a:hover .arw{ transform:translateX(4px); }

/* 컨트롤 버튼 등장 */
.controls{ animation:hubIn .45s .05s both; }

/* 모션 최소화 사용자 존중 */
@media (prefers-reduced-motion: reduce){
  .imgwrap.screen-in, .imgwrap.slide-in, .pulse-hint, .target-glow,
  .hub .brand, .hub .menu a, .hub .foot, .controls, .ripple{ animation:none !important; }
  .modal{ transition:opacity .2s ease; }
}

/* ===== 컷아웃 버튼(딸랑딸랑) & 아웃트로 카드 팝인 ===== */
/* 원본 버튼 가리는 퍼플 지우개 */
.eraser{ position:absolute; background:#7774FF; pointer-events:none; }

/* 버튼 이미지 */
.hot > img{ width:100%; height:100%; object-fit:contain; display:block; pointer-events:none; -webkit-user-drag:none; user-select:none; }
.btn-jiggle{ transform-origin:50% 12%; transition:transform .12s ease; will-change:transform; }
.btn-jiggle:active{ transform:scale(.93) rotate(0deg); }

/* 흔들림(딸랑) */
@keyframes jiggle{
  0%{ transform:rotate(0); } 12%{ transform:rotate(-7deg); }
  30%{ transform:rotate(6deg); } 46%{ transform:rotate(-5deg); }
  62%{ transform:rotate(3.5deg); } 78%{ transform:rotate(-2deg); }
  90%{ transform:rotate(1deg); } 100%{ transform:rotate(0); }
}
/* 데스크톱 호버 시 흔들림 */
@media (hover:hover){
  .btn-jiggle:hover{ animation:jiggle .7s ease; }
}
/* 모바일 유도용 은은한 주기적 흔들림(3초마다 살짝) */
@keyframes idleWobble{
  0%,84%,100%{ transform:rotate(0); }
  87%{ transform:rotate(-5deg); } 90%{ transform:rotate(4deg); }
  93%{ transform:rotate(-3deg); } 96%{ transform:rotate(2deg); }
}
.jiggle-idle{ animation:idleWobble 3s ease-in-out infinite; }
.jiggle-idle.d1{ animation-delay:.5s; }

/* 아웃트로 카드 팝인 */
.outro-card{ position:absolute; display:block; pointer-events:none; }
.outro-card.pop{ animation:cardPop .55s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes cardPop{
  0%{ opacity:0; transform:scale(.62) translateY(26px); }
  100%{ opacity:1; transform:none; }
}

@media (prefers-reduced-motion: reduce){
  .btn-jiggle:hover, .jiggle-idle, .outro-card.pop{ animation:none !important; }
  .outro-card{ opacity:1 !important; }
}

/* ===== 수정: 자동 흔들림 제거(호버 전용) + 선명한 진행바 ===== */
/* 저절로 흔들리던 idle 애니메이션 비활성화 (마우스 호버시에만 흔들림 유지) */
.jiggle-idle{ animation:none !important; }

/* 문항 상단 진행바(원본 얇은 흰 선을 덮어 선명하게) */
.pg-track{
  position:absolute; left:7%; width:87%; top:6.3%;
  height:13px; margin-top:-7px; z-index:3; pointer-events:none;
  background:#ffffff; border-radius:999px;
  box-shadow:0 2px 6px rgba(20,20,60,.22);
}
.pg-fill{
  position:absolute; left:0; top:0; height:100%;
  width:0; background:linear-gradient(90deg,#3b3f8f,#2b2f6b);
  border-radius:999px;
  transition:width .55s cubic-bezier(.22,.61,.36,1);
}
.pg-knob{
  position:absolute; right:-3px; top:50%;
  width:22px; height:22px; margin-top:-11px; margin-right:-8px;
  background:#2b2f6b; border:4px solid #fff; border-radius:50%;
  box-shadow:0 2px 8px rgba(20,20,60,.35);
}
.pg-label{
  position:absolute; right:7%; top:1.4%; z-index:3; pointer-events:none;
  background:#2b2f6b; color:#fff; font-weight:800;
  font-size:13px; line-height:1; padding:6px 10px; border-radius:999px;
  box-shadow:0 2px 6px rgba(20,20,60,.25);
}
.pg-label b{ color:#d9ec4b; }

/* ===== 허브: 준비중(1번 외) ===== */
.hub .menu a.soon{ opacity:.72; }
.hub .menu a.soon .no{ background:#c9cee0; color:#fff; }
.hub .menu .soon-tag{
  margin-left:10px; font-size:12px; font-weight:800;
  color:#7a7f9e; background:#eef0f6;
  padding:4px 9px; border-radius:999px; white-space:nowrap;
}

/* ===== 아웃트로: 통 이미지 등장 애니메이션(자르지 않음) ===== */
.imgwrap.outro-pop{ animation:outroPop .6s cubic-bezier(.22,.68,.3,1) both; transform-origin:50% 46%; }
@keyframes outroPop{
  0%{ opacity:0; transform:scale(.9) translateY(18px); }
  60%{ opacity:1; }
  100%{ opacity:1; transform:none; }
}
@media (prefers-reduced-motion: reduce){
  .imgwrap.outro-pop{ animation:none !important; }
}

/* ===== 대상 유형 강조(카드 크기에 맞춘 라임 포인트) ===== */
.type-mark{
  position:absolute; left:6%; width:88%;
  border:4px solid #3e4b91;                 /* 포인트 컬러(‘다음’ 버튼 폰트 네이비) */
  border-radius:30px; box-sizing:border-box;
  z-index:4; pointer-events:none;
  box-shadow:0 0 0 2px rgba(62,75,145,.30), 0 0 20px 4px rgba(62,75,145,.5);
  animation:typePulse 1.5s ease-in-out infinite;
}
@keyframes typePulse{
  0%,100%{ box-shadow:0 0 0 2px rgba(62,75,145,.28), 0 0 16px 3px rgba(62,75,145,.42); }
  50%{ box-shadow:0 0 0 3px rgba(62,75,145,.5), 0 0 26px 7px rgba(62,75,145,.62); }
}
@media (prefers-reduced-motion: reduce){ .type-mark{ animation:none; } }
