/* ===== 메인 지도 ===== */
.map-page { min-height: 100%; display: flex; flex-direction: column; }
.map-header {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 16px 28px 6px; flex-wrap: wrap;
}
.hello { display: flex; align-items: center; gap: 10px; }
.bubble {
  background: var(--paper); border-radius: 18px; padding: 10px 18px; box-shadow: var(--shadow); position: relative;
}
.bubble::before {
  content: ""; position: absolute; left: -9px; top: 50%; margin-top: -9px;
  border: 9px solid transparent; border-right-color: var(--paper); border-left: 0;
}
.bubble h1 { font-size: 30px; margin: 0; color: var(--primary-d); }
.map-foot .teacher-flag { font-size: 14px; }
.bubble p { margin: 0; color: var(--ink-2); }
.badge-shelf { display: flex; gap: 6px; background: var(--paper); padding: 8px 12px; border-radius: 16px; box-shadow: var(--shadow); }
.shelf-item.empty { opacity: .55; }

.map-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 8px 20px 10px; }
.map {
  position: relative; width: 100%; max-width: 1280px; aspect-ratio: 16 / 9;
  border-radius: 28px; overflow: hidden; box-shadow: var(--shadow-2); border: 6px solid #fff;
}
.map-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.node {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--ink);
  z-index: 2;
}
.node-badge { transition: transform .2s; filter: drop-shadow(0 6px 6px rgba(0,0,0,.15)); }
.node.open .node-badge { animation: float 2.4s ease-in-out infinite; }
.node.open:not(.done) .node-badge { animation: float 1.6s ease-in-out infinite; }
.node.open:hover .node-badge { transform: scale(1.1); }
.node-card {
  margin-top: -4px; background: var(--paper); border-radius: 14px; padding: 6px 12px 7px; text-align: center;
  box-shadow: var(--shadow); border-top: 4px solid var(--c); min-width: 150px;
}
.node.locked .node-card { border-top-color: #c9d1dc; opacity: .88; }
.node-place { font-size: 12px; color: var(--muted); }
.node-title { font-family: var(--font-title); font-size: 18px; line-height: 1.25; }
.node-sub { font-size: 13px; color: var(--ink-2); }
.node-state { font-size: 12px; margin-top: 2px; font-family: var(--font-title); color: var(--c); }
.node.locked .node-state { color: var(--muted); }
.node.open:not(.done) .node-state { background: var(--c); color: #fff; border-radius: 999px; padding: 0 8px; display: inline-block; }
@keyframes float { 50% { transform: translateY(-7px); } }

.here-pai { position: absolute; transform: translate(-115%, -95%); z-index: 3; pointer-events: none; animation: float 2s ease-in-out infinite; }

.map-foot { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 4px 20px 16px; min-height: 52px; }
.teacher-btn {
  position: fixed; right: 12px; bottom: 12px; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--paper); opacity: .5; cursor: pointer; font-size: 15px;
}
.teacher-btn:hover { opacity: 1; }

/* 작은 화면(세로 태블릿 등): 지도 대신 세로 목록 */
@media (max-width: 860px) {
  .map { aspect-ratio: auto; padding: 16px; background: #d6f1f8; }
  .map-bg { display: none; }
  #nodes { display: flex; flex-direction: column; gap: 14px; }
  .node { position: static; transform: none; flex-direction: row; gap: 10px; }
  .node-card { flex: 1; text-align: left; border-top: 0; border-left: 5px solid var(--c); }
  .here-pai { display: none; }
  .map-header { padding: 12px 16px 4px; }
  .bubble h1 { font-size: 24px; }
}
@media (max-width: 1100px) and (min-width: 861px) {
  .node-badge svg { width: 58px; height: 58px; }
  .node-card { min-width: 130px; padding: 4px 9px; }
  .node-title { font-size: 15px; }
  .node-sub, .node-state { font-size: 11px; }
}
