/* =========================================================
   KSPO VALUE QUEST — 게임 버전
   ========================================================= */

@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url(fonts/barlow-condensed-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url(fonts/barlow-condensed-latin-700-normal.woff2) format('woff2'); }

:root {
  color-scheme: light;
  --sky: #3DB7FF;
  --sky-deep: #1597E8;
  --ink: #1B2A6B;
  --yellow: #FFD23F;
  --yellow-deep: #F5B800;
  --pink: #FF4F8B;
  --lemon: #FFE36E;
  --cyan: #B9F0FF;
  --paper: #FFFFFF;
  --soft: #F4F8FF;

  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  --display: 'Black Han Sans', 'Pretendard Variable', sans-serif;
  --cond: 'Barlow Condensed', 'Pretendard Variable', sans-serif;

  --line: 3px solid var(--ink);
  --col: 460px;
  --gutter: 20px;
  --pop: cubic-bezier(.3, 1.5, .5, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px; line-height: 1.6;
  color: var(--ink);
  word-break: keep-all; overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  background-color: var(--sky);
  /* 하늘색 바탕에 흩뿌린 색종이 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.38' stroke-width='5' stroke-linecap='round'%3E%3Cpath d='M20 30l10 6'/%3E%3Cpath d='M120 18l-4 11'/%3E%3Cpath d='M70 80l11-2'/%3E%3Cpath d='M150 96l6 9'/%3E%3Cpath d='M30 140l-9 7'/%3E%3Cpath d='M104 150l10 3'/%3E%3C/g%3E%3Cg fill='%23ffffff' fill-opacity='.35'%3E%3Ccircle cx='160' cy='40' r='4'/%3E%3Ccircle cx='48' cy='100' r='3'/%3E%3Ccircle cx='140' cy='160' r='3.5'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 180px 180px;
}
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 8px; }
main:focus, [tabindex='-1']:focus { outline: none; }

.skip-link { position: absolute; left: 12px; top: -48px; z-index: 50; padding: 10px 14px; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }

/* ---------- 머리글 ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: var(--line); }
.top__inner { display: flex; align-items: center; justify-content: space-between; max-width: var(--col); height: 58px; margin: 0 auto; padding: 0 var(--gutter); }
.brand { padding: 6px 0; border: 0; background: none; }
.brand img { width: auto; height: 18px; }
.chip-btn {
  height: 34px; padding: 0 14px;
  border: 2.5px solid var(--ink); border-radius: 12px;
  background: var(--yellow); box-shadow: 0 3px 0 var(--ink);
  font-size: 14px; font-weight: 800;
}
.chip-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

main { max-width: var(--col); margin: 0 auto; overflow-x: clip; }
@supports not (overflow-x: clip) { main { overflow-x: hidden; } }
.screen { padding: 22px var(--gutter) 40px; }
.foot { max-width: var(--col); margin: 0 auto; padding: 8px var(--gutter) 36px; font-size: 12px; font-weight: 600; color: rgba(27, 42, 107, .75); text-align: center; }

/* ---------- 공통 3D 버튼 ---------- */
.btn3d {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 54px; padding: 0 18px;
  border: var(--line); border-radius: 18px;
  box-shadow: 0 6px 0 var(--ink);
  font-size: 17px; font-weight: 900; letter-spacing: -.01em; text-decoration: none; color: var(--ink);
  transition: transform .08s, box-shadow .08s;
}
.btn3d:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.btn3d--pink { background: var(--pink); color: #fff; }
.btn3d--yellow { background: var(--yellow); }
.btn3d--white { background: var(--paper); }
.btn3d--cyan { background: var(--pink); color: #fff; }
.btn3d--xl { min-height: 66px; font-family: var(--display); font-weight: 400; font-size: 26px; letter-spacing: .01em; }
.btn3d[disabled] { background: #E4E9F2; color: #7C88A8; box-shadow: 0 6px 0 #9AA6C4; border-color: #9AA6C4; cursor: default; transform: none; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.home-share { margin-top: 32px; text-align: center; }
.home-share p { font-size: 15px; font-weight: 900; color: #0E2460; }
.duo--compact { margin-top: 10px; }
.duo--compact .btn3d { min-height: 48px; font-size: 15px; border-radius: 14px; box-shadow: 0 4px 0 var(--ink); }
.duo--compact .btn3d:active { box-shadow: 0 1px 0 var(--ink); transform: translateY(3px); }

/* 흰 글씨 + 남색 테두리 제목 */
.stroke-title {
  font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.25;
  color: #fff; -webkit-text-stroke: 3.5px var(--ink); paint-order: stroke fill;
  text-shadow: 0 4px 0 var(--ink);
}

/* ---------- 시작 화면 ---------- */
.quest-badge {
  display: inline-block; padding: 5px 12px; border-radius: 10px;
  background: var(--ink); color: var(--yellow);
  font-family: var(--cond); font-weight: 700; font-size: 16px; letter-spacing: .14em;
}
.mega {
  margin-top: 12px;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(40px, 12vw, 50px); line-height: 1.08; letter-spacing: .005em;
  color: #fff; -webkit-text-stroke: 4.5px var(--ink); paint-order: stroke fill;
  text-shadow: 0 5px 0 var(--ink);
}
.mega__hl { color: var(--yellow); }
.home-lead { margin-top: 10px; font-size: 15px; line-height: 1.55; font-weight: 800; color: #0E2460; }

.podium { position: relative; height: 204px; margin-top: 4px; }
.podium__base {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  width: 214px; height: 50px; border-radius: 50%;
  background: var(--yellow); border: var(--line); box-shadow: 0 9px 0 var(--ink);
}
.podium__hero { position: absolute; left: 50%; bottom: 34px; width: auto; height: 170px; transform: translateX(-50%); animation: bounce 1.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes bounce { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-8px); } }
.podium__say {
  position: absolute; right: 0; top: 4px;
  padding: 8px 12px; border: var(--line); border-radius: 16px 16px 4px 16px;
  background: var(--paper); box-shadow: 0 4px 0 var(--ink);
  font-size: 14px; font-weight: 900; transform: rotate(4deg);
}
.spark { position: absolute; width: 18px; height: 18px; background: var(--yellow); border: 2.5px solid var(--ink); transform: rotate(45deg); border-radius: 3px; }
.spark.s1 { left: 14px; top: 50px; }
.spark.s2 { left: 48px; top: 18px; width: 11px; height: 11px; background: var(--pink); }
.spark.s3 { right: 30px; top: 110px; width: 12px; height: 12px; background: #fff; }


.start-btn { margin-top: 16px; }
.start-meta { margin-top: 24px; text-align: center; font-size: 14px; font-weight: 800; color: #0E2460; }
/* 누적 도전자: 'N번째 도전자' 스티커 */
.next-no {
  display: block; width: fit-content; margin: 2px auto 8px; padding: 3px 12px;
  border: 2.5px solid var(--ink); border-radius: 10px;
  background: var(--yellow); box-shadow: 0 3px 0 var(--ink);
  font-size: 15px; font-weight: 900; color: var(--ink);
  transform: rotate(-2deg);
}
.next-no b { font-family: var(--cond); font-weight: 700; font-size: 20px; letter-spacing: .02em; }
.preview-sub { margin-top: 4px; font-size: 14px; font-weight: 800; color: #0E2460; }
.preview { margin-top: 36px; }
.mini-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.mini {
  display: flex; flex-direction: column; align-items: stretch; gap: 0;
  padding: 0; border: 2.5px solid var(--ink); border-radius: 12px; overflow: hidden;
  background: var(--paper); box-shadow: 0 4px 0 var(--ink); text-align: center;
}
.mini:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.mini__top { height: 8px; background: var(--accent); border-bottom: 2.5px solid var(--ink); }
.mini__art { display: grid; place-items: center; height: 72px; background: var(--tint); }
.mini__art img { width: auto; height: 58px; }
.mini b { padding: 5px 0 6px; font-size: 14px; font-weight: 900; border-top: 2.5px solid var(--ink); }
/* 시작 화면 카드별 현황 */
.mini { position: relative; }
.mini__crown {
  position: absolute; top: 14px; right: -2px; z-index: 1;
  padding: 1px 7px; border: 2px solid var(--ink); border-radius: 8px;
  background: var(--pink); color: #fff;
  font-size: 11.5px; font-weight: 900; line-height: 1.5;
  transform: rotate(6deg);
}
.mini__pct { display: grid; gap: 1px; padding: 4px 2px 6px; border-top: 2px dashed rgba(27, 42, 107, .3); line-height: 1.1; }
.mini__pct strong { font-family: var(--cond); font-weight: 700; font-size: 19px; color: var(--accent); }
.mini__pct small { font-size: 11px; font-weight: 800; color: #4A5785; }
.mini.locked .mini__art img { filter: grayscale(1) opacity(.35); }
.mini.locked b { color: #8D97B5; }

/* ---------- 미션 화면 ---------- */
.hud { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 8px; }
.hud__back {
  width: 38px; height: 38px; border: 2.5px solid var(--ink); border-radius: 12px;
  background: var(--paper); box-shadow: 0 3px 0 var(--ink);
  font-size: 24px; font-weight: 900; line-height: 1; padding-bottom: 3px;
}
.hud__back[disabled] { visibility: hidden; }
.hud__stage {
  font-family: var(--cond); font-weight: 700; font-size: 26px; letter-spacing: .08em; text-align: center;
  color: #fff; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink);
}

.xp {
  position: relative; height: 22px; margin: 16px 16px 0 16px;
  border: var(--line); border-radius: 14px; background: var(--paper); box-shadow: 0 4px 0 var(--ink);
}
.xp__fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 10px;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 10px, var(--yellow-deep) 10px 20px);
  transition: width .45s var(--pop);
}
.xp__head {
  position: absolute; top: 50%; left: 0; width: 40px; height: auto;
  transform: translate(-50%, -52%);
  transition: left .45s var(--pop);
  filter: drop-shadow(0 2px 0 var(--ink));
}

.scene {
  position: relative; z-index: 0;
  display: flex; justify-content: center; align-items: flex-end;
  height: 136px; margin: 22px 0 0;
}
.scene__art { width: auto; max-width: 70%; height: 128px; object-fit: contain; object-position: center bottom; }
.mission {
  position: relative; z-index: 1; margin-top: -22px; padding: 18px 18px 20px;
  border: var(--line); border-radius: 24px; background: var(--paper); box-shadow: 0 7px 0 var(--ink);
}
.mission__label { font-family: var(--cond); font-weight: 700; font-size: 16px; letter-spacing: .14em; color: var(--pink); }
.mission__q { margin-top: 6px; font-size: 21px; line-height: 1.45; font-weight: 900; letter-spacing: -.02em; outline: none; }
.mission.enter { animation: mission-in .35s var(--pop); }
.scene.enter .scene__art { animation: pop-up .4s var(--pop); }
@keyframes pop-up { from { transform: translateY(24px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes mission-in { from { transform: translateY(14px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }

.options { display: grid; gap: 14px; margin-top: 20px; }
.opt {
  display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: center;
  width: 100%; min-height: 78px; padding: 14px 16px;
  border: var(--line); border-radius: 20px; box-shadow: 0 6px 0 var(--ink);
  font-size: 16.5px; line-height: 1.45; font-weight: 800; text-align: left; color: var(--ink);
  transition: transform .08s, box-shadow .08s, background-color .15s;
}
.opt:nth-child(1) { background: var(--lemon); }
.opt:nth-child(2) { background: var(--cyan); }
.opt__key { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--ink); color: #fff; font-family: var(--cond); font-weight: 700; font-size: 24px; }
.opt:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.opt.selected { background: var(--pink); color: #fff; transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.opt.selected .opt__key { background: #fff; color: var(--pink); }
.opt[disabled] { cursor: default; }
.combo {
  margin-top: 18px; text-align: center; font-size: 17px; font-weight: 900;
  color: #fff; -webkit-text-stroke: 3.5px var(--ink); paint-order: stroke fill;
}

/* ---------- 연장전 (동점일 때만) ---------- */
.hud__stage--ot, #quiz.is-ot .hud__stage { color: var(--yellow); }
.xp--ot .xp__fill {
  background: repeating-linear-gradient(-45deg, var(--pink) 0 10px, #FF8DB5 10px 20px);
  background-size: 28.28px 28.28px;
  animation: stripes .8s linear infinite;
}
@keyframes stripes { to { background-position: 28.28px 0; } }
#quiz.is-ot .mission__label {
  display: inline-block; padding: 2px 10px; border-radius: 8px;
  background: var(--pink); color: #fff;
  font-family: var(--font); font-weight: 900; font-size: 14px; letter-spacing: 0;
}
.opt:nth-child(3) { background: #E3DBFF; }

.ot-head { position: relative; margin-top: 10px; text-align: center; }
.ot-title { margin-top: 0; }
.ot-whistle {
  position: absolute; right: 2px; top: 2px;
  padding: 3px 12px; border: 3px solid var(--ink); border-radius: 12px;
  background: var(--pink); color: #fff;
  font-family: var(--display); font-size: 20px; line-height: 1.3;
  transform: rotate(8deg); box-shadow: 0 4px 0 var(--ink);
}
#overtime:not([hidden]) .ot-whistle { animation: whistle .5s var(--pop) both; }
@keyframes whistle { from { transform: rotate(8deg) scale(.2); opacity: 0; } to { transform: rotate(8deg) scale(1); opacity: 1; } }

/* 전광판 + 그 위에 올라선 백호돌이 */
.scoreboard {
  position: relative; margin-top: 100px; padding: 12px 14px 16px;
  border: 3px solid var(--ink); border-radius: 22px;
  background-color: #14204F;
  background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1.6px);
  background-size: 6px 6px;
  box-shadow: 0 7px 0 var(--ink);
  color: #fff;
}
.scoreboard__hero {
  position: absolute; left: 50%; top: -86px; z-index: 1;
  width: auto; height: 96px; transform: translateX(-50%);
}
.scoreboard__top {
  display: flex; justify-content: space-between;
  font-family: var(--cond); font-weight: 700; font-size: 14px; letter-spacing: .14em;
  color: var(--yellow);
}
.sb-teams { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; }
.sb-team { flex: 1 1 0; display: grid; justify-items: center; gap: 2px; min-width: 0; }
.sb-team__art {
  display: grid; place-items: center; width: 54px; height: 54px;
  border: 2.5px solid #fff; border-radius: 16px; background: var(--tint); overflow: hidden;
}
.sb-team__art img { width: auto; height: 46px; }
.sb-team__score {
  margin-top: 4px;
  font-family: var(--cond); font-weight: 700; font-size: 64px; line-height: .95;
  color: var(--yellow); text-shadow: 0 0 14px rgba(255, 210, 63, .5);
  font-variant-numeric: tabular-nums;
}
.sb-team__name {
  margin-top: 4px; padding: 0 12px;
  border: 2px solid #fff; border-radius: 999px; background: var(--accent);
  font-size: 14px; font-weight: 900; line-height: 1.6;
}
.sb-vs { flex: none; padding-bottom: 6px; font-family: var(--display); font-size: 28px; color: var(--pink); }
.sb-teams[data-count="3"] .sb-team__score { font-size: 54px; }
#overtime:not([hidden]) .sb-team__score { animation: score-pop .45s var(--pop) both; }
#overtime:not([hidden]) .sb-team:nth-of-type(2) .sb-team__score { animation-delay: .1s; }
#overtime:not([hidden]) .sb-team:nth-of-type(3) .sb-team__score { animation-delay: .2s; }
@keyframes score-pop { from { transform: scale(1.6); opacity: 0; } to { transform: none; opacity: 1; } }

.ot-say {
  margin-top: 20px; text-align: center;
  font-size: 19px; line-height: 1.4; font-weight: 900;
  color: #fff; -webkit-text-stroke: 3.5px var(--ink); paint-order: stroke fill;
}
#overtime .btn3d--xl { margin-top: 16px; }

/* 결과: 연장전에서 이긴 카드는 +1 */
.bars--ot .bar { grid-template-columns: 38px 1fr 40px; }
.bar--ot i::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: var(--w); width: var(--p);
  background: repeating-linear-gradient(-45deg, var(--pink) 0 4px, #FFD1E2 4px 8px);
  border-right: 2.5px solid var(--ink);
}
.bar b small { margin-left: 1px; font-size: 15px; color: var(--pink); }
.bars__ot {
  margin-top: 12px; padding: 8px 12px;
  border: 2px solid var(--ink); border-radius: 12px; background: #FFF0F5;
  font-size: 13.5px; font-weight: 800; line-height: 1.55;
}
.bars__ot b {
  display: inline-block; margin-right: 6px; padding: 0 7px; border-radius: 6px;
  background: var(--pink); color: #fff;
  font-family: var(--cond); font-weight: 700; font-size: 13px; letter-spacing: .08em;
}

/* ---------- 카드 뽑는 중 ---------- */
.screen--center { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 66vh; }
.card-back {
  display: grid; place-items: center; width: 168px; height: 232px;
  border: var(--line); border-radius: 20px; box-shadow: 0 8px 0 var(--ink);
  background: repeating-linear-gradient(45deg, #24398A 0 12px, var(--ink) 12px 24px);
  animation: shake .5s ease-in-out infinite alternate;
}
.card-back span { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; border: var(--line); background: var(--yellow); font-family: var(--display); font-size: 40px; color: var(--ink); }
@keyframes shake { from { transform: rotate(-5deg) scale(.98); } to { transform: rotate(5deg) scale(1.02); } }
.loading__text { margin-top: 26px; font-family: var(--display); font-size: 26px; color: #fff; -webkit-text-stroke: 3.5px var(--ink); paint-order: stroke fill; text-shadow: 0 4px 0 var(--ink); }
.dots i { font-style: normal; animation: blink 1s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }

/* ---------- 결과 ---------- */
.r-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.r-title { font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1.15; color: var(--yellow); -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 0 4px 0 var(--ink); outline: none; }
.r-title--small { font-size: 28px; }
.new-badge { flex: none; margin-bottom: 6px; padding: 3px 10px; border: 2.5px solid var(--ink); border-radius: 10px; background: var(--pink); color: #fff; font-family: var(--cond); font-weight: 700; font-size: 16px; letter-spacing: .1em; transform: rotate(6deg); box-shadow: 0 3px 0 var(--ink); }

.friend-note { margin-top: 14px; padding: 14px 16px; border: var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 5px 0 var(--ink); font-size: 15px; font-weight: 700; }
.friend-note .btn3d { margin-top: 12px; }

.vcard {
  --accent: var(--ink); --tint: var(--soft);
  position: relative; margin-top: 16px;
  border: var(--line); border-radius: 26px; background: var(--paper); box-shadow: 0 9px 0 var(--ink);
  overflow: hidden;
}
.vcard--reveal { animation: reveal .9s var(--pop) both; }
@keyframes reveal {
  0% { transform: perspective(900px) rotateY(80deg) scale(.85); opacity: 0; }
  60% { transform: perspective(900px) rotateY(-8deg) scale(1.02); opacity: 1; }
  100% { transform: none; }
}
.vcard--reveal::after { /* 반짝이는 빛 한 번 */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.75) 50%, transparent 65%);
  transform: translateX(-120%); animation: shine 1.1s .7s ease-out forwards;
}
@keyframes shine { to { transform: translateX(120%); } }
.vcard__band { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--accent); border-bottom: var(--line); color: #fff; font-family: var(--cond); font-weight: 700; font-size: 17px; letter-spacing: .1em; }
.vcard__stars { color: var(--yellow); letter-spacing: 2px; -webkit-text-stroke: 1px var(--ink); }
.vcard__art {
  position: relative; display: grid; place-items: center; height: 196px;
  background: repeating-conic-gradient(from 0deg at 50% 62%, var(--tint) 0 12deg, #fff 12deg 24deg);
  border-bottom: var(--line);
}
.vcard__art img { width: auto; height: 172px; }
.vcard__stamp { position: absolute; right: 14px; top: 14px; padding: 3px 10px; border: 3px solid var(--accent); border-radius: 10px; background: rgba(255,255,255,.9); color: var(--accent); font-family: var(--display); font-size: 20px; transform: rotate(10deg); }
.vcard__body { padding: 16px 18px 18px; }
.vcard__value { font-size: 14px; font-weight: 900; color: var(--accent); }
.vcard__name { margin-top: 2px; font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1.15; letter-spacing: .01em; }
.vcard__quote { margin-top: 4px; font-size: 16px; font-weight: 800; color: #3A4A86; }
.vcard__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.vcard__tags span { padding: 3px 10px; border: 2px solid var(--ink); border-radius: 999px; background: var(--tint); font-size: 13px; font-weight: 800; }

.bars { margin-top: 16px; padding-top: 14px; border-top: 2.5px dashed #C9D2EA; }
.bars h3 { font-family: var(--cond); font-weight: 700; font-size: 15px; letter-spacing: .14em; color: var(--pink); }
.bar { display: grid; grid-template-columns: 38px 1fr 22px; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; font-weight: 900; }
.bar i { position: relative; height: 14px; border: 2.5px solid var(--ink); border-radius: 8px; background: #fff; overflow: hidden; }
.bar i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--c); border-right: 2.5px solid var(--ink); }
.bar i.zero::after { border-right: 0; }
.bar b { text-align: right; font-family: var(--cond); font-size: 17px; }

.reward {
  display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 10px;
  width: 100%; margin-top: 18px; padding: 10px 14px;
  border: var(--line); border-radius: 20px; background: var(--yellow); box-shadow: 0 6px 0 var(--ink);
  font-size: 18px; font-weight: 900; text-align: left; text-decoration: none; color: var(--ink);
}
.reward:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.reward img { width: 52px; height: auto; }
.reward small { display: block; font-size: 13px; font-weight: 700; color: #5A4A00; }
.reward__tag { padding: 3px 10px; border: 2.5px solid var(--ink); border-radius: 10px; background: var(--pink); color: #fff; font-size: 13px; font-weight: 900; }
.reward[disabled] { background: #E4E9F2; color: #7C88A8; border-color: #9AA6C4; box-shadow: 0 6px 0 #9AA6C4; cursor: default; }
.reward[disabled] img { filter: grayscale(1); opacity: .6; }
.reward[disabled] .reward__tag { background: #9AA6C4; border-color: #9AA6C4; }
.reward-period { margin-top: 10px; text-align: center; font-size: 13px; font-weight: 800; color: #0E2460; }

.panel { margin-top: 26px; padding: 18px; border: var(--line); border-radius: 22px; background: var(--paper); box-shadow: 0 7px 0 var(--ink); }
.panel h2 { font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1.3; }
.panel h2 small { display: block; font-family: var(--cond); font-weight: 700; font-size: 14px; letter-spacing: .14em; color: var(--pink); }
.checks { margin-top: 10px; }
.checks li { display: grid; grid-template-columns: 26px 1fr; gap: 8px; padding: 8px 0; font-size: 16px; font-weight: 700; line-height: 1.5; }
.checks li::before { content: '✔'; display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid var(--ink); border-radius: 8px; background: var(--accent); color: #fff; font-size: 13px; }
.story p { margin-top: 10px; font-size: 16px; line-height: 1.75; color: #33407A; }
.cheer-box { display: grid; grid-template-columns: 70px 1fr; gap: 12px; align-items: center; margin-top: 14px; padding: 12px 14px; border: 2.5px solid var(--ink); border-radius: 16px; background: var(--tint); }
.cheer-box img { width: 70px; height: auto; }
.cheer-box b { display: block; font-size: 13px; color: var(--accent); font-weight: 900; }
.cheer-box p { margin: 0; font-size: 15px; font-weight: 800; line-height: 1.5; color: var(--ink); }

.partner { display: grid; grid-template-columns: 88px 1fr; gap: 14px; align-items: center; width: 100%; margin-top: 12px; padding: 10px; border: 2.5px solid var(--ink); border-radius: 18px; background: var(--paper); text-align: left; }
.partner__art { display: grid; place-items: center; height: 88px; border: 2.5px solid var(--ink); border-radius: 14px; background: var(--tint); }
.partner__art img { width: auto; height: 62px; }
.partner small { font-size: 13px; font-weight: 900; color: var(--accent); }
.partner strong { display: block; font-size: 19px; font-weight: 900; }
.partner span { display: block; margin-top: 2px; font-size: 14px; font-weight: 600; line-height: 1.5; color: #44508A; }

.dex-count { margin-top: 4px; font-size: 14px; font-weight: 800; color: #44508A; }
.dex { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.dex .mini { box-shadow: 0 4px 0 var(--ink); }
.dex .mini__art { height: 96px; }
.dex .mini__art img { height: 78px; }
.dex .mini b { font-size: 15px; }
.dex .mini b small { display: block; font-size: 12px; font-weight: 800; color: var(--accent); }
.dex .mini.locked b small { color: #8D97B5; }

.mvv dl { display: grid; gap: 8px; margin-top: 12px; }
.mvv dl div { padding: 12px 14px; border: 2px solid var(--ink); border-radius: 14px; background: var(--soft); }
.mvv dt { font-size: 13px; font-weight: 900; color: var(--pink); }
.mvv dd { font-size: 16px; font-weight: 800; line-height: 1.5; }
.mvv .btn3d { margin-top: 14px; }

.end-actions { display: grid; gap: 12px; margin-top: 26px; }
.notice { margin-top: 22px; font-size: 13px; font-weight: 700; line-height: 1.6; color: #0E2460; text-align: center; }

/* 도감 화면 */
.dex-page .dex { grid-template-columns: repeat(2, 1fr); }
.dex-page .dex-count { color: #0E2460; }
.dex-page .end-actions { margin-top: 20px; }

/* ---------- 색종이 터짐 (결과가 나올 때 한 번) ---------- */
.confetti { position: fixed; left: 50%; top: 30%; width: 0; height: 0; z-index: 40; pointer-events: none; }
.confetti i { position: absolute; width: 10px; height: 16px; border: 2px solid var(--ink); border-radius: 3px; opacity: 0; animation: burst 1.4s cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes burst {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)); }
}

/* ---------- 알림 ---------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 60; transform: translate(-50%, 12px); max-width: calc(100% - 40px); padding: 12px 18px; border: var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 5px 0 var(--ink); font-size: 15px; font-weight: 800; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.share-dialog {
  background: #fff; width: min(92vw, 380px); padding: 22px; border: var(--line); border-radius: 22px; box-shadow: 0 8px 0 var(--ink); color: var(--ink); }
.share-dialog::backdrop { background: rgba(27, 42, 107, .5); }
.share-dialog h2 { font-size: 18px; font-weight: 900; }
.share-dialog p { margin-top: 6px; font-size: 14px; }
.share-dialog input { background: #fff; color: #132B47; width: 100%; margin: 14px 0; padding: 12px; border: 2.5px solid var(--ink); border-radius: 12px; font: inherit; font-size: 14px; }

/* ---------- 키가 작은 화면(작은 폰, 카카오톡 인앱 브라우저) ---------- */
@media (max-height: 760px) {
  .screen { padding-top: 16px; }
  .mega { font-size: clamp(36px, 10.6vw, 44px); margin-top: 10px; }
  .home-lead { font-size: 14.5px; }
  .podium { height: 172px; }
  .podium__hero { height: 140px; bottom: 28px; }
  .podium__base { width: 180px; height: 42px; bottom: 10px; }
  .btn3d--xl { min-height: 60px; font-size: 24px; }
  .start-btn { margin-top: 12px; }

  .xp { margin-top: 12px; }
  .scene { height: 104px; margin-top: 16px; }
  .scene__art { height: 98px; }
  .mission { padding: 14px 16px 16px; }
  .mission__q { font-size: 19px; }
  .options { gap: 12px; margin-top: 16px; }
  .opt { min-height: 64px; padding: 10px 14px; font-size: 15.5px; }
  .opt__key { width: 36px; height: 36px; font-size: 21px; }
  .opt { grid-template-columns: 36px 1fr; }
  .combo { margin-top: 12px; font-size: 16px; }

  .ot-head .mega { font-size: clamp(34px, 10vw, 40px); }
  .scoreboard { margin-top: 88px; padding: 10px 12px 12px; }
  .scoreboard__hero { height: 82px; top: -74px; }
  .sb-team__art { width: 46px; height: 46px; border-radius: 14px; }
  .sb-team__art img { height: 38px; }
  .sb-team__score { font-size: 54px; }
  .sb-teams[data-count="3"] .sb-team__score { font-size: 46px; }
  .ot-say { margin-top: 14px; font-size: 17px; }
  #overtime .btn3d--xl { margin-top: 12px; }
}

/* ---------- 폭이 좁은 화면 ---------- */
@media (max-width: 370px) {
  .vcard__band { font-size: 15px; letter-spacing: .08em; padding: 10px 14px; }
  .partner { grid-template-columns: 72px 1fr; gap: 12px; }
  .partner__art { height: 72px; }
  .partner__art img { height: 50px; }
  .r-title { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .confetti { display: none; }
}

/* 이벤트 안내 카드(결과 카드 바로 아래) */
.event-panel { --accent: #C21F5B; --tint: #FFF6D6; position: relative; margin-top: 27px; }
.event-panel h2 { font-size: 26px; line-height: 1.25; }
.event-panel__emoji { position: absolute; top: 10px; right: 14px; font-size: 36px; transform: rotate(12deg); }
.event-panel .reward { margin-top: 14px; }
.vcard + .duo { margin-top: 27px; }
.duo + .event-panel { margin-top: 25px; }
.duo + .panel { margin-top: 24px; }
.partner .partner__art { display: grid; place-items: center; margin-top: 0; }
.bars__ot { display: flex; align-items: flex-start; gap: 8px; }
.bars__ot b { flex: none; margin-right: 0; }
.reward-period { text-wrap: balance; }

/* 이벤트 버튼: 좁은 화면에서도 문구가 한 줄에 들어가도록 */
.reward { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; padding: 10px 12px; line-height: 1.3; font-size: 18px; }
.reward img { width: 44px; }
.reward > span:nth-child(2) { white-space: nowrap; }
.reward small { margin-top: 2px; font-size: 13px; line-height: 1.3; white-space: nowrap; }
.reward__tag { padding: 2px 8px; border-width: 2px; border-radius: 9px; font-size: 12px; line-height: 1.4; }
@media (max-width: 370px) {
  .reward { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 6px; padding: 10px; font-size: 16.5px; }
  .reward img { width: 38px; }
  .reward small { font-size: 12px; }
  .reward__tag { padding: 2px 6px; font-size: 11px; }
}
