/* 근쌤 연수랩 — 정원 표지판(연수 목록), 길잡이 근쌤, 말풍선 */
/* ───── 정원 표지판: 가운데 기둥 + 연수마다 화살표 판자 ───── */
.signpost { position: relative; padding: 34px 0 10px; }
.post {
  position: absolute; left: 50%; top: 0; bottom: -40px; width: 22px; transform: translateX(-50%);
  background-color: #6A3F21;
  background-image: repeating-linear-gradient(90deg, rgba(0,0,0,.1) 0 2px, transparent 2px 7px);
  border-radius: 6px 6px 0 0; box-shadow: inset -4px 0 0 rgba(0,0,0,.18), 0 10px 24px -10px rgba(0,0,0,.6);
}
.post::before { content: ""; position: absolute; left: -6px; right: -6px; top: -10px; height: 16px; background: #5A3519; border-radius: 8px 8px 3px 3px; }
.planks { position: relative; display: grid; grid-template-columns: 1fr 1fr; column-gap: 46px; row-gap: 22px; }

.plank { position: relative; color: #FFF1D6; perspective: 1000px; filter: drop-shadow(0 16px 18px rgba(5, 12, 36, .45)); }
.plank.to-left { grid-column: 1; }
.plank.to-right { grid-column: 2; margin-top: 70px; }
.plank + .plank.to-left { margin-top: -10px; }
.plank-board {
  position: relative; height: 172px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto 1fr; column-gap: 14px; row-gap: 6px;
  align-content: start; padding: 20px 26px;
  background-color: #7A4B2A;
  background-image: repeating-linear-gradient(178deg, rgba(255,255,255,.05) 0 2px, transparent 2px 12px, rgba(0,0,0,.07) 12px 14px, transparent 14px 26px);
  /* 판자가 기둥에서 접혀 있다가 펼쳐짐 */
  opacity: 0;
  transition: opacity .4s ease, transform .9s cubic-bezier(.3, 1.45, .5, 1);
  transition-delay: var(--d, 0ms);
}
/* 화살표 모양: 기둥 반대쪽이 뾰족 */
.plank.to-right .plank-board { clip-path: polygon(0 0, calc(100% - 40px) 0, 100% 50%, calc(100% - 40px) 100%, 0 100%); padding-right: 52px; transform-origin: 0 50%; transform: rotateY(-92deg); }
.plank.to-left .plank-board { clip-path: polygon(40px 0, 100% 0, 100% 100%, 40px 100%, 0 50%); padding-left: 52px; transform-origin: 100% 50%; transform: rotateY(92deg); }
.plank.in .plank-board { opacity: 1; transform: none; }
.plank:hover .plank-board { animation: plank-wiggle .7s ease; }
@keyframes plank-wiggle { 30% { transform: rotate(-1.2deg); } 65% { transform: rotate(.8deg); } }
/* 판자를 기둥에 박은 못 */
.plank-board::before, .plank-board::after { content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%; background: #3E230F; box-shadow: inset 1px 1px 0 rgba(255,255,255,.25); }
.plank.to-right .plank-board::before { left: 10px; top: 14px; }
.plank.to-right .plank-board::after { left: 10px; bottom: 14px; }
.plank.to-left .plank-board::before { right: 10px; top: 14px; }
.plank.to-left .plank-board::after { right: 10px; bottom: 14px; }

.p-meta { grid-column: 1 / -1; font-size: 15px; font-weight: 500; color: #F6DDB4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-topic {
  grid-column: 1 / -1; margin: 0; font-family: var(--f-display); font-weight: 900; font-size: 21px; line-height: 1.3; letter-spacing: -0.01em;
  text-shadow: 0 -1px 0 rgba(0,0,0,.4);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.p-tags { align-self: end; display: flex; flex-wrap: wrap; gap: 4px 5px; margin: 0; padding: 0; list-style: none; min-width: 0; max-height: 52px; overflow: hidden; }
.p-tags li { font-size: 13px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: rgba(255, 241, 214, .16); border: 1px solid rgba(255, 241, 214, .28); white-space: nowrap; }

/* 입장하기 단추 */
.card-enter {
  align-self: end; justify-self: end; display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 9px 12px 9px 16px;
  background: var(--sun-btn); color: var(--ink); text-decoration: none;
  font: 700 15px var(--f-body); cursor: pointer; white-space: nowrap;
  transition: gap .3s cubic-bezier(.2, .8, .2, 1), transform .15s ease, background-color .2s ease;
}
.card-enter svg { width: 18px; height: 18px; }
.card-enter:hover { gap: 13px; background: #FFC58A; }
.card-enter:active { transform: scale(.96); }

/* ───── 길잡이 근쌤 ───── */
body.stage-list .welcome.away { animation: none; opacity: 0; }
.guide { position: absolute; left: 0; top: 0; z-index: 30; width: var(--gs, 168px); height: var(--gs, 168px); pointer-events: none; transform-origin: 0 0; }
.guide .gi { display: block; width: 100%; height: 100%; transform-origin: 50% 100%; }
.guide img { display: block; width: 100%; height: 100%; filter: drop-shadow(0 12px 14px rgba(5, 12, 36, .45)); transition: transform .2s ease; }
.guide.face-left img { transform: scaleX(-1); }
.guide.walking .gi { animation: g-bob .32s ease-in-out infinite alternate; }
@keyframes g-bob { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-10px) rotate(4deg); } }
.guide.cheer .gi { animation: g-jump .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes g-jump { 40% { transform: translateY(-26px) scale(1.04); } }
.guide.nope .gi { animation: g-nope .5s ease; }
@keyframes g-nope { 20%, 60% { transform: rotate(-6deg); } 40%, 80% { transform: rotate(6deg); } }

/* 말풍선: 판자 위에 떠서 비밀번호를 묻는다 */
.plank.asking .plank-board > * { opacity: .12; transition: opacity .25s ease; }
.bubble {
  position: absolute; z-index: 5; top: 14px; left: 24px; right: 24px;
  display: grid; gap: 10px; padding: 16px 18px;
  background: var(--white); color: var(--ink); border-radius: 18px;
  box-shadow: 0 18px 40px -14px rgba(5, 12, 36, .6);
  transform-origin: 20% 110%;
  animation: b-in .45s cubic-bezier(.3, 1.5, .5, 1) both;
}
.bubble.tail-right { transform-origin: 80% 110%; }
.bubble::after {
  content: ""; position: absolute; bottom: -12px; left: 34px; width: 24px; height: 24px; background: var(--white);
  transform: rotate(45deg); border-radius: 0 0 6px 0;
}
.bubble.tail-right::after { left: auto; right: 34px; }
.bubble.out { animation: b-out .25s ease forwards; }
@keyframes b-in { from { opacity: 0; transform: scale(.6) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes b-out { to { opacity: 0; transform: scale(.85); } }
.b-say { margin: 0; font-size: 17px; font-weight: 700; }
.card-field { display: flex; gap: 8px; background: var(--paper); border: 1px solid var(--hair); border-radius: 12px; padding: 4px; transition: border-color .2s ease; }
.card-field:focus-within { border-color: var(--sky); }
.card-field input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: 500 16px var(--f-body); padding: 7px 10px; outline: none; letter-spacing: .06em; }
.card-field input::placeholder { color: var(--soft); letter-spacing: 0; }
.card-field button { border: 0; border-radius: 9px; background: var(--ink); color: var(--white); font: 700 15px var(--f-body); padding: 0 18px; cursor: pointer; }
.card-field button:disabled { opacity: .6; }
.bubble.wrong .card-field { animation: shake .45s ease; border-color: var(--m-red); }
.b-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-msg { font-size: 14px; color: var(--m-red); font-weight: 500; }
.card-cancel { margin-left: auto; border: 0; background: none; color: var(--ink); font: 500 15px var(--f-body); padding: 0; cursor: pointer; border-bottom: 1px solid var(--hair); }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

/* ───── 휴대폰: 기둥은 왼쪽, 판자는 모두 오른쪽을 가리킴 ───── */
@media (max-width: 760px) {
  .post { left: 18px; transform: none; width: 16px; }
  .planks { grid-template-columns: minmax(0, 1fr); row-gap: 18px; padding-left: 26px; }
  .plank.to-left, .plank.to-right { grid-column: 1; margin-top: 0; }
  .plank.to-left .plank-board { clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 50%, calc(100% - 30px) 100%, 0 100%); padding: 16px 40px 16px 22px; transform-origin: 0 50%; transform: rotateY(-92deg); }
  .plank.to-right .plank-board { padding: 16px 40px 16px 22px; }
  .plank.in .plank-board { transform: none; }
  .plank.to-left .plank-board::before { left: 8px; right: auto; }
  .plank.to-left .plank-board::after { left: 8px; right: auto; }
  .plank-board { height: 220px; }
  .p-topic { font-size: 19px; }
  .plank-board { grid-template-rows: auto auto auto 1fr; }
  .p-tags { grid-column: 1 / -1; align-self: start; max-height: 56px; }
  .card-enter { grid-column: 1 / -1; }
  .bubble { left: 12px; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .plank-board { opacity: 1 !important; transform: none !important; transition: none; }
  .guide .gi, .bubble { animation: none !important; }
}

/* 연수 안으로 걸어 들어갈 때: 멀어지며 흐려짐 */
.guide.entering img { transition: opacity 1.2s ease .3s; opacity: 0; }
