/* =====================================================================
   응급처치 마을 방범대(EB) – 공통 디자인 (common.css)
   모든 화면(학생·교사)이 이 파일 하나를 함께 씁니다.
   화면마다 색·글꼴·버튼을 따로 만들지 않고, 여기 있는 것만 씁니다.
   색은 지도(map) 그림의 표지판·나무·잔디 색에서 뽑았습니다.
   글꼴: 학생 화면은 갈무리11·갈무리9 (픽셀, OFL 무료 글꼴) – css/fonts.css에서 불러옴
         교사용 화면·활동지는 프리텐다드 (OFL 무료 글꼴) – css/pretendard.css에서 불러옴
   ===================================================================== */

:root {
  /* 바탕 */
  --grass:      #8cc27a;   /* 잔디 */
  --grass-dark: #5e9a50;
  --paper:      #fff3dc;   /* 패널 안쪽 */
  --sign:       #fddaa6;   /* 지도 표지판 색 */
  --sign-dark:  #e9b878;

  /* 테두리·글자 */
  --wood:       #a0643c;   /* 표지판 나무 테두리 */
  --wood-dark:  #5a3b26;
  --ink:        #4a3530;   /* 기본 글자 (표지판 글자보다 진하게) */
  --ink-soft:   #7a625a;

  /* 상태 색 – 반드시 글자·아이콘과 함께 사용 */
  --ok:         #3f9a4e;   /* 정답 ✓ */
  --ok-bg:      #e3f4dc;
  --no:         #d9573a;   /* 오답 ✕ */
  --no-bg:      #fde4dc;
  --hint:       #3d84c6;   /* 힌트·안내 💡 */
  --hint-bg:    #e1effb;
  --gold:       #f5c04a;   /* 주요 버튼 */
  --gold-dark:  #c98f1c;

  /* 모양 */
  --line: 4px;             /* 굵은 픽셀 테두리 */
  --radius: 10px;
  --shadow: 0 5px 0 var(--wood-dark);

  /* 글꼴 */
  /* 팀 시안 글꼴: 제목·본문 모두 갈무리(픽셀, css/fonts.css). 제목·버튼·카드 이름은 굵게(700),
     작은 안내 글자는 Galmuri9. 글꼴을 못 불러오면 기기 기본 글꼴로 대신함 */
  --font-title: "Galmuri11", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-body:  "Galmuri11", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  --font-small: "Galmuri9", "Galmuri11", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--grass);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 22px;            /* 갈무리11은 11의 배수 크기에서 가장 또렷함 */
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  word-break: keep-all;       /* 한국어 단어 단위 줄바꿈 */
}

/* ---------- 그림: 확정 그림 그대로, 픽셀이 흐려지지 않게 ---------- */
img.pixel, .pixel img {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  -webkit-user-drag: none;
  user-select: none;
}
img { max-width: 100%; height: auto; }   /* 비율 유지 */

/* ---------- 패널 (표지판 모양) ---------- */
.panel {
  background: var(--paper);
  border: var(--line) solid var(--wood);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
}
.panel.sign { background: var(--sign); }

/* ---------- 제목 ---------- */
.title, h1, h2, h3 { font-family: var(--font-title); font-weight: 700; margin: 0 0 8px; letter-spacing: 0; }
h1 { font-size: 34px; } h2 { font-size: 26px; } h3 { font-size: 22px; }

/* ---------- 버튼 ---------- */
.btn {
  font-family: var(--font-title); font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  background: var(--gold);
  border: var(--line) solid var(--wood-dark);
  border-radius: var(--radius);
  box-shadow: 0 5px 0 var(--gold-dark), 0 5px 0 var(--line) var(--wood-dark);
  padding: 12px 26px;
  min-height: 60px;           /* 큰 터치 영역 */
  min-width: 60px;
  cursor: pointer;
  transition: transform .05s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--gold-dark); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.secondary { background: var(--paper); box-shadow: 0 5px 0 var(--sign-dark); }
.btn.small { font-size: 17px; min-height: 48px; padding: 6px 14px; }

/* ---------- 상단 미션 안내 바 ---------- */
.mission-bar {
  display: flex; align-items: center; gap: 14px;
  background: var(--sign);
  border-bottom: var(--line) solid var(--wood);
  padding: 8px 16px;
  min-height: 72px;
}
.mission-bar .who { display: flex; align-items: center; gap: 10px; }
.mission-bar .who img { width: 52px; height: 52px; object-fit: contain; }
.mission-bar .zone { font-family: var(--font-title); font-weight: 700; font-size: 22px; }
.mission-bar .todo { flex: 1; font-size: 19px; }
.step-chip {
  font-family: var(--font-title); font-size: 17px;
  background: var(--wood); color: #fff; border-radius: 999px; padding: 4px 12px;
}
.top-tools { display: flex; gap: 8px; }

/* ---------- 장소 화면 (주민 대화 · 구급가방 · O/X · 행동 선택 공통) ----------
   배경: 지도에서 그 구역 장소를 확대 (scene.js) + 살짝 어둡게
   위: 미션 안내 바 / 가운데: 문제(물품 카드·O/X 버튼·보기) / 아래: 주민·보건 대원 + 대화창 */
