
:root {
  /* 찰토의 찰나 사진 여행: 아이보리 여행 앨범 위에 장소별 장면. 숲 초록은 행동, 금색은 '지금'에만 */
  --paper: #f8f9f3;
  --card: #ffffff;
  --photo: #f4f1e8;
  --ink: #192d25;
  --muted: #4f6158;
  --line: #dbe3d9;
  --forest: #176b4b;
  --forest-d: #12583d;
  --mint: #dceee4;
  --gold: #efbb56;
  --warn: #9a4f2c;
  --display: "Jua", "Noto Sans KR", system-ui, sans-serif;
  --body: "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --num: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}
html:lang(ja) {
  --display: "Noto Sans JP", system-ui, sans-serif;
  --body: "Noto Sans JP", system-ui, sans-serif;
}
html:lang(zh) {
  --display: "Noto Sans SC", system-ui, sans-serif;
  --body: "Noto Sans SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}
html:lang(ko) body { word-break:keep-all; }
html:is(:lang(ja),:lang(zh)) body { word-break:normal;line-break:strict;overflow-wrap:anywhere; }
html:is(:lang(ja),:lang(zh)) .route .muted { white-space:nowrap; }
body[data-sense-public]:has(> .pg-site-header) {background:var(--paper)}
.app { max-width: 480px; margin: 0 auto; padding: 14px 16px 40px; }
.view { display: grid; gap: 16px; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.display { font-family: var(--display); font-weight: 400; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3, p, figure { margin: 0; }
h1.display { font-size: 34px; line-height: 1.12; color: var(--forest-d); text-wrap: balance; }
h2 { font-size: 18px; font-weight: 800; }
.eyebrow { font-size: 13px; font-weight: 700; color: var(--forest); }

/* 버튼 */
.btn {
  min-height: 48px; padding: 0 20px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: 700 15px/1.2 var(--body); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn.primary { background: var(--forest); border-color: var(--forest); color: #fff; }
.btn.big { min-height: 56px; font-family: var(--display); font-weight: 400; font-size: 21px; width: 100%; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-weight: 500; font-size: 14px; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn:focus-visible, .pad-btn:focus-visible, .tile:focus-visible, .win:focus-visible, select:focus-visible, input:focus-visible, .rec:focus-visible { outline: 3px solid #7fbf9f; outline-offset: 2px; }
.stage:focus-visible { outline: 3px solid rgba(127, 191, 159, 0.7); outline-offset: 3px; }

/* 즉석 사진 */
.photo { background: var(--photo); padding: 12px 12px 46px; position: relative; box-shadow: 0 14px 30px rgba(25, 45, 37, 0.16); }
.photo:has(> .cap) {
  --sense-caption-foot: 10px;
  --sense-caption-space: 36px;
  --sense-caption-inline: 2px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: var(--chalna-space-small);
  grid-template-rows: auto minmax(calc(var(--sense-caption-space) - var(--chalna-space-small)), max-content);
  padding-block-end: var(--sense-caption-foot);
}
.photo.tilt-l { transform: rotate(-2deg); }
.photo.tilt-r { transform: rotate(2deg); }
.shot { position: relative; overflow: hidden; aspect-ratio: 1 / 1; display: flex; align-items: flex-end; justify-content: center; }
.shot > svg.bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.shot-chalto { position: relative; height: 78%; max-width: 92%; object-fit: contain; display: block; }
.cap { align-self: end; margin-inline: var(--sense-caption-inline); font-family: var(--display); font-size: 22px; color: #2b2a24; line-height: 1.2; }
.temp { position: absolute; top: 8px; right: 8px; font-size: 12px; background: rgba(255, 255, 255, 0.88); color: var(--muted); border-radius: 999px; padding: 2px 8px; }

/* 장면 색 */
.scene.meadow, .stage.meadow { background: linear-gradient(180deg, #cfe7f2 0%, #e8f3dd 58%, #c2dfa8 100%); }
.scene.beach, .stage.beach { background: linear-gradient(180deg, #f3c47c 0%, #e8956a 48%, #b8675a 72%, #6f6a86 100%); }
.scene.night, .stage.night { background: linear-gradient(180deg, #08130f 0%, #0d1d16 60%, #12261c 100%); }
.scene.market { background: linear-gradient(180deg, #fbf3e6 0%, #f6e7d2 100%); }
.scene.dusk, .stage.dusk { background: linear-gradient(180deg, #2a3557 0%, #3c3f66 55%, #4b4466 100%); }
.scene.path, .stage.path { background: linear-gradient(180deg, #e3f0d6 0%, #d3e7c0 60%, #bcd9a3 100%); }
.scene.view { background: linear-gradient(180deg, #f6cf8c 0%, #ec9e74 55%, #8a7aa0 100%); }

/* 시작 */
.start { display: grid; gap: 16px; }
.top-row { display: flex; justify-content: space-between; align-items: center; min-height: 32px; }
.hero-wrap { display: flex; justify-content: center; padding: 6px 0 4px; }
.hero-wrap .photo { width: min(78%, 300px); }
.lede { color: #2f4a3e; }
.banner { background: #fff6dc; border: 1px solid #f0d99a; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.route { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.route li { background: var(--card); border-radius: 12px; border: 1px solid var(--line); padding: 8px 10px; display: flex; align-items: center; gap: 8px; font-size: 13px; min-height: 44px; }
.route-n { font-family: var(--display); color: var(--forest); font-size: 17px; width: 14px; }
.age-row { display: grid; gap: 6px; }
.age-row label { font-size: 13px; color: var(--muted); }
.select { min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font: 500 15px var(--body); color: var(--ink); padding: 0 12px; }
.meta { font-size: 12px; color: var(--muted); text-align: center; }
details.method { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px; }
details.method summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
details.method ul { margin: 0 0 12px; padding-left: 18px; font-size: 13px; color: #2f4a3e; display: grid; gap: 6px; }
.code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-bottom: 6px; }
.code-row .select { font: 500 14px var(--num); min-width: 0; }

/* 여행 진행 */
.trip-bar { display: grid; gap: 8px; }
.trip-top { display: flex; align-items: baseline; gap: 8px; }
.trip-step { font-size: 12px; color: var(--muted); }
.trip-place { font-family: var(--display); font-weight: 400; font-size: 20px; color: var(--forest-d); }
.trip-sense { font-size: 13px; color: var(--muted); }
.film { list-style: none; margin: 0; padding: 6px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; background: #20302a; border-radius: 8px; }
.film li { height: 30px; border-radius: 4px; background: #33443c; color: #8fa198; display: flex; align-items: center; justify-content: center; }
.film li.done { background: var(--mint); color: var(--forest-d); }
.film li.now { background: #20302a; color: var(--gold); box-shadow: inset 0 0 0 2px var(--gold); }

/* 장소 소개와 완료 */
.intro, .done { display: grid; gap: 16px; }
.intro .photo, .done .photo { width: min(86%, 340px); justify-self: center; }
.intro-text { display: grid; gap: 6px; }
.intro-text h2.display { font-size: 28px; line-height: 1.15; color: var(--forest-d); }
.chip { display: inline-flex; align-items: center; gap: 6px; justify-self: start; background: var(--mint); color: var(--forest-d); border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 700; }
.done-line { font-family: var(--display); font-size: 24px; color: var(--forest-d); text-align: center; }
.calib { min-height: 60vh; display: flex; align-items: center; justify-content: center; text-align: center; }
.calib .display { font-size: 26px; color: var(--forest-d); }

/* 측정 무대 */
.test { display: grid; gap: 12px; }
.stage {
  position: relative; width: min(100%, calc(58vh * 0.8)); aspect-ratio: 4 / 5; justify-self: center;
  border-radius: 18px; overflow: hidden; outline: none; cursor: pointer;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
.stage > svg.bg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hud { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: 12px 14px; font-size: 12px; pointer-events: none; }
.tag { background: rgba(255, 255, 255, 0.9); color: var(--forest-d); border-radius: 999px; padding: 2px 10px; font-weight: 700; }
.cnt { background: rgba(25, 45, 37, 0.62); color: #fff; border-radius: 999px; padding: 2px 10px; }
.cnt:empty { display: none; }
.hint { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 16px 14px; text-align: center; font-size: 14px; font-weight: 700; color: #fff; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.42)); pointer-events: none; min-height: 1.6em; }
.hint:empty { display: none; }
.readout { position: absolute; left: 0; right: 0; top: 18%; text-align: center; font-size: 40px; font-weight: 600; color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45); pointer-events: none; }
.test.with-pad .stage, .test.with-pad .pad { width: min(100%, calc(50vh * 0.8)); width: min(100%, calc(50dvh * 0.8)); }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.on { opacity: 0.8; }
.flash.fade { opacity: 0; transition: opacity 0.2s ease-out; }

/* 반응 */
.branch { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
/* 새의 발이 가지(높이 약 48~50%)에 닿도록 아래쪽 기준으로 놓는다 */
.bird { position: absolute; left: 46%; bottom: 48.5%; width: 30%; visibility: hidden; pointer-events: none; }
.bird.show { visibility: visible; }
.bird svg, .bird img { width: 100%; height: auto; display: block; }

/* 시간 */
.expo-photo { position: absolute; left: 50%; top: 10%; width: 46%; transform: translateX(-50%) rotate(-2deg); background: var(--photo); padding: 8px 8px 30px; box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3); visibility: hidden; pointer-events: none; }
.expo-photo.show { visibility: visible; }
.expo-shot { aspect-ratio: 1 / 1; position: relative; overflow: hidden; background: linear-gradient(180deg, #f3c47c 0%, #e8956a 52%, #6f6a86 100%); }
.expo-shot svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.expo-cap { position: absolute; left: 0; right: 0; bottom: 5px; text-align: center; font-size: 16px; font-weight: 600; color: #2b2a24; }
.shutter {
  position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%);
  width: 104px; height: 104px; border-radius: 50%; border: 4px solid #fff; background: rgba(25, 45, 37, 0.35);
  padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.shutter span { width: 78px; height: 78px; border-radius: 50%; background: #fff; }
.ring { position: absolute; left: -18px; top: -18px; width: 132px; height: 132px; transform: rotate(-90deg); pointer-events: none; display: none; overflow: visible; }
.ring.on { display: block; }
.ring circle { fill: none; stroke-width: 6; }
.ring .rb { stroke: rgba(255, 255, 255, 0.35); }
.ring .rf { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.shutter.pressed { border-color: var(--gold); }
.shutter.pressed span { transform: scale(0.9); box-shadow: 0 0 0 10px rgba(239, 187, 86, 0.25); }

/* 포착 */
.field { position: absolute; left: 8%; right: 8%; top: 14%; bottom: 16%; pointer-events: none; }
.dots, .mask { position: absolute; inset: 0; }
.dots[hidden], .mask[hidden], .fix[hidden] { display: none; }
.fly { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff4c4; box-shadow: 0 0 10px 4px rgba(255, 228, 130, 0.7); }
.mk { position: absolute; border-radius: 50%; background: #6f7f86; }
.fix { position: absolute; left: 50%; top: 47%; transform: translate(-50%, -50%); color: rgba(255, 255, 255, 0.7); font: 600 28px var(--num); pointer-events: none; }
.pad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: min(100%, calc(58vh * 0.8)); justify-self: center; }
.pad-btn { min-height: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); font: 400 24px var(--display); color: var(--forest-d); cursor: pointer; }
.pad-btn:disabled { opacity: 0.45; cursor: default; }

/* 색감 */
.tiles { position: absolute; left: 8%; right: 8%; top: 16%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile { aspect-ratio: 1 / 1; border: 0; border-radius: 12px; cursor: pointer; padding: 0; }
.tile.right { box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--forest); }
.tile.wrong { box-shadow: 0 0 0 4px #fff, 0 0 0 7px #b04a34; }

/* 기억 */
.win { position: absolute; width: 17%; aspect-ratio: 1 / 1; transform: translate(-50%, -50%); border-radius: 10px; border: 2px solid #6b6f93; background: #2b3150; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.win span { width: 62%; height: 62%; border-radius: 6px; background: #3a4166; }
.win.on span, .win.tap span { background: #ffd877; box-shadow: 0 0 16px 6px rgba(255, 216, 119, 0.55); }
.win.on, .win.tap { border-color: #ffd877; }
.win.bad { border-color: #e2795d; }
.win:disabled { cursor: default; }

/* 판단 */
.stim { position: absolute; left: 32%; bottom: 22%; width: 36%; height: 36%; pointer-events: none; }
.stim > * { position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; width: 100%; height: 100%; visibility: hidden; }
.stim > .show { visibility: visible; }
.stim img { object-fit: contain; object-position: center bottom; }
.stim svg { width: 100%; height: 100%; display: block; }
.bush { position: absolute; left: 4%; right: 4%; bottom: 6%; height: 30%; pointer-events: none; }
.bush svg { width: 100%; height: 100%; display: block; }

/* 결과 */
.result { display: grid; gap: 22px; }
.res-head { display: grid; gap: 4px; }
.type-wrap { display: flex; justify-content: center; padding: 4px 0; }
.type-wrap .photo { width: min(88%, 330px); padding-bottom: 74px; }
.type-cap { position: absolute; left: 14px; right: 62px; bottom: 10px; display: grid; gap: 2px; }
.type-cap b { font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.1; color: #2b2a24; }
.type-cap span { font-size: 12px; color: #5b5a50; line-height: 1.4; }
.mini-hex { position: absolute; right: 12px; bottom: 16px; width: 44px; height: 44px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 10px; }
.hex { position: relative; width: min(100%, 300px); aspect-ratio: 300 / 290; justify-self: center; }
.hex svg { width: 100%; height: 100%; display: block; }
.hex .g { fill: none; stroke: #dbe3d9; stroke-width: 1; }
.hex .g.outer { fill: #fbfcf9; }
.hex .g.half { stroke: #9fc4b4; stroke-dasharray: 4 4; }
.hex .ax { stroke: #e7ece4; stroke-width: 1; }
.hex .me { fill: rgba(23, 107, 75, 0.18); stroke: var(--forest); stroke-width: 2; stroke-linejoin: round; }
.hex .friend { fill: rgba(239, 187, 86, 0.18); stroke: #c98f2e; stroke-width: 2; stroke-dasharray: 5 4; stroke-linejoin: round; }
.hex .dot { fill: var(--forest); }
.hex-l { position: absolute; transform: translate(-50%, -50%); font-size: 12px; color: var(--muted); text-align: center; line-height: 1.25; white-space: nowrap; }
html:is(:lang(en),:lang(ja),:lang(zh)) .hex-l:is(:nth-of-type(3),:nth-of-type(5)) {
  transform: translate(-50%, 0);
}
.hex-l b { display: block; font-size: 13px; color: var(--ink); }
.legend { display: flex; gap: 14px; justify-content: center; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
.album { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.album li { background: var(--photo); padding: 6px 6px 10px; display: grid; gap: 4px; box-shadow: 0 6px 14px rgba(25, 45, 37, 0.1); }
.album .mini { aspect-ratio: 1 / 1; display: flex; align-items: flex-end; justify-content: center; position: relative; overflow: hidden; }
.album .mini svg.bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.album .mini .mini-chalto { position: relative; height: 84%; max-width: 96%; object-fit: contain; display: block; }
.album .mini .ic { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 255, 255, 0.9); display: flex; align-items: center; justify-content: center; color: var(--forest-d); }
.album .mini .ic.solo { position: relative; top: auto; left: auto; width: 34px; height: 34px; align-self: center; }
.album b { font-size: 12px; }
.album .val { font-family: var(--num); font-size: 13px; font-weight: 600; }
.album .bar { height: 5px; background: #e3ddcc; border-radius: 3px; overflow: hidden; }
.album .bar i { display: block; height: 100%; background: var(--forest); }
.album .sc { font-size: 12px; color: #5b5a50; }
.album li.best { box-shadow: 0 0 0 3px var(--gold), 0 6px 14px rgba(25, 45, 37, 0.1); }
table.mt { width: 100%; border-collapse: collapse; font-size: 13px; }
.mt th, .mt td { padding: 8px 0; border-bottom: 1px solid #eef1ec; text-align: left; }
html:not(:lang(ko)) .mt tr > :not(:first-child) { padding-inline-start: var(--chalna-space-small); }
.mt thead th { font-size: 12px; color: var(--muted); font-weight: 500; border-bottom-color: var(--line); }
html:lang(ja) .mt :is(thead th, th[scope="row"]) { white-space: nowrap; }
.mt td.n, .mt th.n { text-align: right; }
.mt td { font-family: var(--num); }
.mt .sub { display: block; font-size: 12px; color: var(--muted); }
.foot { font-size: 12px; color: var(--muted); }
dl.info { margin: 0; display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 6px 10px; font-size: 13px; }
dl.info dt { color: var(--muted); }
dl.info dd { margin: 0; }
.note { font-size: 12px; color: #2f4a3e; background: #eef4ef; border-radius: 12px; padding: 10px 12px; }
.share { display: grid; gap: 10px; }
.share .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.copy-msg { font-size: 13px; font-weight: 700; color: var(--forest); min-height: 1.4em; }
textarea.json { width: 100%; font: 11px/1.5 var(--num); color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px; resize: vertical; }
.recs { display: grid; gap: 10px; }
.rec { min-height: 60px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.rec b { font-size: 15px; display: block; }
.rec span { font-size: 12px; color: var(--muted); }
.disclaimer { font-size: 12px; color: var(--muted); line-height: 1.6; }

@media (max-width: 360px) {
  h1.display { font-size: 30px; }
  .route { grid-template-columns: 1fr; }
  .album { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .flash.fade { transition: none; }
}

details.method summary,.app button:not(.shutter),.app select {min-height:48px}
.win {min-width:48px}
dialog {max-width:min(95vw,540px);max-height:94dvh;border:0;border-radius:14px;color:var(--ink)}
dialog img {display:block;max-width:100%;max-height:65dvh;object-fit:contain;margin:auto}
dialog button {min-height:48px}
body:has(.test) {overflow:hidden}
.app:has(.with-pad) {padding-block:4px}
.test.with-pad {gap:6px}
.test.with-pad .stage {width:min(100%,calc((100dvh - 344px)*.8))}
@media (min-width:600px){.start .hero-wrap {max-width:240px;margin:auto}}

/* Stable metrics and no additional font-subset fetches while stimuli are visible. */
body:not(.trip-fonts-ready):has(.test) .app {--body:system-ui,sans-serif;--display:system-ui,sans-serif;--num:ui-monospace,monospace;font-family:var(--body)}

:root {--chalna-space-small:4px;--chalna-space-large:12px;--chalna-space-panel:16px;--chalna-text-body:14px}
@media (max-height:700px) {
  .start {gap:10px}
  .hero-wrap .photo {width:min(58%,160px)}
}
@media (max-height:590px) {
  .hero-wrap .photo {width:135px;padding-inline:8px;padding-block-start:8px}
  .hero-wrap .photo:has(> .cap) {--sense-caption-foot:6px;--sense-caption-space:26px;--sense-caption-inline:6px}
  .hero-wrap .cap {font-size:17px}
}

.chalna-foot a {min-height:48px;min-width:48px;display:inline-flex;align-items:center;justify-content:center}

body:has(.test) > .chalna-foot {display:none}

.sense-save-dialog {width:min(94vw,540px);padding:16px;background:var(--paper);border:1px solid var(--line);border-radius:18px}
.sense-save-dialog h2 {font-family:var(--display);margin:0;font-size:24px}
.sense-save-dialog p {margin:4px 0 12px}
.sense-save-dialog img {max-height:calc(94dvh - 160px)}
.sense-save-dialog .btn {margin-top:12px;width:100%;min-height:48px}
.sense-save-dialog::backdrop {background:rgba(25,45,37,.55)}
