/* 자연관찰 탐험(field.js) — 화면 하나에 다 보이게: 지도는 화면 가득, 관찰은 왼쪽 3D · 오른쪽 예시 보고서, 맨 아래 독쌤 말 + 「다음 ▶」 하나. */
:root {
  --fd-ink: #1f2a1f;
  --fd-paper: #fffaf0;
  --fd-green: #2f6b3a;
  --fd-green-2: #3f8f3a;
  --fd-gold: #f0b21a;
  --fd-desk: #e9e2d2;
}
body.field-on { overflow: hidden; }
.fd { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: #10140f; color: var(--fd-ink); font-family: Pretendard, system-ui, sans-serif; }
.fd-obs { grid-template-rows: auto minmax(0, 1fr) auto; }

/* 아래 띠: 독쌤 + 말 + 다음 */
.fd-bar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: var(--fd-paper); border-top: 3px solid var(--fd-green-2); box-shadow: 0 -6px 18px rgba(0, 0, 0, .18); }
.fd-who { display: flex; flex-direction: column; align-items: center; flex: none; }
.fd-who img { width: 52px; height: 52px; object-fit: cover; object-position: 50% 8%; border-radius: 50%; background: #e7f0e2; border: 2px solid var(--fd-green-2); }
.fd-who b { font-size: 11px; color: var(--fd-green); margin-top: 2px; }
.fd-say { flex: 1; margin: 0; font-size: 16.5px; line-height: 1.55; font-weight: 600; min-height: 2.6em; display: flex; align-items: center; }
.fd-n { flex: none; font-size: 13px; color: #6b6b5f; font-variant-numeric: tabular-nums; }
.fd-next, .fd-prev { flex: none; border: 0; border-radius: 999px; font: inherit; font-weight: 800; cursor: pointer; }
.fd-next { font-size: 18px; padding: 13px 28px; background: var(--fd-green); color: #fff; box-shadow: 0 4px 0 #1e4626; }
.fd-next:active { transform: translateY(2px); box-shadow: 0 2px 0 #1e4626; }
.fd-next:disabled { background: #9aa89a; box-shadow: none; cursor: default; }
.fd-next.print { background: #c0392b; box-shadow: 0 4px 0 #7f2219; }
.fd-prev { font-size: 16px; padding: 12px 16px; background: #e8e2d4; color: #444; }
.fd-prev:disabled { opacity: .4; cursor: default; }
.fd-drew { flex: none; border: 0; border-radius: 999px; font: inherit; font-weight: 800; font-size: 17px; padding: 12px 22px; cursor: pointer; background: #f0b21a; color: #3a2a00; box-shadow: 0 4px 0 #b07f0a; }
/* 생각하기 전에는 그 칸의 내용을 흐리게 가린다(「생각해 볼까요?」 → 「다음」에 드러남) */
.fd-right .fd-hide { position: relative; min-height: 64px; user-select: none; cursor: pointer; }
.fd-right .fd-hide > * { visibility: hidden; }
/* 덮개(Every Joule 「Lift the flap」): 가린 칸 위에 접힌 종이 — 누르면(또는 「다음」) 들춰진다 */
.fd-right .fd-hide::before { content: '👆 덮개를 들춰 봐요'; position: absolute; inset: 4px; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-weight: 700; font-size: 14px; color: #6b5a2e;
  background: linear-gradient(135deg, #f6eccd 0 85%, #e2d3a6 85% 100%); border: 1.5px dashed #c9b27a; box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }
.fd-right .fd-hide:hover::before { background: linear-gradient(135deg, #fbf2d6 0 82%, #e2d3a6 82% 100%); }
.fd-right .rp-body, .fd-right .rp-obs-text { animation: fd-reveal .5s ease-out; }
@keyframes fd-reveal { from { opacity: .2; } to { opacity: 1; } }

/* 지도: 화면 가득 */
.fd-mapbox { position: relative; min-height: 0; }
.fd-mapbox .pm-view.field { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; aspect-ratio: auto; border-radius: 0; touch-action: none; cursor: pointer; }
.fd-home { position: absolute; left: 14px; top: 12px; z-index: 5; padding: 7px 14px; border-radius: 999px; background: rgba(255, 250, 240, .92); color: var(--fd-green); font-weight: 700; font-size: 14px; text-decoration: none; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.fd-hint { position: absolute; right: 14px; top: 12px; z-index: 5; padding: 6px 12px; border-radius: 999px; background: rgba(20, 30, 20, .55); color: #fff; font-size: 13px; pointer-events: none; }
.fd-map .fd-bar { position: relative; z-index: 6; }

/* 관찰: 위 줄 */
.fd-top { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: #1b2a1d; color: #fff; }
.fd-top b { font-size: 17px; }
.fd-top small { color: #b8c9b4; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-top .sp { flex: 1; }
.fd-back { color: #d8ecd2; text-decoration: none; font-weight: 700; padding: 6px 10px; border-radius: 8px; background: rgba(255, 255, 255, .08); }
.fd-print { border: 1px solid rgba(255, 255, 255, .35); background: transparent; color: #fff; font: inherit; font-size: 14px; font-weight: 700; padding: 7px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.fd-print.main { background: #c0392b; border-color: #c0392b; }

/* 관찰: 왼쪽 3D · 오른쪽 보고서 */
.fd-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 0; }
.fd-left { position: relative; min-height: 0; background: #0e1410; }
.fd-left canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.fd-cap { position: absolute; left: 12px; bottom: 12px; right: 12px; margin: 0; padding: 7px 12px; border-radius: 10px; background: rgba(255, 250, 240, .9); font-size: 14px; font-weight: 700; pointer-events: none; }
.fd-cap:empty { display: none; }
.fd-right { min-height: 0; overflow: auto; background: var(--fd-desk); padding: 12px 16px 40px; scroll-behavior: smooth; }
.fd-note { margin: 0 auto 10px; max-width: 860px; padding: 9px 12px; border-radius: 10px; background: #fff4cf; border: 1px solid #e8cf7a; font-size: 14px; line-height: 1.5; }
.fd-right .rp-sheet { margin: 0 auto; max-width: 860px; }
.fd-right.focus .rp-cell, .fd-right.focus .rp-obs-row { transition: opacity .35s; opacity: .45; }
.fd-right.focus .rp-cell.fd-now, .fd-right.focus .rp-obs-row.fd-now, .fd-right.focus .rp-cell:has(.fd-now) { opacity: 1; }
.fd-right .fd-now { outline: 3px solid var(--fd-gold); outline-offset: 4px; border-radius: 6px; }
.fd-right .rp-cell:has(.fd-now) { outline: 0; }
.fd-none { text-align: center; color: #666; margin-top: 40px; }

/* 좁은 화면: 위 3D · 아래 보고서 */
@media (max-width: 760px) {
  .fd-split { grid-template-columns: 1fr; grid-template-rows: 42% 58%; }
  .fd-top small, .fd-hint { display: none; }
  .fd-print { padding: 6px 8px; font-size: 12.5px; }
  .fd-print:not(.main) { display: none; }
  .fd-bar { gap: 8px; padding: 8px 10px; }
  .fd-who img { width: 40px; height: 40px; }
  .fd-say { font-size: 14px; }
  .fd-n { display: none; }
  .fd-next { font-size: 16px; padding: 11px 18px; }
}

/* 대회 폴더의 탐험 시작 카드 */
.ct-explore { position: relative; display: block; border-radius: 14px; overflow: hidden; text-decoration: none; color: #fff; box-shadow: 0 8px 26px rgba(0, 0, 0, .25); }
.ct-explore img { display: block; width: 100%; aspect-ratio: 16 / 6; object-fit: cover; object-position: 50% 55%; }
.ct-explore span { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 16px 20px; background: linear-gradient(transparent, rgba(10, 20, 10, .82)); }
.ct-explore b { font-size: 22px; }
.ct-explore small { flex: 1 1 320px; font-size: 14px; line-height: 1.5; color: #e6f0e2; }
.ct-explore i { font-style: normal; font-weight: 800; padding: 10px 22px; border-radius: 999px; background: var(--fd-green-2); }

/* 인쇄: 양식(또는 예시)만 */
.fd-print-sheet { display: none; }
@media print {
  body.fd-printing > :not(.fd-print-sheet) { display: none !important; }
  html:has(body.fd-printing), body.fd-printing { background: #fff !important; }
  body.fd-printing .fd-print-sheet { display: block !important; }
  body.fd-printing .pz-hand { display: none !important; }
  .fd-print-sheet .rp-obs-row { break-inside: avoid; }
  /* 종이에 손으로 쓰는 양식 — 화면용 빈칸 안내는 찍지 않는다 */
  .fd-print-sheet .rp-view:empty::before { content: none; }
}

/* 탐험 지도: 확대 단추 · 누른 자리 표시 */
.fd-mapbox .pm-zoom { position: absolute; right: 14px; top: 50px; z-index: 5; display: flex; flex-direction: column; gap: 6px; }
.fd-mapbox .pm-zoom button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 250, 240, .92); color: var(--fd-green); font-size: 22px; font-weight: 800; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); cursor: pointer; }
.pk-ping { position: absolute; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .95); box-shadow: 0 0 0 2px rgba(47, 107, 58, .5); transform: scale(calc(1 / var(--s, 1))); animation: pk-ping .8s ease-out forwards; pointer-events: none; z-index: 2; }
@keyframes pk-ping { from { opacity: 1; scale: .4; } to { opacity: 0; scale: 1.4; } }

/* 화면 바뀔 때(지도 ↔ 관찰) 부드럽게 나타나게 */
.fd { animation: fd-in .6s ease-out; }
@keyframes fd-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fd { animation: none; } }

/* 예상 단추(Every Joule 「Predict」) */
.fd-choices { display: flex; gap: 8px; flex: none; }
.fd-choices button { border: 2px solid var(--fd-green-2); background: #fff; color: var(--fd-green); font: inherit; font-weight: 800; font-size: 15px; padding: 10px 16px; border-radius: 999px; cursor: pointer; }
.fd-choices button:hover { background: #eaf4e6; }
/* 도장 */
.fd-stamp { position: sticky; bottom: 20px; margin: -150px 24px 0 auto; width: 150px; height: 150px; border-radius: 50%; border: 6px double #c0392b; color: #c0392b; display: flex; flex-direction: column; align-items: center; justify-content: center; transform: rotate(-14deg); background: rgba(255, 250, 240, .55); font-weight: 900; pointer-events: none; animation: fd-stamp .5s cubic-bezier(.2, 1.6, .4, 1); mix-blend-mode: multiply; }
.fd-stamp b { font-size: 19px; letter-spacing: .05em; } .fd-stamp i { font-style: normal; font-size: 34px; line-height: 1.1; } .fd-stamp small { font-size: 12px; }
@keyframes fd-stamp { from { transform: rotate(-14deg) scale(2.4); opacity: 0; } to { transform: rotate(-14deg) scale(1); opacity: 1; } }
/* 지도: 도장 받은 장소 표 · 도장 수 */
.fd-stamps { position: absolute; left: 140px; top: 12px; z-index: 5; padding: 7px 14px; border-radius: 999px; background: rgba(255, 250, 240, .92); color: #c0392b; font-weight: 800; font-size: 14px; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.pm-map .pk-pin.stamped .pk-tag::before { content: '✓'; position: absolute; right: -10px; top: -10px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c0392b; color: #c0392b; background: #fff8ef; font-size: 13px; font-weight: 900; display: flex; align-items: center; justify-content: center; transform: rotate(-12deg); }

/* 지도 표 이름: 넓게 볼 때는 짧은 이름(긴 이름끼리 겹쳤다 — 원장 태블릿 화면), 확대하면 긴 이름 */
.pm-view.field:not(.zoomed) .pk-tag .full { display: none; }
.pm-view.field:not(.zoomed) .pk-tag .short { display: inline; }
/* 오른쪽 예시 보고서는 860px 종이 그대로 두고 칸 폭에 맞게 줄인다(field.js가 --fz를 정함) — 좁은 화면에서 오른쪽이 잘렸다 */
.fd-right .rp-sheet { width: 860px; max-width: none; zoom: var(--fz, 1); }
.fd-right .fd-note { max-width: none; }
/* 태블릿 폭에서는 보고서 쪽을 조금 넓게(글씨가 너무 작아지지 않게) */
@media (min-width: 761px) and (max-width: 1280px) { .fd-split { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); } }

/* 같이 그리기: 3D 위로 올라오는 종이 한 장(표본이 누운 자리) — 손이 크게 그린다 */
.fd-sheet { position: absolute; left: 50%; top: 47%; z-index: 3; width: min(90%, 640px); padding: 10px 14px 14px; border-radius: 6px; background: #fbf6ea; box-shadow: 0 14px 34px rgba(0, 0, 0, .38); transform: translate(-50%, -50%) rotate(-1.2deg); animation: fd-sheet-in .55s cubic-bezier(.2, .9, .3, 1); }
.fd-sheet h4 { margin: 0 0 6px; font-size: 15px; color: #6b5a2e; }
.fd-sheet .pz-wrap svg { display: block; width: 100%; height: auto; }
@keyframes fd-sheet-in { from { opacity: 0; transform: translate(-50%, -38%) rotate(-4deg); } to { opacity: 1; transform: translate(-50%, -50%) rotate(-1.2deg); } }

