:root {
  --sea: #2aa7e0;
  --sea-deep: #1c8cc4;
  --navy: #0b2f57;
  --yellow: #ffc82c;
  --cream: #fbf5e6;
  --white: #fffdf7;
  --orange: #f26b3a;
  --muted: #4d6378;
  --line: #d9d1bb;
  --error: #c2361b;
  --px: 4px;
  --pixel: 'Galmuri11', 'Galmuri9', monospace;
  --body: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  /* 찢어진 종이 가장자리: 크림색 종이 + 흰 섬유 결 */
  --torn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 14' preserveAspectRatio='none'%3E%3Cpath fill='%23ffffff' d='M0 14V5l7-3 6 4 9-5 7 4 8-2 7 5 8-5 7 3 9-4 7 5 8-3 9 4 6-4 8 3 7-4 7 3v10z'/%3E%3Cpath fill='%23fbf5e6' d='M0 14V8l7-2 6 3 9-4 7 4 8-2 7 4 8-4 7 3 9-3 7 4 8-3 9 4 6-3 8 3 7-3 7 2v6z'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--navy);
  font: 16px/1.65 var(--body);
  word-break: keep-all;
  overflow-wrap: anywhere;
  background-color: var(--sea);
  /* 픽셀 물결 패턴 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='32' shape-rendering='crispEdges'%3E%3Cpath fill='%2367c3ec' d='M8 8h4v4H8zm4-4h8v4h-8zm8 4h4v4h-4zM40 24h4v4h-4zm4-4h8v4h-8zm8 4h4v4h-4z'/%3E%3C/svg%3E");
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

.app { max-width: 480px; margin: 0 auto; padding-bottom: 112px; overflow-x: clip; }

.demo-banner {
  margin: 0; padding: 8px 16px;
  background: var(--navy); color: var(--yellow);
  font: 12px/1.5 var(--pixel); text-align: center;
}

/* ---------- 픽셀 공통 ---------- */
.px-icon { display: inline-block; vertical-align: -0.15em; image-rendering: pixelated; }
.px-btn {
  --bg: var(--white);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 22px;
  border: 0; background: var(--bg); color: var(--navy);
  font: 700 17px/1.2 var(--pixel); text-decoration: none; cursor: pointer;
  /* 계단식 픽셀 테두리 + 아래 그림자 */
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--navy), 0 var(--px) 0 0 var(--navy),
    calc(var(--px) * -1) 0 0 0 var(--navy), var(--px) 0 0 0 var(--navy),
    0 calc(var(--px) * 2) 0 0 var(--navy), var(--px) var(--px) 0 var(--px) rgb(11 47 87 / .25);
  transition: transform .08s steps(2);
}
.px-btn.yellow { --bg: var(--yellow); }
.px-btn.block { display: flex; width: 100%; }
.px-btn:active:not(:disabled) { transform: translateY(var(--px)); box-shadow: 0 calc(var(--px) * -1) 0 0 var(--navy), 0 var(--px) 0 0 var(--navy), calc(var(--px) * -1) 0 0 0 var(--navy), var(--px) 0 0 0 var(--navy); }
.px-btn:disabled { --bg: #c9c4b6; color: #6b6b6b; cursor: not-allowed; }
.px-card {
  background: var(--white);
  box-shadow:
    0 calc(var(--px) * -1) 0 0 var(--navy), 0 var(--px) 0 0 var(--navy),
    calc(var(--px) * -1) 0 0 0 var(--navy), var(--px) 0 0 0 var(--navy),
    calc(var(--px) * 2) calc(var(--px) * 2) 0 0 rgb(11 47 87 / .2);
}

/* ---------- 찢어진 종이 ---------- */
.paper {
  position: relative;
  margin: 34px 12px;
  padding: 28px 20px 26px;
  background: var(--cream);
  filter: drop-shadow(0 3px 0 rgb(11 47 87 / .18));
}
.torn::before, .torn::after {
  content: ''; position: absolute; left: 0; right: 0; height: 14px;
  background: var(--torn) 0 0 / 100% 100% no-repeat;
}
.torn::before { top: -13px; }
.torn::after { bottom: -13px; transform: scaleY(-1) scaleX(-1); }
.paper:nth-of-type(even) { transform: rotate(-.4deg); }
.paper:nth-of-type(odd) { transform: rotate(.3deg); }

/* ---------- 히어로 / HUD ---------- */
.hero { position: relative; }
.hero img { width: 100%; height: auto; aspect-ratio: 1080 / 1350; }
.hero::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 14' preserveAspectRatio='none'%3E%3Cpath fill='%23fffdf7' d='M0 14V5l7-3 6 4 9-5 7 4 8-2 7 5 8-5 7 3 9-4 7 5 8-3 9 4 6-4 8 3 7-4 7 3v10z'/%3E%3Cpath fill='%230b2f57' d='M0 14V8l7-2 6 3 9-4 7 4 8-2 7 4 8-4 7 3 9-3 7 4 8-3 9 4 6-3 8 3 7-3 7 2v6z'/%3E%3C/svg%3E") 0 0 / 100% 100%;
}
.hud {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px;
  padding: 12px 12px 14px;
  background: var(--navy); color: var(--white);
  font: 13px/1.4 var(--pixel);
}
.hud span { display: inline-flex; align-items: center; gap: 5px; }
.hud-badge {
  padding: 4px 10px; background: var(--yellow); color: var(--navy); font-weight: 700;
  animation: blink 1.2s steps(2) infinite;
}
.hud-badge.off { background: #8f98a3; animation: none; }
@keyframes blink { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .hud-badge { animation: none; } }

/* ---------- 섹션 제목 ---------- */
.sec-head { margin-bottom: 18px; }
.sec-en { margin: 0 0 4px; font: 12px/1.4 var(--pixel); letter-spacing: .08em; color: var(--orange); }
h1, h2, h3 { margin: 0; font-family: var(--pixel); font-weight: 700; line-height: 1.3; }
h2 { font-size: 24px; }
p { margin: 0 0 12px; }
.lead { font: 700 19px/1.55 var(--body); color: var(--navy); margin-bottom: 16px; }
.paper > p:not(.lead):not(.fine):not(.mode) { color: #253f5a; }
.fine { margin: 14px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- 모집 안내 ---------- */
.info-list { margin: 0; display: grid; gap: 0; }
.info-list > div { display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 12px 0; border-bottom: 2px dashed var(--line); }
.info-list > div:last-child { border-bottom: 0; }
.info-list dt { font: 13px/1.6 var(--pixel); color: var(--sea-deep); padding-top: 2px; }
.info-list dd { margin: 0; font-weight: 700; }
.info-list small { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }
.info-list.compact > div { padding: 8px 0; }

/* ---------- 코스 (바다 위 섹션) ---------- */
.sea-section { padding: 30px 12px 8px; color: var(--white); }
.sea-section .sec-head { text-align: center; }
.sea-section .sec-en { color: var(--yellow); }
.sea-section h2 { color: var(--white); text-shadow: 3px 3px 0 var(--navy); font-size: 26px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0 4px 22px; }
.tab {
  padding: 12px 8px; border: 0; cursor: pointer;
  background: rgb(255 255 255 / .55); color: var(--navy);
  font: 700 20px/1.2 var(--pixel);
  box-shadow: 0 -4px 0 0 var(--navy), 0 4px 0 0 var(--navy), -4px 0 0 0 var(--navy), 4px 0 0 0 var(--navy);
}
.tab small { display: block; margin-top: 4px; font: 400 12px/1.4 var(--body); }
.tab[aria-selected="true"].tab-A { background: var(--white); box-shadow: 0 -4px 0 0 var(--navy), 0 4px 0 0 var(--navy), -4px 0 0 0 var(--navy), 4px 0 0 0 var(--navy), 0 10px 0 0 var(--yellow); }
.tab[aria-selected="true"].tab-B { background: var(--navy); color: var(--white); box-shadow: 0 -4px 0 0 var(--white), 0 4px 0 0 var(--white), -4px 0 0 0 var(--white), 4px 0 0 0 var(--white), 0 10px 0 0 var(--yellow); }
.tab[aria-selected="true"]::before { content: '▶ '; }

/* 타임라인 (레퍼런스: 일정 앱의 세로 선 + 카드) */
.timeline { list-style: none; margin: 0; padding: 0 0 0 26px; position: relative; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 12px; bottom: 16px; width: 4px; background: repeating-linear-gradient(var(--white) 0 8px, transparent 8px 12px); }
.tl-item { position: relative; margin-bottom: 18px; }
.tl-dot { position: absolute; left: -23px; top: 18px; width: 16px; height: 16px; background: var(--yellow); box-shadow: 0 0 0 4px var(--navy); }
.tl-item.small .tl-dot { top: 16px; background: var(--white); }
.tl-dot.goal { background: var(--orange) !important; }
/* 집결·해산: 체크포인트 카드 */
.tl-plain {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; background: var(--navy); color: var(--white);
  font: 700 15px/1.4 var(--body);
  box-shadow: 0 -3px 0 0 var(--white), 0 3px 0 0 var(--white), -3px 0 0 0 var(--white), 3px 0 0 0 var(--white);
}
.tl-plain b { padding: 3px 8px; background: var(--yellow); color: var(--navy); font: 700 15px var(--pixel); }
.tl-plain.meet { display: block; padding: 16px 16px 14px; }
.tl-plain.meet p { margin: 0; }
.meet-label { font: 12px/1.4 var(--pixel); color: var(--yellow); letter-spacing: .06em; }
.meet-place { display: flex; align-items: center; gap: 10px; margin: 6px 0 8px !important; font: 700 22px/1.3 var(--pixel); }
.meet-place b { font-size: 20px; }
.meet-addr { font-size: 15px; font-weight: 700; }
.meet-note { font-size: 14px; font-weight: 400; color: #c9d6e4; }
.tl-item.start .tl-dot { top: 22px; width: 20px; height: 20px; left: -25px; background: var(--yellow); }

.store { overflow: hidden; color: var(--navy); }
.course-B .store { background: #f3f6fb; }
.store-photos { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--navy); }
.store-photos::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; margin: 0; aspect-ratio: 16 / 10; overflow: hidden; scroll-snap-align: start; background: var(--navy); }
.slide-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide-bg { display: none; }
/* 전체 보기: 사진은 잘리지 않게, 빈 곳은 같은 사진을 흐리게 채움 */
.slide.fit .slide-img { object-fit: contain; }
.slide.fit .slide-bg { display: block; position: absolute; inset: -24px; width: calc(100% + 48px); height: calc(100% + 48px); object-fit: cover; filter: blur(18px) brightness(.75); }
.photo-nav { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px; background: var(--navy); color: var(--yellow); font: 12px/1.4 var(--pixel); }
.photo-nav button { min-width: 44px; min-height: 32px; border: 0; background: var(--yellow); color: var(--navy); font: 14px var(--pixel); cursor: pointer; }
.photo-nav button:disabled { background: #3a5677; color: #7f93a8; cursor: default; }
.store-body { padding: 16px 16px 14px; }
.store-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font: 12px/1 var(--pixel); color: var(--muted); }
.time-tag { padding: 6px 8px; background: var(--sea); color: var(--white); font-size: 13px; }
.course-B .time-tag { background: var(--yellow); color: var(--navy); }
.store h3 { font-size: 26px; color: var(--sea-deep); margin-bottom: 4px; }
.course-B .store h3 { color: var(--navy); }
.store-title { font-weight: 800; font-size: 16px; margin-bottom: 8px; }
.store-body > p:nth-of-type(4) { font-size: 14.5px; color: #33495e; }
.store-provide { padding-top: 10px; border-top: 2px dashed var(--line); font-size: 14px; }
.store-provide b { color: var(--orange); margin-right: 8px; font-family: var(--pixel); }
.store-addr { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- 혜택 ---------- */
.reward-list { list-style: none; margin: 0; padding: 0; }
.reward-list li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 14px 0; border-bottom: 2px dashed var(--line); }
.reward-list li:last-child { border-bottom: 0; }
.reward-list .px-icon { margin-top: 2px; }
.r-label { margin: 0; font: 12px/1.5 var(--pixel); color: var(--sea-deep); }
.r-value { margin: 0; font-weight: 800; }
.r-note { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- 신청 방법 ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li { display: flex; gap: 12px; align-items: center; }
.steps b { flex: 0 0 32px; height: 32px; display: grid; place-items: center; background: var(--navy); color: var(--yellow); font: 16px var(--pixel); }
.steps em { font-style: normal; font-weight: 800; background: linear-gradient(transparent 60%, var(--yellow) 60%); }
.site-foot { padding: 12px 16px 24px; text-align: center; font-size: 12px; color: var(--white); }

/* ---------- 하단 고정 버튼 ---------- */
.cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 16px 20px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgb(11 47 87 / .55) 45%);
}
.cta-bar .px-btn { display: flex; width: 100%; max-width: 440px; margin: 0 auto; font-size: 18px; }

/* ---------- 신청서 ---------- */
.apply-top { padding: 22px 20px 4px; color: var(--white); }
.apply-top .sec-en { color: var(--yellow); margin-top: 18px; }
.apply-top h1 { font-size: 28px; text-shadow: 3px 3px 0 var(--navy); }
.back { font: 14px var(--pixel); text-decoration: none; }
.hp { display: flex; align-items: center; gap: 8px; margin-top: 14px; font: 12px var(--pixel); }
.hp-bar { flex: 1; height: 16px; background: var(--navy); padding: 3px; box-shadow: 0 0 0 3px var(--white); }
.hp-bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--yellow) 0 10px, #ffdc6b 10px 14px); transition: width .25s steps(6); }
#form { margin-top: 28px; }
.field { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.field label, .field legend, .group-title { display: block; margin-bottom: 6px; font: 700 15px/1.4 var(--pixel); }
.group-title { margin: 26px 0 12px; padding-top: 18px; border-top: 2px dashed var(--line); color: var(--sea-deep); }
legend { padding: 0; margin-bottom: 10px !important; color: var(--sea-deep); }
.opt { font: 400 12px var(--body); color: var(--muted); }
input:not([type=radio]):not([type=checkbox]):not([type=range]), textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 3px solid var(--navy); border-radius: 0; background: var(--white);
  font-size: 16px; appearance: none;
}
textarea { resize: vertical; min-height: 72px; }
input::placeholder, textarea::placeholder { color: #93a0ad; }
input[aria-invalid="true"] { border-color: var(--error); }
.help { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.field-error, .form-error { margin: 6px 0 0; font-size: 13px; font-weight: 700; color: var(--error); }
.field-error:empty, .form-error:empty { display: none; }
.form-error { margin: 0 0 14px; padding: 10px 12px; background: #fde4dc; }
.hp-trap { position: absolute; left: -9999px; width: 1px; height: 1px; }

.course-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pick input { position: absolute; opacity: 0; }
.pick-box {
  display: block; height: 100%; padding: 14px 12px; cursor: pointer;
  background: var(--white); box-shadow: 0 0 0 3px var(--line);
}
.pick-box b { display: block; margin-bottom: 6px; font: 700 20px var(--pixel); }
.pick-box small { display: block; font-size: 13px; color: var(--muted); }
.pick-box em { display: inline-block; margin-top: 8px; font: normal 11px var(--pixel); color: var(--muted); }
.pick input:checked + .pick-box { box-shadow: 0 0 0 4px var(--navy), 6px 6px 0 4px var(--yellow); }
.pick-A input:checked + .pick-box { background: #e3f4fc; }
.pick-B input:checked + .pick-box { background: var(--navy); color: var(--white); }
.pick-B input:checked + .pick-box small, .pick-B input:checked + .pick-box em { color: #c9d6e4; }
.pick input:checked + .pick-box b::before { content: '▶ '; color: var(--orange); }
.pick input:focus-visible + .pick-box { outline: 3px solid var(--orange); outline-offset: 6px; }

.chips { display: flex; gap: 10px; margin-bottom: 4px; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-block; padding: 10px 16px; background: var(--white); box-shadow: 0 0 0 3px var(--line); font: 700 15px var(--pixel); cursor: pointer; }
.chip input:checked + span { background: var(--navy); color: var(--yellow); box-shadow: 0 0 0 3px var(--navy), 4px 4px 0 3px var(--yellow); }
.chip input:checked + span::before { content: '✓ '; }
.chip input:focus-visible + span { outline: 3px solid var(--orange); outline-offset: 5px; }
#insta-field, #blog-field { margin-top: 14px; }
#form > .fine { margin-bottom: 18px; }
.agree { margin-bottom: 14px; padding: 14px; background: var(--white); box-shadow: 0 0 0 2px var(--line); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { flex: 0 0 22px; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--navy); }
.cond { margin: 10px 0 0; padding-left: 34px; font-size: 13.5px; color: #33495e; }
.cond li { margin-bottom: 4px; }
details { margin-top: 10px; padding-left: 32px; font-size: 13.5px; }
summary { cursor: pointer; font-weight: 700; color: var(--sea-deep); }
.privacy { margin: 10px 0 0; display: grid; grid-template-columns: 70px 1fr; gap: 6px 10px; }
.privacy dt { font-weight: 700; }
.privacy dd { margin: 0; color: #33495e; }

/* ---------- 완료 ---------- */
.done { margin-top: 48px; text-align: center; }
.done h1 { font-size: 34px; margin-bottom: 14px; }
.done .info-list { text-align: left; margin: 18px 0 22px; }
.clear-stars { display: flex; justify-content: center; align-items: flex-end; gap: 8px; margin-bottom: 12px; }
.clear-stars .px-icon { animation: hop .6s steps(2) infinite alternate; }
.clear-stars .px-icon:nth-child(2) { animation-delay: .3s; }
@keyframes hop { to { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .clear-stars .px-icon { animation: none; } }

@media (min-width: 520px) {
  .app { padding-top: 24px; }
  .hero img { box-shadow: 0 0 0 4px var(--navy); }
}

/* ---------- 지도 / 제작 표기 ---------- */
.map-section { padding-top: 20px; }
.map-card { margin: 0 4px 12px; }
.map-card img { width: 100%; height: auto; aspect-ratio: 1080 / 1350; }
.map-card figcaption { padding: 8px 12px; background: var(--navy); color: var(--yellow); font: 12px/1.4 var(--pixel); text-align: center; }
.credit { display: block; margin-top: 6px; font: 12px var(--pixel); color: var(--yellow); letter-spacing: .04em; }

/* ---------- 지도 코스 동선 ---------- */
.map-section .tabs { margin-bottom: 16px; }
.map-wrap { position: relative; display: block; }
.route { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.route-base { fill: none; stroke: var(--white); stroke-width: 10; stroke-dasharray: 4 18; stroke-linecap: square; opacity: .9; }
.route-trail { fill: none; stroke: var(--orange); stroke-width: 12; stroke-linecap: square; }
.route-stop rect { fill: var(--white); stroke: var(--navy); stroke-width: 6; }
.route-stop text { fill: var(--navy); font: 700 28px var(--pixel); text-anchor: middle; }
.route-stop path { fill: var(--navy); }
.route-stop.hit rect { fill: var(--yellow); }
.route-dot rect { fill: var(--orange); stroke: var(--navy); stroke-width: 8; }
.route-dot rect.eye { fill: var(--navy); stroke: none; }

/* 도보 이동 시간 */
.tl-walk { list-style: none; margin: -6px 0 12px; font: 13px/1.4 var(--pixel); color: var(--navy); }
.tl-walk span { display: inline-block; padding: 4px 10px; background: var(--yellow); box-shadow: 0 0 0 3px var(--navy); }
.route-walk rect { fill: var(--navy); }
.route-walk text { fill: var(--yellow); font: 700 26px var(--pixel); text-anchor: middle; }
.walk-min { color: var(--white); }

.map-card { position: relative; }
.route-toggle { position: absolute; top: 10px; right: 10px; z-index: 2; padding: 6px 10px; border: 0; background: var(--navy); color: var(--yellow); font: 12px var(--pixel); box-shadow: 0 0 0 3px var(--white); cursor: pointer; }

/* 하단 로고: 비율이 다른 세 로고를 같은 면적(시각 무게)으로 맞춰 한 줄 배치 */
.site-foot .org-logos { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-evenly; gap: 14px; margin: 0 4px 14px; padding: 16px 14px; background: var(--white); box-shadow: 0 0 0 3px var(--navy); }
.org-logos img { width: auto; min-width: 0; flex: 0 1 auto; object-fit: contain; }
.logo-jeju { height: 17px; }
.logo-kma { height: 28px; } /* 진한 남색이라 조금 작게 */
.logo-tdn { height: 30px; } /* 연한 하늘색이라 조금 크게 */
.site-foot .credit { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; font: 12px var(--pixel); color: var(--yellow); }
.site-foot .credit img { width: 34px; height: 34px; }
