/* ──────────────────────────────────────────────────────────────────────────
   컬러 헌터스 v2 해시 앱. 구 정적 경로와 스타일을 보존하기 위해 xp- 접두어로 격리한다.
   ────────────────────────────────────────────────────────────────────────── */
body[data-page="experience"] {
  background:
    radial-gradient(circle at 8% 6%, var(--hunt-red-soft), transparent 25%),
    radial-gradient(circle at 92% 28%, var(--hunt-blue-soft), transparent 24%),
    var(--bg);
}
.xp-host { min-height: 100dvh; }
.xp-loading { min-height: 100dvh; display: grid; place-items: center; }
.xp-loading__mark { width: 52px; height: 52px; border: 5px solid var(--line); border-top-color: var(--hunt-purple); border-radius: 50%; animation: xp-spin .8s linear infinite; }
.xp-eyebrow { color: var(--accent); font-size: .74rem; font-weight: 950; letter-spacing: .11em; text-transform: uppercase; }
.xp-text-button { min-height: var(--touch); border: 0; padding: 6px 8px; background: transparent; color: var(--accent); font-weight: 900; cursor: pointer; }
.xp-field-error { min-height: 1.3em; color: var(--danger); font-size: .82rem; font-weight: 750; line-height: 1.45; text-align: center; }