.scene {
  position: relative; width: 100%; height: 100vh; height: 100dvh; overflow: hidden;   /* dvh: 아이패드 사파리 주소창을 뺀 실제 높이 */
  background-color: var(--grass-dark); background-repeat: no-repeat;
  display: flex; flex-direction: column;
}
.scene-dim { position: absolute; inset: 0; background: rgba(40, 28, 20, .38); pointer-events: none; }
.scene > *:not(.scene-dim) { position: relative; }
.scene-main { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 10px clamp(20px, 19vw, 250px) 8px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
/* 내용이 짧으면 가운데, 화면보다 길면 위에서부터 보이고 이 칸 안에서 스크롤 (대화창 뒤로 숨지 않게) */
.scene-main > * { margin-top: auto; margin-bottom: auto; }
.scene-bottom { position: relative; padding: 0 24px 20px; }
/* 주민(왼쪽) · 보건 대원(오른쪽): 대화창 위에 서 있고, 발끝 기준·같은 배율 */
.actors { position: absolute; left: 24px; right: 24px; bottom: calc(100% - 22px); display: flex; justify-content: space-between; align-items: flex-end; pointer-events: none; }
.actor { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.actor.right { align-items: flex-end; }
.actor img { display: block; }

/* 문제를 올려놓는 반투명 판 */
.board { background: rgba(255, 243, 220, .93); border: var(--line) solid var(--wood); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }

/* ---------- 말풍선 ---------- */
.bubble {
  position: relative; background: #fff;
  border: 3px solid var(--wood-dark); border-radius: 14px;
  padding: 10px 16px; font-size: 19px; max-width: 230px;
}
.bubble::after {
  content: ""; position: absolute; left: 32px; bottom: -14px;
  border: 7px solid transparent; border-top-color: var(--wood-dark);
}

/* ---------- 대화창 (화면 아래) ---------- */
.dialog { position: relative; padding-top: 26px; }
.dialog .nametag {
  position: absolute; top: -14px; left: 18px;
  font-family: var(--font-title); font-size: 19px;
  background: var(--wood); color: #fff;
  border: 3px solid var(--wood-dark); border-radius: 8px; padding: 2px 14px;
}
.dialog .line { font-size: 22px; line-height: 1.6; min-height: 66px; }
.dialog .next { position: absolute; right: 16px; bottom: 8px; font-size: 16px; color: var(--ink-soft); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- 물품 카드 ---------- */
.item-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.item-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: #fff; border: var(--line) solid var(--sign-dark); border-radius: var(--radius);
  box-shadow: 0 4px 0 var(--sign-dark);
  padding: 10px 8px; min-height: 150px; cursor: pointer;
  font-size: 22px; font-weight: 700; text-align: center;
}
.item-card img { height: 78px; width: auto; }
/* 고른 물품: 카드와 개수를 빨간색으로 눈에 띄게 */
.bag-count { font-family: var(--font-title); font-weight: 700; text-align: right; margin-bottom: 8px; }
.bag-count.on { color: #D32F2F; font-size: 1.2em; }
.item-card.picked { border-color: #D32F2F; box-shadow: 0 4px 0 #D32F2F; background: #FDE7E7; color: #B71C1C; }
.item-card.picked::before {
  content: "✓ 담았어요"; position: absolute; top: -12px; right: -8px;
  font-family: var(--font-title); font-size: 14px; color: #fff;
  background: #D32F2F; border: 2px solid var(--wood-dark); border-radius: 8px; padding: 1px 8px;
}

/* ---------- 결과 표시: 색 + 아이콘 + 글자 ---------- */
.result { border-radius: var(--radius); padding: 10px 14px; border: 3px solid; display: flex; gap: 10px; align-items: flex-start; }
.result .icon { font-family: var(--font-title); font-size: 22px; line-height: 1.2; flex: none; }
.result.ok   { background: var(--ok-bg);   border-color: var(--ok); }
.result.ok .icon { color: var(--ok); }
.result.no   { background: var(--no-bg);   border-color: var(--no); }
.result.no .icon { color: var(--no); }
.result.hint { background: var(--hint-bg); border-color: var(--hint); }
.result.hint .icon { color: var(--hint); }

/* ---------- O/X 버튼 ---------- */
.ox { display: flex; gap: 24px; justify-content: center; }
.ox .btn { font-family: var(--font-title); font-size: 64px; width: 160px; height: 140px; line-height: 1; }
.ox .btn.o { background: #e3f4dc; box-shadow: 0 6px 0 var(--ok); }
.ox .btn.x { background: #fde4dc; box-shadow: 0 6px 0 var(--no); }

/* ---------- 팝업 ---------- */
.overlay { position: fixed; inset: 0; background: rgba(40, 28, 20, .55); display: flex; align-items: center; justify-content: center; z-index: 50; }
.popup { width: min(560px, 92vw); text-align: center; }
.popup .actions { display: flex; gap: 12px; justify-content: center; margin-top: 14px; }

/* ---------- 작은 화면(휴대폰 세로) 대응 ---------- */
@media (max-width: 700px) {
  body { font-size: 18px; }
  .item-grid { grid-template-columns: repeat(2, 1fr); }
  .stage .actor { height: 150px; }
  .mission-bar { flex-wrap: wrap; }
}

/* 작은 안내 글자 (Galmuri9) */
.note, .helpline, .dialog .next { font-family: var(--font-small); font-size: 18px; }

/* O/X 버튼 기호: 갈무리 글꼴의 ◯ 와 × 사용 (영문 O는 숫자 0처럼 보여서). × 가 작게 그려져 조금 키움 */
.ox .btn.x { font-size: 96px; }

/* ---------- 팝업 안쪽 · 잠깐 안내 ---------- */
.popup.wide { width: min(900px, 94vw); text-align: left; }
.popup .popup-body { max-height: 62vh; overflow-y: auto; }
.popup h2 { text-align: center; }
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 80;
  background: var(--wood-dark); color: #fff; font-family: var(--font-title); font-weight: 700;
  padding: 12px 22px; border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ---------- 켜기/끄기 버튼 (소리 설정) ---------- */
.switch {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-title); font-weight: 700; font-size: 20px; color: var(--ink);
  background: var(--paper); border: 3px solid var(--sign-dark); border-radius: var(--radius);
  padding: 8px 14px; min-height: 56px; cursor: pointer;
}
.switch .state { border-radius: 999px; padding: 2px 12px; font-size: 17px; background: #d8ccc0; color: var(--ink); }
.switch[aria-pressed="true"] { border-color: var(--ok); background: var(--ok-bg); }
.switch[aria-pressed="true"] .state { background: var(--ok); color: #fff; }

/* =====================================================================
   교사용 관리자 화면
   ===================================================================== */
/* 교사용 화면·활동지 글꼴: 프리텐다드. 이 페이지 안의 팝업·QR 화면까지 모두 적용됨 */
.teacher-page {
  --font-title: "Pretendard Variable", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  --font-body:  var(--font-title);
  --font-small: var(--font-title);
}
.teacher-page { min-height: 100vh; padding: 28px 20px 40px; background: var(--grass-dark); position: relative; }
/* 지도 배경을 화면에 고정 (태블릿에서도 동작하도록 고정 층으로) + 살짝 어둡게 */
.teacher-page::before { content: ""; position: fixed; inset: 0; background: linear-gradient(rgba(40, 28, 20, .38), rgba(40, 28, 20, .38)), url(../assets/map/map.webp) center / cover; }
.teacher-wrap { position: relative; max-width: 1180px; margin: 0 auto; }
.tab-title {
  display: table; margin: 0 auto -4px; position: relative; z-index: 1;
  font-family: var(--font-title); font-weight: 700; font-size: 24px;
  background: var(--sign); border: var(--line) solid var(--wood); border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0; padding: 10px 26px;
}
.teacher-panel { padding: 22px 26px 26px; }
.intro-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 4px; }
.chip { font-family: var(--font-small); font-size: 16px; background: var(--sign); border: 2px solid var(--sign-dark); border-radius: 999px; padding: 3px 12px; }
.section { margin-top: 22px; }
.section-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.section-head h2 { margin: 0; font-size: 24px; }
.section-head .grow { flex: 1; }

/* 구역 선택 카드 10장 */
.zone-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.zone-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: #fff; border: var(--line) solid var(--sign-dark); border-radius: var(--radius);
  box-shadow: 0 4px 0 var(--sign-dark); padding: 12px 8px 10px; cursor: pointer;
  font-family: inherit; color: var(--ink); text-align: center;
}
.zone-card .pic { height: 120px; display: flex; align-items: flex-end; }
.zone-card .pic img { height: 100%; width: auto; }
.zone-card .zname { font-family: var(--font-title); font-weight: 700; font-size: 19px; line-height: 1.3; }
.zone-card .zplace { font-family: var(--font-small); font-size: 15px; color: var(--ink-soft); }
.zone-card .ztime { font-family: var(--font-small); font-size: 15px; background: var(--sign); border-radius: 999px; padding: 1px 10px; }
.zone-card[aria-pressed="true"] { border-color: var(--ok); box-shadow: 0 4px 0 var(--ok); background: var(--ok-bg); }
.zone-card[aria-pressed="true"]::before {
  content: "✓ 선택"; position: absolute; top: -12px; right: -6px;
  font-family: var(--font-title); font-weight: 700; font-size: 14px; color: #fff;
  background: var(--ok); border: 2px solid var(--wood-dark); border-radius: 8px; padding: 1px 8px;
}
.sound-row { display: flex; gap: 12px; flex-wrap: wrap; }
.summary-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.summary-box .big { font-family: var(--font-title); font-weight: 700; font-size: 24px; }
.make-row { text-align: center; margin-top: 26px; }
.make-row .btn { font-size: 26px; padding: 14px 40px; }
.credits-link { display: block; margin: 22px auto 0; background: none; border: 0; font-family: var(--font-small); font-size: 16px; color: var(--ink-soft); text-decoration: underline; cursor: pointer; min-height: 44px; }

/* 정답·해설 미리보기 */
.answer-zone { border-top: 3px dashed var(--sign-dark); padding: 12px 0; }
.answer-zone h3 { font-size: 20px; }
.answer-zone dl { margin: 0; display: grid; grid-template-columns: 170px 1fr; gap: 4px 12px; font-size: 18px; }
.answer-zone dt { font-family: var(--font-title); font-weight: 700; color: var(--wood); }
.answer-zone dd { margin: 0; }

/* 링크·QR */
.qr-layout { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.qr-box { background: #fff; border: var(--line) solid var(--wood); border-radius: var(--radius); padding: 14px; }
.qr-box canvas { display: block; image-rendering: pixelated; }
.qr-side { flex: 1; min-width: 320px; display: flex; flex-direction: column; gap: 12px; }
.link-text { font-family: var(--font-small); font-size: 15px; word-break: break-all; background: #fff; border: 2px solid var(--sign-dark); border-radius: 8px; padding: 8px 10px; user-select: all; }
.btn-col { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.qr-full { position: fixed; inset: 0; z-index: 90; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vh; cursor: pointer; }
.qr-full .big-text { font-family: var(--font-title); font-weight: 700; font-size: clamp(28px, 4vw, 52px); }
.qr-full canvas { image-rendering: pixelated; }
.qr-full .close-note { font-family: var(--font-small); font-size: 18px; color: var(--ink-soft); }

@media (max-width: 1000px) { .zone-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px)  { .zone-grid { grid-template-columns: repeat(2, 1fr); } .answer-zone dl { grid-template-columns: 1fr; } }

/* =====================================================================
   학생 화면 – 마을 지도
   ===================================================================== */
.screen[hidden] { display: none !important; }
.village { position: fixed; inset: 0; overflow: hidden; background: var(--grass-dark); touch-action: none; user-select: none; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: url(../assets/map/map.webp) 0 0 / 100% 100% no-repeat; }
.npc { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.npc img { display: block; }
.marker {
  font-family: var(--font-title); font-weight: 700; font-size: 20px; line-height: 1;
  border: 3px solid var(--wood-dark); border-radius: 10px; padding: 4px 9px; margin-bottom: 4px; background: #fff;
}
.marker.need { background: var(--gold); font-size: 26px; animation: bob 1s ease-in-out infinite; pointer-events: auto; cursor: pointer; position: relative; }
.marker.need::after { content: ""; position: absolute; inset: -14px; }   /* 손가락으로 누르기 쉽게 누르는 자리를 넓힘 */
.marker.done { background: var(--ok); color: #fff; }
.marker.lock { background: #d8ccc0; font-size: 16px; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.npc-name { font-family: var(--font-small); font-size: 15px; background: rgba(255, 243, 220, .92); border: 2px solid var(--wood); border-radius: 6px; padding: 0 6px; margin-top: 2px; white-space: nowrap; }
.player-sprite { position: absolute; width: 112px; height: 150px; transform: translate(-50%, -100%); background: url(../assets/player/player_walk.png?v=20261106) 0 0 / 448px 600px no-repeat; image-rendering: pixelated; pointer-events: none; }

.hud { position: absolute; z-index: 5; }
.hud.top-left { left: 14px; top: 14px; display: flex; gap: 8px; }
.badge-slots { position: absolute; z-index: 5; left: 14px; top: 188px; width: 200px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; padding: 5px; background: rgba(255, 243, 220, .92); border: 3px solid var(--wood); border-radius: 8px; }
.badge-slot { aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: pointer; }
.badge-slot img { width: 100%; height: 100%; object-fit: contain; display: block; filter: grayscale(1); opacity: .55; }
.badge-slot.done img { filter: none; opacity: 1; }
.hud.top-right { right: 14px; top: 14px; display: flex; gap: 8px; }
.hud.bottom { left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; pointer-events: none; }
.hud.bottom .btn { pointer-events: auto; font-size: 26px; padding: 14px 34px; }
.hud.bottom-left { left: 14px; bottom: 14px; }
.hud .panel { padding: 8px 14px; font-family: var(--font-title); font-weight: 700; }
.quick-list { display: flex; flex-direction: column; gap: 10px; }
.quick-list .btn { display: flex; align-items: center; gap: 12px; text-align: left; font-size: 19px; }
.quick-list .btn img { height: 48px; width: auto; }
.quick-list .btn .done-tag { margin-left: auto; color: var(--ok); }

/* =====================================================================
   학생 화면 – 미션
   ===================================================================== */
.mission-bar .who img { height: 52px; width: auto; }
.board.scroll { max-height: 100%; overflow-y: auto; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.choice {
  display: flex; align-items: center; gap: 10px; text-align: left;
  font-family: var(--font-body); font-size: 20px; font-weight: 700; color: var(--ink); line-height: 1.4;
  background: #fff; border: var(--line) solid var(--sign-dark); border-radius: var(--radius); box-shadow: 0 4px 0 var(--sign-dark);
  padding: 12px 14px; min-height: 84px; cursor: pointer;
}
.choice .num { font-family: var(--font-title); font-size: 24px; flex: none; }
.choice.wrong { border-color: var(--no); background: var(--no-bg); box-shadow: 0 4px 0 var(--no); }
.choice.wrong .num::after { content: " ✕"; color: var(--no); }
.choice.right { border-color: var(--ok); background: var(--ok-bg); box-shadow: 0 4px 0 var(--ok); }
.choice.right .num::after { content: " ✓"; color: var(--ok); }
.choice:disabled { cursor: default; }
.answer-list { display: flex; flex-direction: column; gap: 8px; }
.answer-list h3 { margin: 6px 0 2px; font-size: 20px; }
.answer-row { display: flex; gap: 12px; align-items: center; }
.answer-row img { height: 52px; width: 70px; object-fit: contain; flex: none; }
.answer-row .name { font-family: var(--font-title); font-weight: 700; }
.answer-row .fb { font-size: 18px; }
.dialog .row { display: flex; align-items: flex-end; gap: 16px; }
.dialog .row .grow { flex: 1; min-width: 0; }
.dialog .buttons { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.dialog.clickable { cursor: pointer; }
.big-title { font-family: var(--font-title); font-weight: 700; font-size: 33px; text-align: center; margin: 0 0 6px; }
.notebook {
  background: #fffdf4 repeating-linear-gradient(transparent 0 43px, #e9dcc2 43px 44px);
  border: var(--line) solid var(--wood); border-left: 14px solid var(--no); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 22px; width: 100%; max-height: 100%; overflow-y: auto;
}
.notebook ol { margin: 4px 0; padding: 0; list-style: none; }
.notebook li { line-height: 44px; font-size: 20px; }
.notebook .sub { font-family: var(--font-title); font-weight: 700; color: var(--wood); margin-top: 6px; }
.notebook .danger { color: #C62828; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.notebook .foot { color: var(--no); font-weight: 700; line-height: 44px; }
.complete-box { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.complete-box .badge { height: min(300px, 36vh); width: auto; }
.badge-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.badge-row img { height: 120px; width: auto; }
.speech { position: absolute; bottom: 100%; left: 0; margin-bottom: 8px; }
.actor { position: relative; }
.actor.right .speech { left: auto; right: 0; }
.actor.right .speech.bubble::after { left: auto; right: 32px; }

@media (max-width: 900px) {
  .scene-main { padding: 10px 14px 0; }
  .choices { grid-template-columns: 1fr; }
  .choice { min-height: 60px; font-size: 18px; }
}

/* 휴대폰 세로 화면 (웹 대응만 – 수업은 태블릿·PC 우선) */
@media (max-width: 700px) {
  .scene { height: 100dvh; }
  .scene-main { padding: 8px 10px 0; overflow-y: auto; align-items: flex-start; }
  .mission-bar { gap: 6px; padding: 6px 8px; min-height: 0; }
  .mission-bar .todo { display: none; }
  .mission-bar .zone { font-size: 17px; }
  .actor { transform: scale(.5); transform-origin: bottom left; }
  .actor.right { transform-origin: bottom right; }
  .speech { display: none; }
  .dialog .row { flex-direction: column; align-items: stretch; }
  .dialog .line { font-size: 19px; }
  .item-card { min-height: 110px; font-size: 18px; }
  .item-card img { height: 54px; }
  .ox .btn { width: 120px; height: 110px; font-size: 52px; }
  .hud.bottom-left { display: none; }
}

/* =====================================================================
   10구역 심폐소생술·AED
   ===================================================================== */
.cpr-figure { position: relative; display: inline-block; flex: none; }
.cpr-figure > img:first-child { height: 100%; width: auto; display: block; }
.zone-hi { position: absolute; border: 4px solid var(--no); background: rgba(217, 87, 58, .25); border-radius: 8px; }
.hand-dot { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--no); border: 3px solid #fff; box-shadow: 0 0 0 3px var(--no); }
.method-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 20px; }
.method-list dt { font-family: var(--font-title); font-weight: 700; color: var(--wood); }
.method-list dd { margin: 0; }

/* 리듬 트레이너 */
.rhythm { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.rhythm-top { background: rgba(255, 243, 220, .93); border: 2px solid var(--wood); border-radius: 8px; padding: 4px 12px; text-align: center; }
.rhythm-body { display: flex; gap: 18px; align-items: center; }
/* 가슴 압박 장면 (cpr_press 그림 한 장) */
.press-scene .presser { transform-origin: 50% 100%; }
/* 누를 때마다 살짝 눌렸다 올라옴 + 손 위치에 '꾹' 표시 (누르는 시늉) */
.presser.down { animation: press .22s ease-out; }
@keyframes press { 45% { transform: translateY(2.5%) scaleY(.975); } }
.press-ring { position: absolute; width: 18%; aspect-ratio: 1; transform: translate(-50%, -50%) scale(.3); border: 5px solid var(--gold); border-radius: 50%; opacity: 0; pointer-events: none; }
.press-ring.down { animation: ring .35s ease-out; }
@keyframes ring { 0% { opacity: 1; transform: translate(-50%, -50%) scale(.3); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.1); } }
.rhythm-panel { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 420px; }
.beat { width: 64px; height: 64px; border-radius: 50%; border: 4px solid var(--wood-dark); background: var(--paper); }
.beat.on { animation: beat .35s ease-out; }
@keyframes beat { 0% { background: var(--gold); transform: scale(1.2); } 100% { background: var(--paper); transform: scale(1); } }
.counters { display: flex; gap: 18px; white-space: nowrap; font-family: var(--font-title); font-weight: 700; font-size: 24px; }
.judge { font-family: var(--font-title); font-weight: 700; font-size: 22px; min-height: 33px; text-align: center; }
.judge.good { color: var(--ok); }
.judge.bad { color: var(--no); }
.press-btn { font-size: 30px; padding: 16px 70px; touch-action: manipulation; }

/* AED 본체 버튼(그림 위 투명 단추) · 패드 */
.aed-btn { position: absolute; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 0; background: transparent; cursor: pointer; padding: 0; }
.aed-btn.glow:not(:disabled) { box-shadow: 0 0 0 5px #fff, 0 0 0 9px var(--gold); animation: glow 1s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 5px #fff, 0 0 0 14px var(--gold); } }
.aed-voice { font-family: var(--font-title); font-weight: 700; background: #222; color: #9ff59f; border-radius: 8px; padding: 8px 14px; max-width: 640px; text-align: center; }
.pad-tray { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.pad { background: none; border: 3px dashed transparent; border-radius: 10px; padding: 4px; cursor: grab; touch-action: none; position: relative; z-index: 3; }
.pad img { height: min(130px, 17vh); width: auto; display: block; pointer-events: none; }
.pad.selected { border-color: var(--hint); background: var(--hint-bg); }
.pad.dragging { cursor: grabbing; z-index: 20; }
.pad-stuck { position: absolute; height: 17%; width: auto; transform: translate(-50%, -50%); pointer-events: none; }
/* 가로로 붙이는 패드: 그림은 그대로 두고 90도 돌림 (크기는 그림 폭 기준이라 휴대폰에서도 같은 비율) */
.pad-stuck.sideways { height: auto; width: 15.6%; transform: translate(-50%, -50%) rotate(90deg); }
.zone-flash { position: absolute; border-radius: 8px; pointer-events: none; }
.zone-flash.on { border: 3px dashed var(--ok); animation: softflash 1.2s ease-in-out infinite; }
@keyframes softflash { 50% { background: rgba(63, 154, 78, .28); } }

/* 마을의 응급처치 수첩 목록 (배지 카드) */
.nb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.nb-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: var(--radius); border: var(--line) solid var(--sign-dark); background: #fff; font-family: var(--font-title); font-weight: 700; font-size: 17px; color: var(--ink); text-align: center; }
.nb-card.done { cursor: pointer; box-shadow: 0 4px 0 var(--sign-dark); }
.nb-card.done:active { transform: translateY(3px); }
.nb-card img { height: 120px; width: auto; }
.nb-card.locked { background: var(--paper); border-style: dashed; }
.nb-q { height: 120px; display: flex; align-items: center; justify-content: center; font-size: 56px; color: var(--sign-dark); }

/* 10구역 3지선다: 보기 칸을 촘촘하게 (설명이 한 화면에 들어오게) */
.choices.compact { gap: 8px; }
.choices.compact .choice { min-height: 0; padding: 8px 12px; font-size: 19px; }

/* 리듬 연습 안내: 옆으로 넓은 글상자 한 장 (아이패드에서도 한 화면에) */
.rhythm-guide { width: 100%; max-width: 900px; display: flex; flex-direction: column; gap: 10px; }
.rg-row { display: flex; gap: 16px; align-items: center; }
.rg-text { flex: 1; display: flex; flex-direction: column; gap: 6px; }

/* 말풍선이 가운데 글상자를 가리지 않게 화면 너비에 맞춰 폭 제한 */
.speech.bubble { max-width: min(230px, 17vw); }

/* 사파리(아이패드)에서 버튼 글씨가 파랗게 나오지 않게 */
button { color: var(--ink); }
.item-card, .choice, .zone-card, .nb-card, .switch { color: var(--ink); }

/* 세로가 짧은 태블릿 가로 화면 (아이패드 10세대·갤럭시탭 등 – 브라우저 주소창을 빼면 세로 약 650~760px) */
@media (max-height: 780px) {
  body { font-size: 20px; }
  .mission-bar { min-height: 56px; padding: 5px 14px; }
  .mission-bar .who img { height: 42px; }
  .mission-bar .zone { font-size: 20px; }
  .btn { min-height: 52px; padding: 8px 20px; font-size: 20px; }
  .btn.small { min-height: 44px; font-size: 16px; }
  .item-grid { gap: 10px; }
  .item-card { min-height: 112px; padding: 6px; font-size: 20px; }
  .item-card img { height: 58px; }
  .dialog { padding-top: 22px; padding-bottom: 10px; }
  .dialog .line { font-size: 20px; }
  .scene-bottom { padding-bottom: 12px; }
  .ox .btn { height: 112px; width: 140px; }
  .choice { min-height: 64px; padding: 8px 12px; font-size: 19px; }
  .board { padding: 12px 14px; }
  .notebook li { line-height: 38px; font-size: 19px; }
}

/* =====================================================================
   스마트폰 세로 화면 (성과공유회용) – 그림·색·글꼴은 그대로, 배치만 세로로
   ===================================================================== */
@media (max-width: 600px) and (orientation: portrait) {
  body { font-size: 17px; }
  /* 위쪽 안내 바: 한 줄 */
  .mission-bar { flex-wrap: nowrap; gap: 6px; padding: 6px 8px; min-height: 0; }
  .mission-bar .who { gap: 6px; min-width: 0; flex: 1; }
  .mission-bar .who img { height: 30px; }
  .mission-bar .zone { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mission-bar .todo { display: none; }
  .step-chip { font-size: 13px; padding: 2px 8px; white-space: nowrap; }
  .top-tools { gap: 4px; flex: none; }
  .top-tools .btn.small { min-height: 38px; min-width: 0; padding: 2px 8px; font-size: 13px; }

  /* 가운데 문제 칸 */
  .scene-main { padding: 8px 10px 4px; align-items: flex-start; }
  .board { padding: 10px; }
  .item-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .item-card { min-height: 92px; font-size: 16px; padding: 6px 4px; }
  .item-card img { height: 46px; }
  .choices { grid-template-columns: 1fr; gap: 8px; }
  .choice { min-height: 0; font-size: 16px; padding: 8px 10px; }
  .ox { gap: 16px; }
  .ox .btn { width: 120px; height: 104px; font-size: 52px; }
  .ox .btn.x { font-size: 78px; }
  .result { padding: 8px 10px; font-size: 16px; }
  .answer-row img { height: 40px; width: 52px; }

  /* 아래: 주민·보건 대원은 대화창 바로 위에 작게 한 줄로 (글상자를 가리지 않게) */
  .scene-bottom { display: flex; flex-direction: column; padding: 0 8px 8px; }
  .actors { position: static; display: flex; justify-content: space-between; align-items: flex-end; height: 84px; margin: 0 6px -6px; }
  .actor, .actor.right { transform: none; }
  .actor img { height: auto !important; max-height: 84px; width: auto; }
  .speech { display: none; }
  .dialog { padding-top: 20px; padding-bottom: 8px; }
  .dialog .nametag { font-size: 15px; top: -12px; }
  .dialog .line { font-size: 17px; line-height: 1.5; }
  .dialog .row { flex-direction: column; align-items: stretch; gap: 8px; }
  .dialog .buttons .btn, .dialog #mAction .btn { width: 100%; }
  .btn { min-height: 48px; font-size: 18px; padding: 8px 14px; }
  .note, .helpline { font-size: 14px; }

  /* 수첩·미션 완료 */
  .notebook { padding: 10px 12px; border-left-width: 8px; }
  .notebook li { line-height: 1.6; font-size: 16px; margin-bottom: 4px; }
  .complete-box .badge { height: min(200px, 26vh); }
  .big-title { font-size: 24px; }

  /* 10구역: 옆으로 놓던 것을 위아래로, 그림은 화면에 맞게 */
  .cpr-row { flex-direction: column !important; gap: 10px !important; width: 100%; }
  .notebook.cpr-row { align-items: center !important; }
  .cpr-figure { height: auto !important; max-width: 100%; }
  .cpr-figure > img:first-child { height: auto; max-height: 30vh; max-width: 100%; }
  .press-scene > img { max-height: 24vh !important; }
  .rg-row { flex-direction: column; gap: 6px; }
  .rhythm-body { flex-direction: column; gap: 8px; }
  .rhythm-panel { min-width: 0; width: 100%; }
  .counters { font-size: 19px; }
  .judge { font-size: 18px; }
  .press-btn { width: 100%; font-size: 26px; padding: 14px; }
  .method-list { font-size: 15px; }
  .pad-tray { flex-direction: row; justify-content: center; }
  .pad img { height: min(96px, 13vh); }
  .aed-voice { font-size: 15px; }

  /* 마을 위쪽 버튼 */
  .hud.top-right { gap: 4px; }
  .hud.top-right .btn.small { min-height: 40px; font-size: 13px; padding: 2px 8px; }
  .hud .panel { padding: 4px 8px; font-size: 14px; }
  .popup.wide { width: 94vw; }
  .nb-grid { grid-template-columns: repeat(2, 1fr); }
  .nb-card img, .nb-q { height: 90px; }
}

/* 휴대폰을 가로로 돌렸을 때: 세로로 돌려 달라는 안내 */
.rotate-hint { display: none; }
@media (orientation: landscape) and (max-height: 480px) {
  .rotate-hint { display: flex; position: fixed; inset: 0; z-index: 200; background: var(--paper); flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-family: var(--font-title); font-weight: 700; font-size: 22px; color: var(--ink); text-align: center; }
  .rotate-hint .big { font-size: 48px; }
}

/* 가상 조이스틱 (터치 화면) */
.joystick { position: absolute; z-index: 6; left: 18px; bottom: 18px; width: 128px; height: 128px; border-radius: 50%;
  background: rgba(255, 243, 220, .55); border: 4px solid rgba(90, 59, 38, .7); touch-action: none; }
.joystick .knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  background: var(--gold); border: 4px solid var(--wood-dark); box-shadow: 0 3px 0 var(--gold-dark); pointer-events: none; }
.village.touch .hud.bottom-left { display: none; }
/* 미니맵 (지도 그림 그대로 작게) */
.minimap { position: absolute; z-index: 6; left: 14px; top: 64px; width: 200px; aspect-ratio: 2752 / 1536;
  background: url(../assets/map/map.webp) 0 0 / 100% 100%; border: 3px solid var(--wood-dark); border-radius: 8px; box-shadow: var(--shadow); cursor: pointer; transition: width .15s; }
.minimap.big { width: min(560px, 90vw); z-index: 7; }
.mm-npc, .mm-me { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; }
.mm-npc { width: 10px; height: 10px; border: 2px solid #fff; }
.mm-npc.need { background: var(--gold); box-shadow: 0 0 0 2px var(--wood-dark); }
.mm-npc.done { background: var(--ok); }
.mm-npc.lock { background: #9a8f86; width: 7px; height: 7px; }
.mm-me { width: 12px; height: 12px; background: var(--no); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--no); animation: blink 1s steps(2) infinite; }

@media (max-width: 600px) and (orientation: portrait) {
  .mission-bar:has(.step-chip:not([hidden])) .zone { display: none; }   /* 단계 표시가 있을 때는 이름 대신 그림만 */
  .hud.top-left { top: 76px; }
  .minimap { top: 116px; width: 130px; }
  .badge-slots { top: 196px; width: 150px; }
  .minimap.big { width: 90vw; }
  .hud.bottom { bottom: 158px; }
  .hud.bottom .btn { font-size: 20px; padding: 10px 20px; }
  .joystick { width: 118px; height: 118px; }
  .rhythm-top { font-size: 13px; padding: 2px 8px; }
  .beat { width: 40px; height: 40px; }
  .press-scene > img { max-height: 18vh !important; }
  .rhythm { gap: 6px; }
}
@media (max-width: 600px) and (orientation: portrait) {
  /* 리듬 연습 중에는 [누르기!] 버튼이 꼭 보이게 아래 캐릭터 줄을 숨김 */
  #mission:has(.rhythm) .actors, #mission:has(.rhythm-guide) .actors { display: none; }
}
/* 교사용 화면 – 휴대폰 */
@media (max-width: 600px) {
  .teacher-page { padding: 14px 10px 30px; }
  .teacher-panel { padding: 16px 14px 18px; }
  .qr-layout { gap: 16px; }
  .qr-box { max-width: 100%; box-sizing: border-box; margin: 0 auto; }
  .qr-box canvas { width: 100%; height: auto; max-width: 100%; }
  .qr-layout > * { min-width: 0; max-width: 100%; }
  .overlay canvas, .qr-full canvas { max-width: 86vw; height: auto; }
  .qr-full .big-text { text-align: center; padding: 0 16px; font-size: 26px; }
  .overlay { text-align: center; padding: 12px; }
  .zone-card .pic { height: 84px; }
  .zone-card .zname { font-size: 17px; }
}
/* 교사용 화면 – 휴대폰 아래 [링크·QR 만들기] 띠 (PC·태블릿에서는 숨김) */
.sticky-make { display: none; }
@media (max-width: 600px) {
  .sticky-make { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; gap: 10px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--paper); color: var(--ink);
    border-top: var(--line) solid var(--wood); box-shadow: 0 -4px 0 rgba(0,0,0,.15); }
  .sticky-make .sum { flex: 1; font-family: var(--font-small); font-size: 15px; line-height: 1.35; }
  .sticky-make .sum b { font-family: var(--font-title); font-size: 17px; }
  .sticky-make .btn { white-space: nowrap; }
  .teacher-page:has(#setupView:not([hidden])) { padding-bottom: 96px; }
}

/* 학생 시작 화면 – 팀 첫화면 그림
   PC·태블릿(가로): 그림을 화면 가득 배경으로, 글자 제목·캐릭터는 숨김
   휴대폰 세로: 마을 지도(장소 확대) 위에 첫화면 그림을 작게 띄우고, 보건소장·보건 대원 표시 */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.title-card { display: none; }
@media (orientation: landscape) {
  .title-art { background: #6aa456 url(../assets/title/title_screen_small.webp) center 30% / cover no-repeat !important; }
  .title-art .title-actors { display: none; }
  .title-art .dialog { max-width: 920px; margin: 0 auto; }
}
@media (orientation: landscape) and (min-width: 1400px), (orientation: landscape) and (min-resolution: 2dppx) and (min-width: 900px) {
  .title-art { background-image: url(../assets/title/title_screen.webp) !important; }
}
@media (orientation: portrait) {
  .title-art .scene-main { justify-content: flex-start; padding-top: max(6vh, 24px) !important; }
  .title-card { display: block; width: min(94%, 640px); height: auto; border: 4px solid var(--wood, #5a3b26);
    border-radius: 6px; box-shadow: 0 6px 0 rgba(0,0,0,.35); }
  .title-art .title-actors { height: 150px !important; }
  .title-art .title-actors .actor img { max-height: 150px !important; }
}

/* 활동지: 화면 미리보기와 인쇄 (A4 794×1123px) */
.ws-kinds { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.ws-kinds .switch { flex-direction: column; gap: 0; align-items: flex-start; text-align: left; }
.ws-preview { max-height: 40vh; overflow: auto; background: #d8ccc0; padding: 10px; border-radius: 8px; }
.ws-preview .ws-page { margin: 0 auto 10px; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.ws-actions { display: flex; gap: 10px; justify-content: center; }
.ws-page { width: 794px; height: 1123px; padding: 44px 52px 36px; background: #fff; color: #222; display: flex; flex-direction: column; font-family: "Pretendard Variable", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; box-sizing: border-box; word-break: keep-all; }
.ws-page header { border-bottom: 3px solid #333; padding-bottom: 8px; margin-bottom: 18px; flex: none; }
.ws-page h1 { font-family: inherit; font-size: 26px; margin: 0 0 6px; text-align: center; }
.ws-page header p { margin: 0; text-align: right; font-size: 17px; }
.ws-body { flex: 1; min-height: 0; }
.ws-block { margin-bottom: 18px; }
.ws-block h3 { font-family: inherit; font-size: 19px; margin: 0 0 6px; background: #f0ece6; padding: 3px 10px; border-radius: 6px; }
.ws-block h3 small { font-weight: 500; font-size: 15px; }
.ws-block ol { list-style: none; margin: 0; padding: 0 4px; }
.ws-block li { font-size: 17px; line-height: 2.1; }
.ws-blank { display: inline-block; border-bottom: 1.5px solid #333; height: 1.2em; vertical-align: -3px; margin: 0 3px; }
.ws-answer { color: #C62828; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.ws-check { display: inline-block; width: 15px; height: 15px; border: 1.5px solid #333; border-radius: 3px; margin-right: 8px; vertical-align: -2px; }
.ws-page .danger { color: #C62828; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.ws-page footer { flex: none; text-align: center; font-weight: 700; font-size: 16px; border-top: 2px solid #333; padding-top: 8px; }
@media (max-width: 840px) { .ws-preview .ws-page { zoom: .5; } }

/* 마을 왼쪽 위: '해결한 주민' 칸은 빼고 모은 배지 → 배지 상자 → 미니맵 순서 (위치는 village.js stackHud) */
#solvedBox { display: none; }
@media (max-width: 600px) and (orientation: portrait) {
  .minimap:not(.big) { width: 150px; }
}

/* 배지 상자: 배지 수에 맞춰 폭이 줄어듦 (칸 크기 --slot) */
.badge-slots { width: auto !important; --slot: 34px; }
.minimap:not(.big) { left: 14px; }
@media (max-width: 600px) and (orientation: portrait) {
  .badge-slots { --slot: 27px; }
}

/* =====================================================================
   SENSE 초등보건교육연구회 이름표 (A안 · 나무 표지판형)
   학생 첫 화면 · 교사용 화면 오른쪽 위. 색은 마을 표지판 나무색·살구색.
   글꼴은 페이지 글꼴을 그대로 따름: 학생 화면 갈무리11, 교사용 화면 프리텐다드
   ===================================================================== */
.sense-tag {
  position: absolute; top: 16px; right: 18px; z-index: 5;
  display: inline-flex; align-items: stretch;
  border: var(--line) solid var(--wood-dark); border-radius: var(--radius);
  box-shadow: 0 4px 0 var(--wood-dark); overflow: hidden;
  font-family: var(--font-title); font-weight: 700; font-size: 22px; line-height: 1.3;
  white-space: nowrap; pointer-events: none; user-select: none;
}
.scene > .sense-tag { position: absolute; }   /* 장면 칸 공통 규칙(position: relative)보다 우선 */
.sense-tag .s-en { display: flex; align-items: center; padding: 6px 12px; background: var(--wood-dark); color: #fff; letter-spacing: 2px; }
.sense-tag .s-ko { display: flex; align-items: center; padding: 6px 14px; background: var(--sign); color: var(--ink); }

/* 교사용 화면: 프리텐다드에 맞춰 조금 작게 */
.teacher-page .sense-tag { font-size: 19px; }
.teacher-page .sense-tag .s-en { font-size: 20px; font-weight: 800; letter-spacing: 1px; }
/* 교사용 화면이 좁을 때: 가운데 제목과 겹치지 않게 제목 위 오른쪽에 따로 한 줄 */
@media (max-width: 1300px) {
  .teacher-page .sense-tag { position: relative; top: auto; right: auto; display: flex; width: fit-content; margin: 0 0 14px auto; }
}

/* 세로 화면(태블릿·휴대폰): 첫화면 그림이 이름표 아래에서 시작하도록 */
@media (orientation: portrait) {
  .title-art .scene-main { padding-top: max(6vh, 80px) !important; }
}
/* 휴대폰 세로: 이름표를 작게 */
@media (max-width: 600px) and (orientation: portrait) {
  .sense-tag { top: 10px; right: 10px; font-size: 15px; border-width: 3px; box-shadow: 0 3px 0 var(--wood-dark); }
  .sense-tag .s-en { padding: 4px 8px; letter-spacing: 1px; }
  .sense-tag .s-ko { padding: 4px 10px; }
  .teacher-page .sense-tag, .teacher-page .sense-tag .s-en { font-size: 15px; }
  .title-art .scene-main { padding-top: 58px !important; }
}
