/* 함께 걷는 존중 길 · 밝고 경쾌한 놀이형 */
@font-face { font-family: 'GangwonEdu'; src: url(/fonts/gangwonedu-bold.woff2) format('woff2'); font-display: swap; }
:root {
  --ink: #1E2A4A;
  --muted: #5B6685;
  --line: #E3E8F3;
  --blue: #3D8BFD; --blue-d: #2563C9;
  --yellow: #FFD43B; --yellow-d: #E0AE00;
  --red: #F03E3E;
  --m1: #FF6B6B; --m2: #FF9F1C; --m3: #845EF7; --m4: #12B886;
  --radius: 22px;
  --fun: 'Jua', -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 17px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; color: var(--ink); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  line-height: 1.55; word-break: keep-all; min-height: 100vh;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,107,107,.18) 0 6px, transparent 7px),
    radial-gradient(circle at 86% 12%, rgba(255,212,59,.35) 0 8px, transparent 9px),
    radial-gradient(circle at 78% 44%, rgba(132,94,247,.16) 0 5px, transparent 6px),
    radial-gradient(circle at 8% 62%, rgba(18,184,134,.18) 0 7px, transparent 8px),
    radial-gradient(circle at 92% 82%, rgba(61,139,253,.18) 0 6px, transparent 7px),
    linear-gradient(180deg, #D9F0FF 0%, #F2F9FF 38%, #FFF8E8 100%);
  background-attachment: fixed;
}
a { color: var(--blue-d); }
button { font: inherit; }
h1, h2, .fun { font-family: var(--fun); font-weight: 400; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; line-height: 1.3; margin: 0 0 .5rem; }
h2 { font-size: 1.35rem; line-height: 1.35; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }

/* 상단 바 */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px 14px; background: #fff; box-shadow: 0 2px 0 var(--line);
}
.top a { text-decoration: none; }
.brand { display: flex; align-items: center; gap: 6px; font-family: var(--fun); font-size: 1.15rem; color: var(--ink); white-space: nowrap; min-width: 0; }
.brand img { height: 28px; width: auto; display: block; flex: none; }
.brand img + span + .dots { display: none; }
.brand .dots { display: inline-flex; gap: 3px; }
.brand .dots i { width: 7px; height: 7px; border-radius: 50%; display: block; }
.fam { font-family: var(--fun); font-size: .92rem; color: #fff; background: var(--blue); padding: 5px 11px; border-radius: 999px; white-space: nowrap; flex: none; }
.wrap { max-width: 520px; margin: 0 auto; padding: 18px 16px 44px; }

.card { background: #fff; border-radius: var(--radius); padding: 22px 20px; box-shadow: 0 6px 0 rgba(30,42,74,.06), 0 1px 3px rgba(30,42,74,.06); margin-bottom: 16px; }
.muted { color: var(--muted); }
.note { font-size: .88rem; color: var(--muted); background: #F1F5FD; border-radius: 14px; padding: 10px 12px; margin-top: 14px; }
.err { color: var(--red); font-weight: 700; }

.form label { display: block; font-weight: 700; margin-bottom: 12px; }
.form input, textarea {
  display: block; width: 100%; margin-top: 6px; font-size: 1.4rem; padding: 12px 14px; border: 3px solid var(--line);
  border-radius: 16px; background: #fff; color: var(--ink); letter-spacing: .06em; font-family: var(--fun);
}
.form input:focus, textarea:focus { outline: none; border-color: var(--blue); }
textarea { font-size: 1.2rem; letter-spacing: 0; resize: none; }

/* 버튼: 눌리는 젤리 버튼 */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px; border: 0;
  border-radius: 18px; font-family: var(--fun); font-size: 1.2rem; padding: 12px 16px; cursor: pointer; text-decoration: none;
  background: #fff; color: var(--ink); margin-top: 12px; box-shadow: 0 5px 0 #D5DCEB, inset 0 0 0 3px #D5DCEB;
  transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #D5DCEB, inset 0 0 0 3px #D5DCEB; }
.btn.primary { background: var(--blue); color: #fff; box-shadow: 0 5px 0 var(--blue-d); }
.btn.primary:active { box-shadow: 0 1px 0 var(--blue-d); }
.btn.accent { background: var(--yellow); color: #3B2F00; box-shadow: 0 5px 0 var(--yellow-d); }
.btn.accent:active { box-shadow: 0 1px 0 var(--yellow-d); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 3px var(--line); }
.btn.small { min-height: 44px; font-size: 1rem; width: auto; display: inline-flex; padding: 8px 14px; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.row { display: flex; gap: 10px; }
.row .btn { flex: 1; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--fun); font-size: 1rem; color: #fff; background: var(--c, var(--blue));
  padding: 4px 14px 4px 4px; border-radius: 999px; margin-bottom: 12px; }
.badge i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; background: #fff; color: var(--c); display: inline-flex; align-items: center; justify-content: center; }
.place { font-size: .95rem; color: var(--muted); }
.place::before { content: "📍 "; }

/* 도란이 */
.card { position: relative; }
.doran { display: block; pointer-events: none; }
.doran.corner { position: absolute; right: 8px; top: -34px; width: 92px; }
.doran.hero-d { width: 120px; margin: -10px auto 2px; }
.doran.cheer { width: 110px; margin: -70px auto -6px; position: relative; z-index: 3; animation: hop .7s .3s both; }
@keyframes hop { 0% { transform: translateY(30px) scale(.6); opacity: 0; } 60% { transform: translateY(-8px); opacity: 1; } 100% { transform: none; } }
.wrap > .card:first-child { margin-top: 26px; }

/* 도장판 */
.hero { text-align: center; padding-top: 18px; }
.hero h1 { margin-bottom: 4px; }
.track { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 10px 0 4px; }
.track span { height: 12px; flex: 1; max-width: 70px; border-radius: 999px; background: #E9EEF7; }
.track span.on { background: var(--c); }
.progress { font-family: var(--fun); font-size: 1.15rem; }
.board { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 6px; }
.slot { aspect-ratio: 1 / 1; background: #fff; border: 3px dashed #D5DCEB; border-radius: 24px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 8px; position: relative; }
.slot .num { width: 44px; height: 44px; border-radius: 50%; background: color-mix(in srgb, var(--c) 18%, #fff); color: var(--c);
  font-family: var(--fun); font-size: 1.5rem; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.slot .slot-name { font-family: var(--fun); font-size: 1.15rem; color: var(--ink); }
.slot .slot-sub { font-size: .76rem; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.slot.done { border: 3px solid var(--c); background: color-mix(in srgb, var(--c) 8%, #fff); }
.slot.pending { border-style: solid; }
.slot.pending .seal { opacity: .4; }
.seal { width: 86%; display: block; transform: rotate(-10deg); }
.slot.done .seal { animation: wobble 4s ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(-4deg) scale(1.03); } }

.complete { text-align: center; }
.complete .qr { background: #fff; display: inline-block; padding: 10px; border-radius: 18px; border: 4px solid var(--yellow); margin: 8px 0; }
.complete .qr svg { width: 220px; height: 220px; display: block; }
.complete .bigno { font-family: var(--fun); font-size: 2.2rem; letter-spacing: .08em; }
.gift { background: #E6FCF5; color: #087F5B; font-family: var(--fun); font-size: 1.15rem; border-radius: 18px; padding: 14px; }

/* 도장 찍힘 */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(30,42,74,.62); display: flex; align-items: center; justify-content: center; padding: 20px; overflow: hidden; }
.overlay .card { width: 100%; max-width: 420px; text-align: center; position: relative; z-index: 2; }
.overlay .seal { width: 62%; margin: -4px auto 10px; animation: thump .6s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes thump { 0% { transform: scale(2.4) rotate(-40deg); opacity: 0; } 100% { transform: scale(1) rotate(-10deg); opacity: 1; } }
.confetti { position: absolute; left: 50%; top: 42%; width: 10px; height: 16px; border-radius: 3px; z-index: 1; animation: burst 1.4s ease-out forwards; }
@keyframes burst { 0% { transform: translate(-50%, -50%) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px;
  border-radius: 999px; font-size: .92rem; z-index: 80; max-width: 92vw; text-align: center; }

/* 미션 1 · AR */
.ar { position: fixed; inset: 0; background: #1E2A4A; overflow: hidden; z-index: 30; touch-action: none; }
.ar video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ar-bg { position: absolute; inset: 0; background:
  radial-gradient(ellipse at 50% 125%, #69DB7C 0 38%, transparent 39%),
  radial-gradient(circle at 80% 18%, #FFE066 0 40px, transparent 42px),
  linear-gradient(#A5D8FF, #E7F5FF 62%, #8CE99A 62%); }
.ar-layer { position: absolute; inset: 0; }
.bubble { position: absolute; left: 0; top: 0; border: 0; background: none; padding: 0; will-change: transform; cursor: pointer; }
.bubble .bb { position: relative; display: block; font-family: 'GangwonEdu', var(--fun); font-size: 2.3rem; line-height: 1; color: #fff; white-space: nowrap;
  padding: 18px 30px 20px; border-radius: 32px;
  background: radial-gradient(120% 90% at 30% 15%, color-mix(in srgb, var(--c) 55%, #fff) 0%, var(--c) 55%, color-mix(in srgb, var(--c) 80%, #000) 100%);
  box-shadow: 0 7px 0 color-mix(in srgb, var(--c) 70%, #000), 0 14px 24px rgba(0,0,0,.28), inset 0 0 0 4px rgba(255,255,255,.85);
  text-shadow: 0 2px 0 rgba(0,0,0,.18); animation: bob 2.6s ease-in-out infinite; }
.bubble .bb::before { content: ""; position: absolute; left: 12px; top: 6px; width: 26%; height: 16%; border-radius: 999px; background: rgba(255,255,255,.55); }
.bubble .bb::after { content: ""; position: absolute; left: 50%; bottom: -15px; margin-left: -11px; border: 11px solid transparent; border-top-color: color-mix(in srgb, var(--c) 85%, #000); border-bottom: 0; }
.bubble .spark { position: absolute; right: -12px; top: -18px; font-style: normal; font-size: 1.7rem; color: #FFD43B; text-shadow: 0 1px 2px rgba(0,0,0,.35); animation: twinkle 1.4s ease-in-out infinite; }
.bubble.pop .bb { animation: popin .45s cubic-bezier(.2,1.6,.4,1), bob 2.6s .45s ease-in-out infinite; }
.bubble.ground .bb { animation: none; transform: perspective(320px) rotateX(32deg); border-radius: 22px; }
.bubble.ground .bb::after { display: none; }
.bubble.ground .shadow { display: block; width: 86%; height: 18px; margin: 6px auto 0; border-radius: 50%; background: rgba(0,0,0,.28); filter: blur(4px); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes popin { 0% { transform: scale(.3); } 100% { transform: scale(1); } }
@keyframes twinkle { 0%, 100% { opacity: .5; transform: scale(.8) rotate(0); } 50% { opacity: 1; transform: scale(1.15) rotate(20deg); } }
.kwfont { font-family: 'GangwonEdu', var(--fun) !important; }
.ar-hud { position: absolute; left: 0; right: 0; top: 0; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.pill { background: #fff; border-radius: 999px; padding: 8px 18px; font-family: var(--fun); font-size: 1.15rem; box-shadow: 0 4px 0 rgba(0,0,0,.15); }
.pill .gems { margin-left: 6px; letter-spacing: 2px; }
.hint { background: var(--ink); color: #fff; border-radius: 14px; padding: 8px 14px; font-family: var(--fun); font-size: 1.05rem; display: none; }
.hint.on { display: block; }
.ar-start, .sheet { position: absolute; left: 12px; right: 12px; bottom: 16px; background: #fff; border-radius: 24px; padding: 20px; }
.sheet { z-index: 5; text-align: center; animation: up .25s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet .kw { font-family: var(--fun); font-size: 2.4rem; color: var(--c); }
.sheet .kw-line { font-size: 1.2rem; font-weight: 700; }

/* 미션 2 */
.qcards { display: grid; gap: 12px; }
.qcard { perspective: 900px; height: 160px; cursor: pointer; }
.qcard-in { position: relative; width: 100%; height: 100%; transition: transform .55s cubic-bezier(.3,1.4,.5,1); transform-style: preserve-3d; }
.qcard.flipped .qcard-in { transform: rotateY(180deg); }
.qface { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 22px; display: flex;
  flex-direction: column; align-items: center; justify-content: center; padding: 16px; text-align: center; }
.qfront { color: #fff; font-family: var(--fun); font-size: 1.6rem;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.12) 0 12px, transparent 12px 24px), var(--qc, var(--m2)); box-shadow: 0 6px 0 rgba(0,0,0,.12); }
.qfront small { font-family: inherit; font-size: 1rem; opacity: .9; }
.qback { background: #fff; border: 4px solid var(--qc, var(--m2)); transform: rotateY(180deg); font-size: 1.18rem; font-weight: 700; }
.qback small { color: var(--qc, var(--m2)); font-family: var(--fun); font-size: 1rem; margin-bottom: 6px; }
.pose { text-align: center; }
.pose .pose-name { font-family: var(--fun); font-size: 1.7rem; margin: 6px 0; color: var(--m2); }
.dice { font-size: 3rem; line-height: 1; }
.camwrap { position: relative; width: 100%; aspect-ratio: 3 / 4; background: #111; border-radius: 22px; overflow: hidden; }
.camwrap video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camwrap video.mirror { transform: scaleX(-1); }
.camwrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.count { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--fun); font-size: 7rem; color: #fff;
  text-shadow: 0 6px 0 rgba(0,0,0,.25); pointer-events: none; }
.photo { width: 100%; border-radius: 18px; display: block; -webkit-touch-callout: default; user-select: auto; }

/* 미션 3 */
.player { position: relative; width: 100%; aspect-ratio: 9 / 16; max-height: 70vh; background: #1E2A4A; border-radius: 22px; overflow: hidden; margin: 0 auto; }
.player video { width: 100%; height: 100%; object-fit: contain; display: block; }
.player .sound { position: absolute; right: 10px; top: 10px; margin: 0; }
.slide { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; background: #FFF8E8 center / contain no-repeat; }
.slide .cap { background: rgba(30,42,74,.85); color: #fff; font-family: var(--fun); font-size: 1.45rem; padding: 18px; text-align: center; }
.slide .scene { flex: 1; display: flex; align-items: center; justify-content: center; color: #D0DCFF; font-size: 1.05rem; padding: 20px; text-align: center; }
.choices { display: grid; gap: 10px; margin-top: 14px; }
.choice { text-align: left; border: 3px solid var(--line); background: #fff; border-radius: 18px; padding: 14px; font-size: 1.04rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 0 var(--line); color: var(--ink); }
.choice.good { border-color: var(--m4); background: #E6FCF5; box-shadow: 0 4px 0 #96F2D7; }
.choice.good::before { content: "✔ "; color: var(--m4); }
.choice.bad { border-color: var(--red); background: #FFF0F0; box-shadow: 0 4px 0 #FFC9C9; animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.choice .fb { display: block; font-weight: 500; font-size: .93rem; margin-top: 6px; color: var(--muted); }

/* 미션 4 · 응원나무 */
.starters { display: grid; gap: 8px; margin: 10px 0; }
.starter { border: 3px solid var(--line); background: #fff; border-radius: 16px; padding: 12px 14px; text-align: left; font-family: var(--fun); font-size: 1.1rem; cursor: pointer; color: var(--ink); }
.starter.on { border-color: var(--m4); background: #E6FCF5; }
.counter { text-align: right; font-size: .85rem; color: var(--muted); }
.counter.over { color: var(--red); font-weight: 700; }
.leafcard { background: #E6FCF5; border: 4px solid var(--m4); border-radius: 44px 8px 44px 8px; padding: 18px; font-family: var(--fun); font-size: 1.3rem; text-align: center; margin: 10px 0; }
.tree svg { width: 100%; height: auto; display: block; }
.tree .leaf { cursor: pointer; }
.picked { min-height: 64px; }
.msglist { list-style: none; padding: 0; margin: 0; }
.msglist li { background: #F6F9FF; border-radius: 14px; padding: 10px 14px; margin-bottom: 8px; }
.msglist li.mine { background: #FFF9DB; border: 3px solid var(--yellow); }

.hidden { display: none !important; }