.xp-intro { position: relative; min-height: 100dvh; overflow: hidden; background: #fff; }
.xp-intro [data-media-slot] { height: 100dvh; display: grid; place-items: center; }
.xp-intro-art { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.xp-skip { position: fixed; z-index: 5; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); min-width: 64px; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 14px; background: var(--surface-translucent); color: var(--text); font-size: .76rem; font-weight: 950; letter-spacing: .12em; backdrop-filter: blur(12px); cursor: pointer; }
.xp-entry { min-height: 100dvh; display: grid; align-content: center; gap: 14px; padding: calc(40px + env(safe-area-inset-top)) 22px calc(32px + env(safe-area-inset-bottom)); }
.xp-entry__brand { display: grid; justify-items: center; gap: 9px; margin-bottom: 16px; text-align: center; }
.xp-entry__brand > p:first-of-type { color: var(--muted); font-size: .78rem; font-weight: 900; letter-spacing: .12em; }
.xp-entry__brand h1 { font-size: clamp(2rem, 10vw, 3rem); line-height: 1.05; letter-spacing: -.05em; }
.xp-entry__brand > p:last-child { max-width: 20rem; color: var(--muted); line-height: 1.7; }
.xp-entry__energy { width: 64px; height: 64px; border: 7px solid var(--surface); border-radius: 22px; background: var(--energy-spectrum); box-shadow: 0 0 0 1px var(--line), 0 18px 44px var(--hunt-purple-soft); transform: rotate(8deg); }
.xp-entry__form { display: grid; gap: 10px; }
.xp-code-input { width: 100%; min-height: 72px; border: 2px solid var(--line-strong); border-radius: 20px; padding: 12px 16px; background: var(--surface); color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(1.75rem, 8vw, 2.2rem); font-weight: 950; letter-spacing: .18em; text-align: center; text-transform: uppercase; box-shadow: var(--shadow); }
.xp-code-input::placeholder { color: var(--dim); opacity: .45; }
.xp-entry__primary { min-height: 56px; }
.xp-master { min-height: 44px; margin-top: 15px; border: 0; background: transparent; color: var(--dim); font-size: .72rem; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

.xp-sheet-overlay { position: fixed; inset: 0; z-index: 110; max-width: 480px; margin: 0 auto; display: grid; align-items: end; padding-top: env(safe-area-inset-top); background: var(--overlay); }
.xp-sheet { max-height: calc(100dvh - 28px); overflow-y: auto; border-radius: 28px 28px 0 0; padding: 20px 18px calc(22px + env(safe-area-inset-bottom)); background: var(--surface); box-shadow: 0 -18px 50px rgba(24, 26, 34, .2); animation: xp-sheet-up .25s ease both; }
.xp-sheet__head { display: grid; grid-template-columns: 1fr 44px; align-items: center; gap: 10px; margin-bottom: 16px; }
.xp-sheet__head h2 { font-size: 1.25rem; }
.xp-sheet__actions { display: grid; gap: 10px; }
.xp-photo-camera { display: grid; gap: 12px; margin-bottom: 12px; }
.xp-photo-camera video { display: block; width: 100%; height: min(45dvh, 360px); object-fit: contain; border-radius: 16px; background: #111; }
.xp-photo-camera p { color: var(--muted); line-height: 1.5; }
.xp-arrival-sheet { display: grid; justify-items: center; gap: 13px; padding-top: 28px; text-align: center; }
.xp-arrival-sheet__pin { width: 68px; height: 68px; display: grid; place-items: center; border: 2px solid var(--spot-ink); border-radius: 24px; background: var(--spot-soft); color: var(--spot-ink); font-size: 2rem; font-weight: 1000; }
.xp-arrival-sheet h2 { max-width: 20rem; font-size: clamp(1.65rem, 8vw, 2.2rem); line-height: 1.2; letter-spacing: -.04em; }
.xp-arrival-sheet > p:not(.xp-eyebrow) { max-width: 22rem; color: var(--muted); line-height: 1.65; }
.xp-arrival-sheet .xp-sheet__actions { width: 100%; margin-top: 5px; }
.xp-qr-view { position: relative; min-height: 300px; display: grid; place-items: center; overflow: hidden; border-radius: 20px; background: var(--text); }
.xp-qr-view video { width: 100%; height: 100%; min-height: 300px; object-fit: cover; }
.xp-qr-reticle { position: absolute; width: min(64vw, 230px); aspect-ratio: 1; border: 3px solid var(--surface); border-radius: 22px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .28); }
.xp-sheet--camera > p { margin: 14px 0; line-height: 1.6; text-align: center; }

.xp-tutorial { min-height: 100dvh; display: grid; grid-template-rows: auto auto 1fr auto; gap: 18px; padding: calc(18px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); }
.xp-tutorial__top { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.xp-tutorial__top p { font-size: .8rem; font-weight: 900; }
.xp-stepper { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 7px; }
.xp-stepper span { height: 6px; border-radius: 999px; background: var(--line); }
.xp-stepper span.is-active { background: var(--accent-strong); }
.xp-tutorial__card { display: grid; align-content: center; justify-items: center; gap: 18px; padding: 26px 14px; text-align: center; }
.xp-tutorial__icon { width: 92px; height: 92px; display: grid; place-items: center; border-radius: 30px; background: var(--energy-spectrum); color: var(--surface); font-size: 2.8rem; box-shadow: var(--shadow); }
.xp-tutorial__card h1, .xp-tutorial__card p { white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; }
.xp-tutorial__card h1 { max-width: 20rem; font-size: clamp(2rem, 10vw, 2.8rem); line-height: 1.08; letter-spacing: -.055em; }
.xp-tutorial__card h1.xp-tutorial__title--multiline { font-size: clamp(1.15rem, 5.4vw, 1.5rem); line-height: 1.4; }
.xp-tutorial__card p { max-width: 21rem; color: var(--muted); line-height: 1.75; }
.xp-tutorial__actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }

.xp-shell { min-height: 100dvh; padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
.xp-progress-header { position: sticky; z-index: 45; top: 0; min-height: calc(94px + env(safe-area-inset-top)); display: grid; align-content: end; gap: 9px; padding: calc(10px + env(safe-area-inset-top)) 16px 11px; border-bottom: 1px solid var(--line); background: var(--surface-translucent); backdrop-filter: blur(18px); }
.xp-progress-header__brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.xp-progress-header__brand span { font-size: .68rem; font-weight: 950; letter-spacing: .12em; text-transform: uppercase; }
.xp-progress-header__brand strong { font-size: .78rem; }
.xp-color-slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; list-style: none; }
.xp-color-slot { min-width: 0; display: grid; place-items: center; }
.xp-color-slot > img { display: block; width: 44px; height: 44px; object-fit: contain; filter: grayscale(1); opacity: .55; transition: filter .5s ease, opacity .5s ease; }
.xp-color-slot.is-filled > img { filter: grayscale(0); opacity: 1; }
.xp-color-slot.is-popping > img { animation: xp-slot-pop .62s cubic-bezier(.16,.9,.3,1.4); }
.xp-main { padding: 24px 16px 34px; }
.xp-tab-heading { display: grid; gap: 8px; margin-bottom: 20px; }
.xp-tab-heading h1 { font-size: clamp(2rem, 10vw, 2.75rem); letter-spacing: -.055em; }
.xp-tab-heading > p:last-child:not(.xp-game-total) { color: var(--muted); line-height: 1.65; }
.xp-bottom-nav { position: fixed; z-index: 50; inset: auto 0 0; width: 100%; max-width: 480px; min-height: calc(70px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 auto; padding: 6px 7px env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: var(--surface-translucent); backdrop-filter: blur(18px); }
.xp-bottom-nav a { position: relative; min-width: 0; min-height: 56px; display: grid; place-items: center; align-content: center; gap: 2px; border-radius: 14px; color: var(--dim); font-size: .65rem; font-weight: 900; text-decoration: none; }
.xp-bottom-nav a > span:first-child { font-size: 1.25rem; line-height: 1; }
.xp-bottom-nav a.is-active { background: var(--accent-soft); color: var(--text); }
.xp-nav-dot { position: absolute; top: 7px; right: calc(50% - 20px); width: 8px; height: 8px; border: 2px solid var(--surface); border-radius: 50%; background: var(--danger); }

.xp-mission-list { display: grid; gap: 15px; }
.xp-mission-card { position: relative; min-height: 230px; display: grid; grid-template-columns: 80px minmax(0, 1fr); align-content: end; gap: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; padding: 18px; background: radial-gradient(circle at 100% 0, var(--spot-soft), transparent 45%), var(--surface); box-shadow: var(--shadow); animation: xp-card-in .4s calc(var(--card-index) * 55ms) ease both; }
.xp-mission-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--spot-color); }

.xp-mission-card.is-ready { border-color: var(--spot-ink); }
.xp-mission-card.is-cleared { border-color: var(--spot-ink); background: linear-gradient(145deg, var(--surface), var(--spot-soft)); }
.xp-mission-card__art { width: 72px; height: 72px; display: grid; place-items: center; align-self: end; border: 2px solid var(--spot-ink); border-radius: 22px; background: var(--spot-soft); color: var(--spot-ink); font-size: 1.8rem; }
.xp-mission-card__copy { min-width: 0; align-self: end; }
.xp-mission-card__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; margin-bottom: 7px; color: var(--spot-ink); font-size: .68rem; font-weight: 950; }
.xp-mission-card h2 { overflow-wrap: anywhere; font-size: 1.3rem; line-height: 1.18; letter-spacing: -.035em; }
.xp-mission-card__copy p { margin-top: 5px; overflow-wrap: anywhere; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.xp-mission-card > .btn, .xp-mission-card > .xp-mission-card__guide, .xp-mission-card > .xp-clear-stamp { grid-column: 1 / -1; }
.xp-mission-card__guide { color: var(--dim); font-size: .72rem; text-align: center; }
.xp-clear-stamp { justify-self: end; border: 3px double var(--spot-ink); border-radius: 8px; padding: 7px 12px; color: var(--spot-ink); font-size: 1.15rem; font-weight: 1000; letter-spacing: .04em; transform: rotate(-7deg); animation: xp-stamp .48s ease both; }

.xp-mission-page { min-height: 100dvh; padding-bottom: calc(90px + env(safe-area-inset-bottom)); background: radial-gradient(circle at 100% 8%, var(--spot-soft), transparent 25%), var(--bg); }
/* 퍼즐 화면의 래퍼도 투명하게 하되, 미니게임·완료 화면은 기존 배경을 유지한다. */
.xp-mission-page:has(#missionPuzzle) { background: transparent; }
.xp-mission-top { position: sticky; z-index: 30; top: 0; min-height: calc(60px + env(safe-area-inset-top)); display: grid; grid-template-columns: 48px 1fr 48px; align-items: end; padding: env(safe-area-inset-top) 8px 0; border-bottom: 1px solid var(--line); background: var(--surface-translucent); backdrop-filter: blur(16px); }
.xp-mission-top > span { align-self: center; overflow: hidden; font-size: .85rem; font-weight: 900; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.xp-mission-content { display: grid; gap: 18px; padding: 20px 16px; }
.xp-stage-card { display: grid; gap: 14px; border: 1px solid var(--line); border-radius: 24px; padding: 20px 17px; background: var(--surface); box-shadow: var(--shadow); }
.xp-stage-card h1 { font-size: clamp(1.8rem, 8vw, 2.35rem); line-height: 1.12; letter-spacing: -.045em; }
.xp-stage-card h2 { font-size: clamp(1.4rem, 7vw, 1.85rem); letter-spacing: -.035em; }
.xp-stage-lead { color: var(--spot-ink); font-weight: 900; }
.xp-mission-action { position: fixed; z-index: 35; inset: auto 0 0; max-width: 480px; margin: 0 auto; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface-translucent); backdrop-filter: blur(18px); }
.xp-sequence__answer { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.xp-hidden-puzzle .xp-sequence__answer { grid-template-columns: repeat(5, 1fr); }
.xp-sequence__answer span { aspect-ratio: 1; display: grid; place-items: center; border: 2px dashed var(--line-strong); border-radius: 14px; background: var(--surface-soft); color: var(--dim); font-weight: 950; }
.xp-sequence__options { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.xp-option { width: 52px; min-width: 52px; height: 52px; min-height: 52px; border: 2px solid var(--line); border-radius: 50%; background: var(--surface); font-size: 1.35rem; cursor: pointer; }
.xp-option--red { border-color: var(--hunt-red-ink) !important; background: var(--hunt-red) !important; color: var(--surface) !important; }
.xp-option--blue { border-color: var(--hunt-blue-ink) !important; background: var(--hunt-blue) !important; color: var(--surface) !important; }
.xp-option--green { border-color: var(--hunt-green-ink) !important; background: var(--hunt-green) !important; color: var(--surface) !important; }
.xp-option--orange { border-color: var(--hunt-orange-ink) !important; background: var(--hunt-orange) !important; color: var(--surface) !important; }
.xp-option--purple { border-color: var(--hunt-purple-ink) !important; background: var(--hunt-purple) !important; color: var(--surface) !important; }
.xp-unlock-mark { width: 76px; height: 76px; display: grid; place-items: center; justify-self: center; border: 3px solid var(--spot-ink); border-radius: 26px; background: var(--spot-color); color: var(--surface); font-size: 2.3rem; box-shadow: 0 14px 32px var(--spot-soft); }
.xp-minigame { justify-items: center; text-align: center; }
.xp-minigame > p:not(.xp-eyebrow) { max-width: 21rem; color: var(--muted); line-height: 1.65; }
.xp-energy-meter { width: 100%; height: 12px; overflow: hidden; border-radius: 999px; background: var(--line); }
.xp-energy-meter span { height: 100%; display: block; border-radius: inherit; background: var(--spot-color); transition: width .25s ease; }
.xp-energy-count { color: var(--spot-ink); }
.xp-energy-game { width: 100%; min-height: 170px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; border-radius: 22px; padding: 20px 12px; background: radial-gradient(circle, var(--spot-soft), var(--surface-soft)); }
.xp-energy-orb { width: 58px; min-width: 58px; height: 58px; min-height: 58px; border: 2px dashed var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--dim); font-size: 1.5rem; cursor: default; opacity: .62; }
.xp-energy-orb.is-next { border-style: solid; border-color: var(--spot-ink); background: var(--spot-color); color: var(--surface); cursor: pointer; opacity: 1; box-shadow: 0 0 0 8px var(--spot-soft); }
.xp-energy-orb.is-collected { border-style: solid; border-color: var(--spot-ink); background: var(--spot-soft); color: var(--spot-ink); opacity: 1; }
.xp-mission-complete { position: relative; isolation: isolate; overflow: hidden; min-height: calc(100dvh - 200px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); align-content: center; justify-items: center; gap: 36px; text-align: center; border-color: var(--spot-soft); background: radial-gradient(circle at 50% 40%, var(--spot-soft), var(--surface) 70%); }
.xp-mission-complete h1 { position: relative; max-width: 100%; font-size: clamp(1.9rem, 8vw, 2.9rem); line-height: 1.22; word-break: keep-all; overflow-wrap: anywhere; color: var(--spot-ink); }
.xp-energy-discovery { position: relative; display: grid; place-items: center; width: min(100%, 300px); min-height: 260px; }
.xp-energy-discovery::before { content: ""; position: absolute; inset: 0; background: repeating-conic-gradient(from 15deg, transparent 0deg 20deg, var(--spot-soft) 20deg 30deg); mask-image: radial-gradient(circle, #000 20%, transparent 70%); animation: xp-discovery-rays 2.4s steps(6, end) infinite alternate; }
.xp-energy-discovery::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .15; background: repeating-linear-gradient(transparent 0 7px, var(--spot-color) 7px 8px); mask-image: radial-gradient(circle, #000, transparent 70%); }
.xp-earned-energy { position: relative; z-index: 1; display: block; width: min(46vw, 180px); height: auto; object-fit: contain; image-rendering: pixelated; border: 0; border-radius: 0; background: none; box-shadow: none; animation: xp-dot-discovery .72s steps(6, end) both; }
.xp-energy-sparks { position: absolute; inset: 0; }
.xp-energy-sparks i { position: absolute; top: 50%; left: 50%; width: 8px; height: 8px; background: var(--spot-color); box-shadow: 4px 4px 0 var(--spot-soft); opacity: 0; animation: xp-discovery-spark 1.5s steps(6, end) both; animation-delay: calc(var(--i) * 35ms); }
@keyframes xp-dot-discovery { 0% { opacity: 0; transform: translateY(24px) scale(.2); } 65% { opacity: 1; transform: translateY(-8px) scale(1.12); } 100% { opacity: 1; transform: none; } }
@keyframes xp-discovery-spark { 0% { opacity: 0; transform: rotate(calc(var(--i) * 30deg)) translateY(-45px) scale(.5); } 25% { opacity: 1; } 100% { opacity: 0; transform: rotate(calc(var(--i) * 30deg)) translateY(-125px) scale(1); } }
@keyframes xp-discovery-rays { from { opacity: .35; transform: scale(.8) rotate(0deg); } to { opacity: .9; transform: scale(1.1) rotate(15deg); } }
.xp-already-clear { min-height: 150px; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--spot-ink); }
.xp-already-clear span { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: var(--spot-color); color: var(--surface); font-size: 2rem; }
.xp-success-burst { position: fixed; inset: 0; z-index: 130; max-width: 480px; margin: 0 auto; display: grid; place-items: center; overflow: hidden; background: var(--spot-soft); opacity: 0; transition: opacity .15s ease; }
.xp-success-burst.is-active { opacity: 1; }
.xp-success-burst > strong { z-index: 2; max-width: 80%; color: var(--spot-ink); font-size: 1.65rem; line-height: 1.3; text-align: center; }
.xp-success-burst__particles i { position: absolute; top: 50%; left: 50%; width: 14px; height: 14px; border-radius: 5px; background: var(--spot-color); animation: xp-particle 1.15s ease-out both; animation-delay: calc(var(--i) * 12ms); transform: rotate(calc(var(--i) * 23deg)) translateY(-18px); }

.xp-photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.xp-photo-card { min-width: 0; overflow: hidden; border: 2px solid var(--spot-color); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.xp-photo-card button { position: relative; width: 100%; aspect-ratio: 4 / 5; display: block; overflow: hidden; border: 0; padding: 0; background: var(--spot-soft); cursor: pointer; }
.xp-photo-card img { width: 100%; height: 100%; display: block; object-fit: cover; }
.xp-photo-card__plus { position: absolute; inset: 0; display: grid; place-items: center; color: var(--spot-ink); font-size: 2.5rem; }
.xp-photo-card__overlay { position: absolute; inset: auto 0 0; display: grid; gap: 2px; padding: 28px 10px 10px; background: linear-gradient(transparent, rgba(24, 26, 34, .74)); color: var(--surface); text-align: left; }
.xp-photo-card__overlay small { overflow: hidden; font-size: .65rem; line-height: 1.35; text-overflow: ellipsis; }
.xp-full-popup { position: fixed; inset: 0; z-index: 140; max-width: 480px; margin: 0 auto; display: grid; place-items: center; padding: 24px; background: var(--surface); opacity: 0; transform: scale(.96); transition: opacity .2s ease, transform .25s ease; }
.xp-full-popup.is-visible { opacity: 1; transform: none; }
.xp-full-popup > section { position: relative; z-index: 2; display: grid; justify-items: center; gap: 16px; text-align: center; }
.xp-full-popup h2 { font-size: clamp(2rem, 10vw, 3rem); line-height: 1.05; letter-spacing: -.055em; }
.xp-full-popup p { color: var(--muted); line-height: 1.7; }
.xp-full-popup__icon { width: 94px; height: 94px; display: grid; place-items: center; border-radius: 32px; background: var(--energy-spectrum); color: var(--surface); font-size: 3rem; box-shadow: var(--shadow); }
.xp-popup-particles i { position: fixed; top: 48%; left: 50%; width: 16px; height: 16px; border-radius: 50%; background: var(--particle); animation: xp-popup-particle 1.1s calc(var(--i) * 80ms) ease-out infinite alternate; }

.xp-hidden { position: relative; min-height: calc(100dvh - 220px); display: grid; place-items: center; align-content: center; gap: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 28px; padding: 28px 18px; background: linear-gradient(145deg, var(--surface), var(--accent-soft)); text-align: center; }
.xp-hidden__copy { z-index: 2; display: grid; justify-items: center; gap: 10px; }
.xp-hidden__copy h1, .xp-hidden--solved h1 { font-size: clamp(2rem, 11vw, 3rem); letter-spacing: -.055em; }
.xp-hidden__copy > p:last-child { color: var(--muted); font-weight: 850; }
.xp-hidden__lock { font-size: 4.2rem; filter: drop-shadow(0 14px 20px var(--accent-soft)); }
.xp-hidden--opening { min-height: calc(100dvh - 220px); }
.xp-hidden__gem { width: 96px; height: 96px; display: grid; place-items: center; border-radius: 34px; background: var(--energy-spectrum); color: var(--surface); font-size: 3.2rem; }
.xp-hidden-puzzle { display: grid; gap: 18px; border: 1px solid var(--line); border-radius: 24px; padding: 18px; background: var(--surface); box-shadow: var(--shadow); }

.xp-settings-card { display: grid; gap: 12px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 20px; padding: 17px; background: var(--surface); box-shadow: var(--shadow); }
.xp-settings-card > h2 { font-size: 1rem; }
.xp-settings-card > p, .xp-faq details p { color: var(--muted); font-size: .82rem; line-height: 1.6; }
.xp-setting-row { min-height: 72px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.xp-setting-row:last-child { border-bottom: 0; }
.xp-setting-row label { font-weight: 900; }
.xp-setting-row p { margin-top: 4px; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.xp-language { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; border-radius: 15px; padding: 4px; background: var(--surface-soft); }
.xp-language button { border: 0; border-radius: 12px; background: transparent; font-weight: 850; cursor: pointer; }
.xp-language button.is-active { background: var(--surface); box-shadow: 0 3px 10px var(--line); }
.xp-faq details { border-top: 1px solid var(--line); }
.xp-faq summary { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 850; cursor: pointer; }
.xp-faq details p { padding: 0 4px 14px; }
.xp-settings-card--danger { border-color: var(--danger); background: var(--danger-soft); }

.xp-finish { position: relative; min-height: 100dvh; display: grid; place-items: center; overflow: hidden; padding: calc(30px + env(safe-area-inset-top)) 22px calc(30px + env(safe-area-inset-bottom)); background: var(--surface); }
.xp-finish__content { position: relative; z-index: 2; display: grid; justify-items: center; gap: 15px; text-align: center; }
.xp-finish__badge { border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 12px; font-size: .66rem; font-weight: 1000; letter-spacing: .13em; }
.xp-finish__mark { width: 110px; height: 110px; display: grid; place-items: center; border: 8px solid var(--surface); border-radius: 38px; background: var(--energy-spectrum); color: var(--surface); font-size: 3.5rem; box-shadow: 0 0 0 1px var(--line), 0 22px 50px var(--hunt-purple-soft); animation: xp-finish-mark .8s cubic-bezier(.2,.9,.2,1.3) both; }
.xp-finish h1 { font-size: clamp(2.4rem, 13vw, 4rem); line-height: .98; letter-spacing: -.065em; }
.xp-finish p { max-width: 20rem; color: var(--muted); line-height: 1.7; }
.xp-finish__slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.xp-finish__slots span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--spot-color); color: var(--surface); font-weight: 1000; }
.xp-finish__aurora i { position: absolute; width: 52vw; max-width: 250px; aspect-ratio: 1; border-radius: 50%; background: var(--finish-color); opacity: .1; filter: blur(20px); animation: xp-aurora 5s calc(var(--i) * -.8s) ease-in-out infinite alternate; }
.xp-not-found { min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 18px; padding: 24px; text-align: center; }
.xp-toast { position: fixed; z-index: 180; right: 16px; bottom: calc(90px + env(safe-area-inset-bottom)); left: 16px; max-width: 448px; min-height: 48px; display: grid; place-items: center; margin: 0 auto; border-radius: 15px; padding: 10px 14px; background: var(--text); color: var(--surface); box-shadow: var(--shadow); font-size: .82rem; font-weight: 800; line-height: 1.45; text-align: center; opacity: 0; transform: translateY(16px); transition: opacity .2s ease, transform .2s ease; }
.xp-toast.is-visible { opacity: 1; transform: none; }

.is-shaking { animation: xp-shake .42s ease; }
@keyframes xp-spin { to { transform: rotate(360deg); } }
@keyframes xp-sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes xp-slot-pop { 50% { transform: scale(1.35) rotate(9deg); } }
@keyframes xp-card-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes xp-stamp { from { opacity: 0; transform: scale(1.6) rotate(-16deg); } to { opacity: 1; transform: rotate(-7deg); } }
@keyframes xp-shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes xp-particle { to { opacity: 0; transform: rotate(calc(var(--i) * 23deg)) translateY(-54vh) scale(.3); } }
@keyframes xp-popup-particle { from { opacity: .2; transform: rotate(calc(var(--i) * 72deg)) translateY(60px) scale(.7); } to { opacity: .7; transform: rotate(calc(var(--i) * 72deg)) translateY(160px) scale(1.2); } }
@keyframes xp-finish-mark { from { opacity: 0; transform: scale(.35) rotate(-18deg); } to { opacity: 1; transform: none; } }
@keyframes xp-aurora { from { transform: translate(calc(var(--i) * 20px - 50px), calc(var(--i) * 80px - 170px)) scale(.8); } to { transform: translate(calc(var(--i) * -18px + 40px), calc(var(--i) * 55px - 40px)) scale(1.2); } }

@media (max-width: 359px) {
  .xp-photo-grid { grid-template-columns: 1fr; }
  .xp-color-slots { gap: 5px; }
  .xp-color-slot > img { width: 38px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .xp-earned-energy, .xp-energy-sparks i, .xp-energy-discovery::before { animation: none; }
  .xp-earned-energy { opacity: 1; transform: none; }
  .xp-energy-sparks { display: none; }
  .xp-success-burst__particles, .xp-popup-particles, .xp-finish__aurora { display: none; }
}

.xp-mission-card__actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.xp-mission-card { min-height: 180px; align-content: center; grid-template-columns: 64px minmax(0, 1fr); }
.xp-mission-card__art { width: 64px; height: 56px; min-width: 0; align-self: center; overflow: visible; border: 0; border-radius: 0; background: transparent; }
.xp-mission-card__art img { display: block; width: auto; height: 44px; max-width: none; object-fit: contain; }
.xp-mission-card__copy { align-self: center; }
.xp-progress-header__brand { justify-content: flex-end; }

/* 다섯 사진을 물감처럼 담는 팔레트. 배경은 화면 크기에 맞춰 함께 늘어난다. */
.xp-palette { position: relative; display: block; width: 100%; aspect-ratio: 400 / 430; margin: 6px 0 26px; isolation: isolate; }
.xp-palette__board { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: #f4be83; stroke: #e3a66c; stroke-width: 2; filter: drop-shadow(0 7px 0 #c88e59); }
.xp-palette .xp-photo-card { position: absolute; width: 27%; aspect-ratio: 1; border: 3px solid var(--spot-color); border-radius: 50%; box-shadow: 0 4px 0 color-mix(in srgb, var(--spot-color) 70%, #333); transform: translate(-50%, -50%); }
.xp-palette .xp-photo-card:nth-of-type(1) { left: 38%; top: 20%; }
.xp-palette .xp-photo-card:nth-of-type(2) { left: 19%; top: 47%; }
.xp-palette .xp-photo-card:nth-of-type(3) { left: 30%; top: 75%; }
.xp-palette .xp-photo-card:nth-of-type(4) { left: 61%; top: 82%; }
.xp-palette .xp-photo-card:nth-of-type(5) { left: 83%; top: 59%; }
.xp-palette .xp-photo-card button { height: 100%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 20%, var(--surface), var(--spot-soft) 68%); }
.xp-palette .xp-photo-card__plus { inset: 0 0 30%; font-size: clamp(1.7rem, 7vw, 2.3rem); }
.xp-palette .xp-photo-card__overlay { padding: 4px 4px 13%; background: none; color: var(--spot-ink); text-align: center; font-size: .78rem; }
.xp-palette .xp-photo-card__overlay small { display: none; }
.xp-palette .xp-photo-card.is-filled .xp-photo-card__overlay { padding-top: 20px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); }
.xp-palette .xp-photo-card:focus-within { outline: 3px solid var(--text); outline-offset: 4px; }
/* 업로드 전 큰 화면 확인과 정오각형 전체 이미지 보기. */
.xp-photo-review,
.xp-hunt-collage { position: fixed; inset: 0; z-index: 150; max-width: 480px; margin: 0 auto; display: grid; place-items: center; padding: 20px; background: var(--surface); }
.xp-photo-review > section,
.xp-hunt-collage > section { display: grid; gap: 14px; width: 100%; justify-items: center; text-align: center; }
.xp-photo-review h2,
.xp-hunt-collage h2 { font-size: clamp(1.2rem, 5vw, 1.5rem); letter-spacing: -.03em; }
.xp-photo-review p { color: var(--muted); font-size: .9rem; }
.xp-photo-review__stage,
.xp-hunt-collage__stage { width: 100%; display: grid; place-items: center; min-height: 48vh; padding: 10px; border-radius: 20px; background: var(--spot-soft, var(--surface-2, transparent)); }
/* 작은 원본도 화면 폭까지 키워서 크게 확인할 수 있게 한다. */
.xp-photo-review__stage img { width: 100%; max-height: 62vh; border-radius: 14px; object-fit: contain; }
.xp-hunt-collage__stage { background: repeating-conic-gradient(rgba(0, 0, 0, .06) 0% 25%, transparent 0% 50%) 50% / 22px 22px; }
.xp-hunt-collage__stage img { width: min(100%, 62vh); aspect-ratio: 1; object-fit: contain; }
.xp-photo-review__actions { display: grid; gap: 10px; width: 100%; }
.xp-hunt-collage .xp-sheet__head { width: 100%; }

.xp-mission-action--pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#missionAnswerForm { display: grid; gap: 16px; }

/* 미션·힌트·정답 원본 전체가 보이는 공통 4:5 이미지 영역. */
.xp-puzzle-image { width: min(100%, calc((100dvh - 190px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * .8)); aspect-ratio: 4 / 5; margin-inline: auto; background: transparent; }
.xp-sheet--image { padding-inline: 16px; }
/* PC 본문 양쪽의 1px 테두리까지 맞춰 미션과 힌트의 이미지 폭을 일치시킨다. */
@media (min-width: 481px) { .xp-sheet--image { padding-inline: 17px; } }
.xp-solution-images { display: flex; flex-direction: column; gap: 16px; }
.xp-solution-images .xp-puzzle-image { flex: none; }
.xp-puzzle-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.xp-hidden-image-page { display: grid; gap: 18px; }
.xp-hidden-image-page .xp-puzzle-image { width: min(100%, calc((100dvh - 290px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * .8)); }

.xp-mission-action--pair:has(#revealMissionAnswer) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.xp-mission-action--pair .btn { min-width: 0; padding-inline: 6px; }
.xp-revealed-content { white-space: pre-line; overflow-wrap: anywhere; }

.xp-location-name { font-weight: 800; }
.xp-location-address { min-height: 96px; }

/* 퍼즐 발현과 게임 수집 결과를 구분합니다. */
.xp-energy-revealed { gap: 18px; }
.xp-energy-revealed__guide { max-width: 28rem; font-size: clamp(.75rem, 3.3vw, .875rem); line-height: 1.65; word-break: keep-all; overflow-wrap: anywhere; }
.xp-energy-revealed .xp-energy-discovery { min-height: 210px; }
.xp-energy-revealed .xp-earned-energy { opacity: .85; }
.xp-game-notice { padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; font-size: .85rem; background: var(--surface-soft); }
.xp-game-score, .xp-game-total { font-weight: 700; font-variant-numeric: tabular-nums; }
.xp-tab-heading .xp-game-total { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: .25em; margin-top: 16px; padding: 12px 18px; border: 2px solid #7841ae; border-radius: 18px; background: #f3e9ff; color: #4c2277; font-size: .95rem; font-weight: 800; }
.xp-game-total strong { font-size: 2rem; line-height: 1.2; font-weight: 950; }
.xp-game-total.is-increasing { animation: xp-score-increase .65s ease-out; }
@keyframes xp-score-increase { 40% { transform: scale(1.025); background: #e3ccff; box-shadow: 0 0 0 5px rgb(120 65 174 / 15%); } }
@media (prefers-reduced-motion: reduce) { .xp-game-total.is-increasing { animation: none; } }

.xp-minigame h1, .xp-minigame p { word-break: keep-all; overflow-wrap: anywhere; }

/* 컬러 어드벤처: 미니게임 공통 화면과 파랑 파이프 */
.xp-game-intro, .xp-game-outro { min-height: min(620px, calc(100dvh - 200px)); align-content: center; gap: 24px; padding: 24px 20px 32px; background: radial-gradient(circle at 50% 35%, var(--spot-soft), var(--surface) 65%); }
.xp-game-emblem { display: grid; place-items: center; width: 100px; height: 100px; margin: 0 auto; border: 3px solid var(--spot-ink); border-radius: 22px; color: var(--spot-ink); background: var(--spot-soft); font-size: 3.7rem; font-weight: 900; box-shadow: 6px 6px 0 var(--spot-color); }
.xp-game-tip { width: 100%; padding: 16px; border: 1px solid var(--spot-color); border-radius: 14px; background: var(--surface); color: var(--spot-ink); font-size: .9rem; line-height: 1.65; word-break: keep-all; }
.xp-result-score { width: 100%; display: grid; gap: 6px; padding: 24px; border: 2px solid var(--spot-color); border-radius: 18px; background: var(--surface); color: var(--spot-ink); box-shadow: 4px 4px 0 var(--spot-soft); }
.xp-result-score > span { font-size: .85rem; font-weight: 800; }
.xp-result-score > strong { font-size: 3.8rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.xp-result-time strong { color: var(--spot-ink); font-variant-numeric: tabular-nums; }
.xp-pipe-game { gap: 12px; padding: 16px 12px; border: 2px solid var(--spot-ink); border-radius: 20px; box-shadow: 5px 5px 0 var(--spot-soft); }
.xp-pipe-game h1 { font-size: clamp(1.35rem, 6vw, 1.8rem); }
.xp-pipe-stats { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border-radius: 10px; background: var(--spot-soft); color: var(--spot-ink); font-size: .75rem; }
.xp-pipe-stats strong { margin-left: 6px; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.xp-pipe-game > .xp-pipe-help { font-size: .8rem; }
.xp-pipe-board-wrap { width: 100%; max-width: 380px; padding: 0 4px; }
.xp-pipe-terminal { display: flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 900; color: var(--spot-ink); min-height: 27px; }
.xp-pipe-in { justify-content: flex-start; }
.xp-pipe-out { justify-content: flex-end; }
.xp-pipe-grid { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; padding: 5px; border: 2px solid var(--spot-ink); border-radius: 10px; background: var(--spot-ink); box-shadow: 3px 3px 0 var(--spot-color); }
.xp-pipe-grid::before, .xp-pipe-grid::after { content: ""; position: absolute; z-index: 2; pointer-events: none; width: 9px; height: 12px; border-block: 3px solid var(--spot-ink); background: #44dafa; }
.xp-pipe-grid::before { left: -7px; top: calc(10% - 5px); }
.xp-pipe-grid::after { right: -7px; bottom: calc(10% - 5px); background: var(--surface); }
.xp-pipe-tile { display: block; position: relative; min-width: 0; min-height: 0; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 4px; background: #edf2ff; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.xp-pipe-tile:focus-visible { outline: 3px solid #ffb829; outline-offset: -3px; z-index: 3; }
.xp-pipe-tile:active { background: #d2e7ff; }
.xp-pipe-tile svg { width: 100%; height: 100%; display: block; overflow: hidden; transition: transform .18s ease-out; }
.xp-pipe-tile path { fill: none; stroke-linecap: square; stroke-linejoin: round; }
.xp-pipe-edge { stroke: #152e71; stroke-width: 40; }
.xp-pipe-body { stroke: #adbfdc; stroke-width: 29; }
.xp-pipe-water { stroke: #dbe5f4; stroke-width: 13; transition: stroke .2s; }
.xp-pipe-joint { fill: #dbe5f4; }
.xp-pipe-tile.is-wet { background: #d3eeff; }
.xp-pipe-tile.is-wet .xp-pipe-body { stroke: #258fff; }
.xp-pipe-tile.is-wet .xp-pipe-water { stroke: #7aeeff; }
.xp-pipe-tile.is-wet .xp-pipe-joint { fill: #7aeeff; }
.xp-pipe-game > .xp-pipe-status { min-height: 2.5em; font-size: .75rem; color: var(--spot-ink); }
@media (max-width: 350px) {
  .xp-mission-content:has(.xp-pipe-game) { padding: 14px 10px; }
  .xp-pipe-game { padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .xp-pipe-tile svg, .xp-pipe-water { transition: none; }
}
.xp-minigame h1[tabindex="-1"]:focus { outline: none; }

.xp-game-complete-dialog { width: min(360px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto; margin: auto; padding: 28px 22px; border: 2px solid var(--spot-color); border-radius: 24px; background: var(--surface); color: var(--text); text-align: center; box-shadow: var(--shadow); }
.xp-game-complete-dialog::backdrop { background: rgba(15, 20, 30, .58); }
.xp-game-complete-dialog .xp-game-emblem { margin: 0 auto 18px; }
.xp-game-complete-dialog h2 { font-size: 1.8rem; }
.xp-game-complete-dialog p { margin: 16px 0 24px; line-height: 1.6; }

#collectMinigameEnergy { background: var(--spot-color); color: #101820; box-shadow: 0 10px 24px var(--spot-soft); }

.xp-minigame-placeholder { min-height: min(480px, 55dvh); display: grid; place-items: center; align-content: center; }
.xp-minigame-placeholder h1 { color: var(--muted); font-size: 1rem; font-weight: 500; line-height: 1.7; }

/* 재플레이 결과 안내와 완료 동작 */
.xp-replay-notice { margin-top: 1rem; line-height: 1.6; }
.xp-replay-actions { display: grid; gap: .65rem; }

/* 주황 러너·보라 체감 타이머: 게임 페이지에만 적용합니다. */
.xp-runner, .xp-timing { width: 100%; max-width: 680px; margin-inline: auto; }
.xp-run-stats { display: flex; justify-content: space-between; gap: 8px; margin: 18px 0 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.xp-run-stage { display: block; width: 100%; padding: 0; overflow: hidden; border: 3px solid #482c3c; border-radius: 10px; background: #aedcf2; touch-action: manipulation; }
.xp-run-stage canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.xp-run-stage:disabled { opacity: 1; }
.xp-run-stage:focus-visible, .xp-timing-field:focus-visible { outline: 4px solid #ffb94c; outline-offset: 4px; }
.xp-runner > p { margin: 16px 0; }
.xp-timing { position: relative; overflow: hidden; }
.xp-timing-target { display: block; color: #7a3cf0; font-size: clamp(48px, 12vw, 80px); margin: 16px 0; }
.xp-countdown { display: block; font-size: 56px; color: #7a3cf0; }
.xp-timing[data-timing-phase="running"] { padding: 0; border: 0; background: #180e36; }
.xp-timing-field { display: block; position: relative; width: 100%; min-height: max(320px, calc(100dvh - 112px)); border: 0; padding: 0; overflow: hidden; border-radius: 18px; background: #180e36; cursor: pointer; touch-action: manipulation; }
.xp-nebula { position: absolute; inset: -15%; background: radial-gradient(ellipse at 26% 38%, #7a3cf088, transparent 48%), radial-gradient(ellipse at 74% 70%, #b57eff55, transparent 48%), #180e36; animation: xp-nebula-drift 16s ease-in-out infinite alternate; image-rendering: pixelated; }
.xp-nebula i { position: absolute; width: 4px; height: 4px; background: #ceafff; box-shadow: 9px 13px 0 #7a3cf0; opacity: .7; }
.xp-timing-result { position: relative; margin: 20px 0; padding: 20px; border-radius: 16px; background: #f1eaff; color: #39245c; }
.xp-timing-result dl { position: relative; margin: 0; }
.xp-timing-result dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; }
.xp-timing-result dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.xp-perfect { display: block; margin-bottom: 18px; font-size: 38px; color: #7a3cf0; }
.xp-perfect-particles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.xp-perfect-particles i { position: absolute; top: 42%; left: 50%; width: 6px; height: 6px; background: #b176ff; transform: rotate(calc(var(--i) * 30deg)); animation: xp-perfect-burst 1s ease-out both; }
.xp-timing-result.is-perfect:not(.is-reduced) { animation: xp-perfect-glow .8s ease-out; }
@keyframes xp-nebula-drift { to { transform: translate(5%, -4%); } }
@keyframes xp-perfect-burst { to { transform: rotate(calc(var(--i) * 30deg)) translateY(-130px); opacity: 0; } }
@keyframes xp-perfect-glow { 0% { background: #c5a5ff; } 100% { background: #f1eaff; } }
.is-reduced .xp-nebula, .is-reduced .xp-perfect-particles i { animation: none; }
.is-reduced .xp-perfect-particles { display: none; }
@media (prefers-reduced-motion: reduce) {
  .xp-nebula, .xp-perfect-particles i, .xp-timing-result.is-perfect { animation: none !important; }
  .xp-perfect-particles { display: none; }
}

/* 빨강 칠교: 전체 실루엣 한 겹과 이동 가능한 일곱 조각 */
.xp-tangram h2 { font-size: 1.05rem; margin: 10px 0; }
.xp-tangram-board-wrap { position: relative; width: 100%; max-width: 390px; margin: 0 auto; }
.xp-tangram-result-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; border-radius: 12px; background: rgb(255 246 242 / 45%); }
.xp-tangram-result-popup { width: 100%; max-width: 280px; padding: 20px 16px; border: 1px solid #f2d6cd; border-radius: 16px; background: #fff; box-shadow: 0 8px 28px rgb(104 47 56 / 18%); text-align: center; }
.xp-tangram-result-popup p { margin: 0 0 16px; }
.xp-tangram-result-popup .btn { width: 100%; }
#tangramBoard { display: block; width: 100%; max-width: 390px; margin: 0 auto; background: #fff6f2; border: 2px solid #f2d6cd; border-radius: 12px; touch-action: none; user-select: none; }
.xp-tangram-silhouette { fill: #682f38; opacity: .22; stroke: none; pointer-events: none; }
.xp-tangram-piece { cursor: grab; stroke: #fff; stroke-width: 1; stroke-linejoin: round; }
.xp-tangram-piece:not(.is-locked):focus-visible { stroke: #111; stroke-width: 3; outline: none; }
.xp-tangram-piece.is-locked { cursor: default; stroke: #fff; stroke-width: .5; outline: none; filter: none; }
.xp-tangram-piece.piece-0 { fill: #7018a9; }
.xp-tangram-piece.piece-1 { fill: #c90087; }
.xp-tangram-piece.piece-2 { fill: #ff3767; }
.xp-tangram-piece.piece-3 { fill: #00a9d5; }
.xp-tangram-piece.piece-4 { fill: #ff8845; }
.xp-tangram-piece.piece-5 { fill: #f5b93c; }
.xp-tangram-piece.piece-6 { fill: #76ba55; }
.xp-tangram .xp-game-help { font-size: .8rem; line-height: 1.5; }
.xp-garden-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 480px; width: 100%; margin: 18px auto; }
.xp-garden-plot { position: relative; min-width: 0; min-height: 130px; border: 2px solid #aec8a1; border-radius: 12px; background: #edf5e7; padding: 8px 3px; color: #24421d; touch-action: manipulation; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.xp-garden-plot:focus-visible { outline: 3px solid #263c22; outline-offset: 2px; }
.xp-plant { display: block; font-size: 38px; height: 48px; line-height: 48px; }
.xp-plant-stage { font-size: .8rem; }
.xp-plant-event { font-size: .72rem; line-height: 1.4; }
.xp-garden-plot progress { width: 80%; height: 5px; accent-color: #498343; }
.xp-garden-plot[data-urgency="notice"] { background: #fff0d8; border-color: #c77719; }
.xp-garden-plot[data-urgency="warning"] { background: #ffddb3; border-color: #d85b0b; }
.xp-garden-plot[data-urgency="urgent"] { background: #ffd9d4; border-color: #c62828; }
.xp-garden-plot[data-urgency="notice"] progress { accent-color: #c77719; }
.xp-garden-plot[data-urgency="warning"] progress { accent-color: #d85b0b; }
.xp-garden-plot[data-urgency="urgent"] progress { accent-color: #c62828; }
.xp-garden-plot[data-urgency="urgent"] .xp-plant-event { animation: xp-garden-alert .8s ease-in-out infinite alternate; }
@keyframes xp-garden-alert { from { transform: translateY(0); } to { transform: translateY(-3px); } }
.xp-garden.is-reduced .xp-plant-event { animation: none; }
@media (prefers-reduced-motion: reduce) { .xp-garden .xp-plant-event { animation: none; } }

.xp-game-tip, .xp-tangram .xp-game-help { white-space: pre-line; }
.xp-complete-review-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.xp-complete-review-actions .btn, .xp-mission-card.is-cleared [data-review], .xp-mission-card.is-cleared [data-replay] { min-width: 0; padding-inline: 8px; background: #fff; color: #000; box-shadow: none; }

/* 입장 키 비주얼과 코드 찾기 */
.xp-intro { opacity: 1; transition: opacity 450ms ease; }
.xp-intro.is-leaving { opacity: 0; }
.xp-entry-help { border: 0; background: none; color: var(--text); text-decoration: underline; text-underline-offset: 4px; padding: 14px 8px; font: inherit; font-weight: 700; cursor: pointer; }
.xp-entry-help-copy { white-space: pre-line; line-height: 1.85; }
@media (prefers-reduced-motion: reduce) { .xp-intro { transition: none; } }

/* 제한 시간과 러너 HUD */
.xp-game-timer, .xp-pipe-stats strong { font-size: clamp(24px, 6vw, 32px); font-weight: 900; font-variant-numeric: tabular-nums; }
.xp-game-timer { width: 100%; padding: 12px; margin: 12px 0; border: 2px solid var(--spot-color); border-radius: 12px; background: var(--spot-soft); color: var(--spot-ink); }
.xp-garden-count { font-weight: 800; color: var(--spot-ink); }
.xp-run-console { width: 100%; border: 3px solid #482c3c; border-radius: 18px; overflow: hidden; background: #301f32; box-shadow: 0 6px 0 #ed9b53; }
.xp-run-stats { margin: 0; padding: 14px 12px; color: #fff4df; align-items: center; text-align: left; }
.xp-run-stats > div { display: grid; gap: 5px; }
.xp-run-stats > div > span { font-size: 12px; letter-spacing: .06em; }
.xp-run-clock { flex: 1; min-width: 0; }
.xp-run-clock strong { font-size: clamp(24px, 5vw, 32px); line-height: 1.2; color: #ffe4a6; white-space: nowrap; }
.xp-run-clock progress { width: 100%; max-width: 240px; height: 8px; accent-color: #ffb04c; }
.xp-run-health { text-align: center; }
.xp-run-health strong { display: flex; gap: 3px; }
.xp-heart { color: #ff805f; font-size: clamp(22px, 5vw, 30px); text-shadow: 0 2px #971e47; }
.xp-heart.is-lost { color: #786779; text-shadow: none; }
.xp-run-console .xp-run-stage { border: 0; border-top: 2px solid #75525b; border-radius: 0; }
/* 시간 안내 때부터 이어지는 반투명 밤하늘 */
.xp-timing { isolation: isolate; }
.xp-timing > .xp-nebula { z-index: -1; opacity: .22; pointer-events: none; }
.xp-timing[data-timing-phase="ready"], .xp-timing[data-timing-phase="countdown"] { background: #f7f1ff; color: #271442; }
.xp-timing-target, .xp-countdown { color: #5921ac; }
.xp-nebula b { position: absolute; display: block; }
.xp-sky-moon { width: 58px; height: 58px; top: 22%; right: 23%; border-radius: 50%; background: #fff4c4; box-shadow: 0 0 34px #f5dd9480; }
.xp-sky-moon::after { content: ""; position: absolute; width: 48px; height: 48px; border-radius: 50%; left: -4px; top: -5px; background: #241342; }
.xp-sky-cloud { width: 150px; height: 40px; border-radius: 50%; background: #ae91d4; opacity: .42; filter: blur(7px); box-shadow: 35px -18px 0 #ae91d4, 70px 2px 0 #ae91d4; }
.cloud-one { left: 12%; top: 38%; }.cloud-two { right: 16%; bottom: 20%; transform: scale(.8); }
.xp-sky-planet { left: 24%; bottom: 30%; width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, #f0a1d2, #8377dd); }
.xp-sky-planet::after { content: ""; position: absolute; inset: 14px -18px; border: 4px solid #d4b9f1; border-radius: 50%; transform: rotate(-25deg); }
.xp-sky-ufo { right: 22%; top: 52%; width: 52px; height: 16px; border-radius: 50%; background: #bbc5ec; box-shadow: 0 5px 14px #be9bfc66; }
.xp-sky-ufo::before { content: ""; position: absolute; width: 26px; height: 18px; left: 13px; top: -12px; border-radius: 50% 50% 10% 10%; background: #81c6da; }
.xp-sky-ufo::after { content: "• • •"; position: absolute; inset: -3px 0 0; color: #ffeab6; font: 15px sans-serif; text-align: center; }
.xp-sky-star { width: 32px; height: 32px; background: #fff4cd; clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); }.star-one { left: 22%; top: 20%; }.star-two { right: 30%; bottom: 14%; width: 22px; height: 22px; }

/* 다섯 게임 공통 성적 카드 */
.xp-game-outro { max-width: 600px; margin-inline: auto; gap: 18px; background: linear-gradient(160deg, var(--surface) 50%, var(--spot-soft)); border: 2px solid var(--spot-color); }
.xp-game-outro h1 { color: var(--spot-ink); font-weight: 950; }
.xp-game-outro .xp-result-lead { font-weight: 750; line-height: 1.6; }
.xp-result-score { background: var(--spot-soft); border-color: var(--spot-ink); box-shadow: 0 5px 0 var(--spot-color); }
.xp-result-score > strong { font-size: clamp(48px, 13vw, 68px); font-weight: 950; }
.xp-result-score > span { font-size: 15px; letter-spacing: .08em; }
.xp-result-detail { width: 100%; margin: 0; padding: 16px; border: 1px solid var(--spot-color); border-radius: 14px; background: var(--surface); color: var(--spot-ink); }
.xp-result-time { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-weight: 750; }
.xp-result-time strong { font-size: 26px; font-weight: 900; }
.xp-result-hits, .xp-round-summary { font-weight: 900; font-size: 20px; line-height: 1.6; }
.xp-result-round { font-size: 16px; margin: 0 0 8px; font-weight: 900; }
.xp-result-detail dd { font-size: 21px; }
.xp-result-detail dl > div:last-child { border-top: 2px solid var(--spot-color); margin-top: 4px; font-weight: 900; }
.xp-game-outro .xp-game-notice { font-size: 13px; line-height: 1.65; }
.xp-puzzle-review__nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.xp-review-answer { padding: 32px 16px; text-align: center; font-size: 40px; font-weight: 900; }

/* 오픈 전 안내는 입장 화면의 색·카드·타이포그래피를 함께 사용한다. */
.xp-coming-soon { text-align: center; }
.xp-coming-soon__date { display: grid; gap: 10px; padding: 24px 16px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.xp-coming-soon__date p { margin: 0; color: var(--muted); font-size: .85rem; }
.xp-coming-soon__date time { color: var(--text); font-size: clamp(1.1rem, 5vw, 1.4rem); font-weight: 900; line-height: 1.6; word-break: keep-all; }
.xp-coming-soon__note { margin: 8px auto; max-width: 22rem; color: var(--muted); line-height: 1.8; word-break: keep-all; }

.xp-hidden-image-page > h1 { font-size: 1.2rem; line-height: 1.5; text-align: center; }
.xp-hidden-words { display: grid; justify-items: center; gap: 24px; padding: 20px 16px; }
.xp-hidden-words__lines { display: grid; gap: 10px; width: 100%; justify-items: center; }
.xp-hidden-word { display: grid; place-items: center; box-sizing: border-box; width: 100%; max-width: 330px; height: 48px; margin: 0; padding: 0; border: 0; border-radius: 8px; font: 900 32px/48px var(--font-display, sans-serif); letter-spacing: .02em; color: var(--text); background: transparent; }
button.xp-hidden-word { cursor: pointer; }
.xp-hidden-word.is-masked { position: relative; background: transparent; }
.xp-paint-stroke { width: 100%; height: 100%; fill: var(--word-color); pointer-events: none; }
.xp-hidden-word.is-masked:nth-child(3n) .xp-paint-stroke { transform: rotate(-1deg) scaleX(-1); }
.xp-hidden-word.is-masked:nth-child(3n + 1) .xp-paint-stroke { transform: rotate(.8deg); }
.xp-hidden-word:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
.xp-hidden-color-puzzle { display: grid; gap: 18px; }
.xp-hidden-color-puzzle > h1 { font-size: 1.25rem; text-align: center; }
.xp-hidden-help { display: flex; align-items: center; justify-content: center; box-sizing: border-box; padding: 0; line-height: 1; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 50%; font-size: 1.5rem; text-decoration: none; }

.xp-hidden-help > span { display: block; line-height: 1; }
.xp-hidden-puzzle-pending { display: grid; place-items: center; min-height: 240px; color: var(--muted); text-align: center; }

.xp-hidden-color-puzzle form { display: grid; gap: 12px; }

.xp-display-notice { font-size: .8rem; line-height: 1.6; color: var(--muted); text-align: center; }

/* iOS에서 배경 위치를 유지하고 터치 강조·선택·스크롤을 게임 입력과 분리합니다. */
body[data-page="experience"].no-scroll { position: fixed; top: var(--locked-scroll-top, 0px); left: 0; right: 0; width: 100%; overflow: hidden; }
.xp-sheet, .xp-sheet-overlay { overscroll-behavior: contain; }
.xp-run-stage, #tangramBoard, #tangramBoard * { touch-action: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.xp-run-stage { appearance: none; -webkit-appearance: none; }
.xp-run-stage canvas { pointer-events: none; }
.xp-sheet input { font-size: max(16px, 1em); }
