/* =========================================================
   바이브코딩 미션센터 - 스타일
   ========================================================= */

/* 픽셀 글꼴 (Galmuri, SIL OFL 1.1 - fonts/OFL-Galmuri.md) */
@font-face {
  font-family: "Galmuri11";
  src: url("../fonts/Galmuri11-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0d0a2b;
  --bg-2: #15104a;
  --panel: #1c1760;
  --panel-2: #241e74;
  --line: #3d3599;
  --text: #f4f2ff;
  --muted: #b9b3e8;

  --green: #16a34a;
  --green-dark: #0b6b2f;
  --green-light: #4ade80;
  --red: #e11d2e;
  --red-dark: #8f0f1b;
  --yellow: #ffd23f;
  --yellow-dark: #b88a00;
  --pink: #ff5cad;
  --cyan: #34e1ff;
  --purple: #8b5cf6;

  --pixel: "Galmuri11", "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --body: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;

  --hud-h: 118px;
  --radius: 18px;
  --maxw: 1180px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(139, 92, 246, .35), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(52, 225, 255, .14), transparent 60%),
    radial-gradient(900px 600px at 100% 80%, rgba(255, 92, 173, .14), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* 바닥 격자 무늬 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.star {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #fff;
  box-shadow: 0 0 6px #fff;
  opacity: .7;
  animation: twinkle 3s ease-in-out infinite;
}
.star.c { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.star.p { background: var(--pink); box-shadow: 0 0 8px var(--pink); }
.star.y { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
@keyframes twinkle { 0%, 100% { opacity: .15; } 50% { opacity: .95; } }

a { color: var(--cyan); }
b.g { color: var(--green-light); }
kbd {
  font-family: var(--pixel);
  font-size: .8em;
  padding: 1px 6px;
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  border-radius: 6px;
  background: var(--panel-2);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 200;
  padding: 8px 14px;
  background: var(--yellow);
  color: #000;
  border-radius: 8px;
}
.skip-link:focus { left: 8px; }

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

/* ===================== HUD ===================== */
.hud {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 10, 43, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 3px solid var(--line);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
}
.hud__row {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 16px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--pixel);
  font-size: 20px;
  letter-spacing: 1px;
  white-space: nowrap;
}
.logo__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--purple);
  border: 3px solid #fff;
  border-radius: 10px;
  box-shadow: 0 4px 0 #4c2a9c;
  font-size: 20px;
}
.logo__text b { color: var(--green-light); font-weight: 700; }

.xp {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.xp__lv {
  font-family: var(--pixel);
  font-size: 14px;
  padding: 4px 8px;
  background: var(--yellow);
  color: #2a1f00;
  border-radius: 8px;
  box-shadow: 0 3px 0 var(--yellow-dark);
  white-space: nowrap;
}
.xp__body { min-width: 0; }
.xp__name {
  display: block;
  font-family: var(--pixel);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xp__bar {
  width: 150px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 4px;
  background: #0a0822;
  overflow: hidden;
}
.xp__bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(90deg, var(--green-light) 0 8px, var(--green) 8px 10px);
  transition: width .5s cubic-bezier(.2, .9, .3, 1.2);
}
.xp__num {
  font-family: var(--pixel);
  font-size: 13px;
  white-space: nowrap;
}
.xp__num b { color: var(--green-light); font-size: 16px; }
.xp.bump .xp__lv { animation: pop .5s ease; }

.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4px 12px 10px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-family: var(--pixel);
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--bg-2);
  transition: background .2s, border-color .2s, transform .15s;
}
.nav a span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: 11px;
  border-radius: 50%;
  background: var(--line);
}
.nav a:hover { transform: translateY(-2px); border-color: var(--cyan); }
.nav a.is-active {
  background: var(--purple);
  border-color: #fff;
}
.nav a.is-active span { background: var(--yellow); color: #2a1f00; }

/* ===================== 레이아웃 ===================== */
main { display: block; }

.section,
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px 16px 24px;
  scroll-margin-top: var(--hud-h);
}
.section__head { margin-bottom: 26px; }
.section__head h2 {
  margin: 6px 0 8px;
  font-family: var(--pixel);
  font-size: clamp(24px, 4.2vw, 38px);
  line-height: 1.3;
  text-shadow: 3px 3px 0 #000, 0 0 18px rgba(139, 92, 246, .7);
}
.section__head p { margin: 0; color: var(--muted); font-size: 17px; }
.section__head p b { color: var(--text); }
.stage {
  display: inline-block;
  margin: 0;
  padding: 4px 12px;
  font-family: var(--pixel);
  font-size: 13px;
  letter-spacing: 2px;
  color: #0b0920;
  background: var(--cyan);
  border-radius: 6px;
  box-shadow: 0 4px 0 #148aa3;
}
#mygame .stage { background: var(--pink); box-shadow: 0 4px 0 #a32566; }

/* ===================== HERO ===================== */
.hero {
  padding-top: 48px;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 32px;
  align-items: center;
}
.badge-pixel {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 14px;
  font-family: var(--pixel);
  font-size: 14px;
  background: rgba(255, 255, 255, .08);
  border: 2px dashed var(--cyan);
  border-radius: 10px;
}
.hero__title {
  margin: 0;
  font-family: var(--pixel);
  line-height: 1.12;
  letter-spacing: -1px;
}
.hero__title span { display: block; }
.hero__title .line1 { font-size: clamp(26px, 5vw, 44px); color: var(--muted); }
.hero__title .line2 {
  font-size: clamp(44px, 9.5vw, 92px);
  background: linear-gradient(90deg, var(--yellow), var(--pink) 45%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(4px 4px 0 #000);
}
.hero__title .line3 {
  font-size: clamp(40px, 8.5vw, 82px);
  color: #fff;
  text-shadow: 4px 4px 0 var(--purple), 8px 8px 0 #000;
}
.hero__desc { margin: 20px 0 26px; font-size: 18px; color: var(--muted); }
.hero__desc b { color: var(--text); }
.hero__btns { display: flex; flex-wrap: wrap; gap: 14px; }

/* 픽셀 버튼 공통 */
.btn-pixel {
  --c: var(--yellow);
  --d: var(--yellow-dark);
  --t: #2a1f00;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  font-family: var(--pixel);
  font-size: 17px;
  color: var(--t);
  text-decoration: none;
  background: var(--c);
  border: 3px solid #000;
  border-radius: 12px;
  box-shadow: 0 6px 0 var(--d), 0 6px 0 3px #000, inset 0 -4px 0 rgba(0, 0, 0, .15), inset 0 4px 0 rgba(255, 255, 255, .35);
  transition: transform .08s, box-shadow .08s, filter .2s;
  cursor: pointer;
}
.btn-pixel:hover { filter: brightness(1.08); transform: translateY(-2px); }
.btn-pixel:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--d), 0 1px 0 3px #000; }
.btn-yellow { animation: blink-glow 1.6s ease-in-out infinite; }
.btn-cyan { --c: var(--cyan); --d: #148aa3; --t: #04232b; }
@keyframes blink-glow {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  50% { filter: drop-shadow(0 0 14px rgba(255, 210, 63, .8)); }
}

/* 퀘스트 보드 */
.questboard {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 3px solid #fff;
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  box-shadow: 8px 8px 0 #000, 0 0 40px rgba(139, 92, 246, .35);
  position: relative;
}
.questboard::before {
  content: "QUEST";
  position: absolute;
  top: -15px;
  right: 18px;
  padding: 2px 10px;
  font-family: var(--pixel);
  font-size: 12px;
  background: var(--pink);
  color: #fff;
  border: 2px solid #fff;
  border-radius: 6px;
}
.questboard__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--pixel);
  font-size: 18px;
  margin-bottom: 10px;
}
.questboard__count b { color: var(--yellow); font-size: 22px; }
.questlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.questlist li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, .25);
  border: 2px solid var(--line);
  border-radius: 12px;
  font-size: 16px;
  line-height: 1.4;
  transition: background .3s, border-color .3s;
}
.questlist li small { color: var(--muted); }
.chk {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 8px;
  background: #0a0822;
  font-family: var(--pixel);
  font-size: 16px;
  color: #fff;
  padding: 0;
}
.chk-btn { cursor: pointer; }
.questlist li.is-done { background: rgba(22, 163, 74, .22); border-color: var(--green-light); }
.questlist li.is-done .chk { background: var(--green); animation: pop .4s ease; }
.questlist li.is-done .chk::after { content: "✔"; }
.questboard__tip { margin: 12px 2px 0; font-size: 14px; color: var(--muted); }

/* ===================== STAGE 0 ===================== */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.step {
  position: relative;
  padding: 26px 20px 20px;
  background: var(--panel);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 #000;
}
.step__num {
  position: absolute;
  top: -18px;
  left: 18px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-family: var(--pixel);
  font-size: 20px;
  color: #2a1f00;
  background: var(--yellow);
  border: 3px solid #000;
  border-radius: 10px;
}
.step h3 { margin: 6px 0 6px; font-family: var(--pixel); font-size: 20px; }
.step p { margin: 0; color: var(--muted); }
.step p b { color: var(--text); }

.rules,
.formula {
  margin-top: 22px;
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 3px dashed var(--pink);
  background: rgba(255, 92, 173, .08);
}
.rules h3,
.formula h3 { margin: 0 0 10px; font-family: var(--pixel); font-size: 20px; }
.rules ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.rules li::marker { content: "★ "; color: var(--yellow); }
.formula { border-color: var(--cyan); background: rgba(52, 225, 255, .07); }
.formula__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.formula__grid div {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 8px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 12px;
}
.formula__grid span { font-family: var(--pixel); color: var(--cyan); font-size: 20px; }
.formula__grid b { font-family: var(--pixel); font-size: 17px; font-weight: 700; }
.formula__grid small { color: var(--muted); font-size: 14px; line-height: 1.4; }

/* ===================== 카드 공통 ===================== */
.cards { display: grid; gap: 20px; }
.cards--two { grid-template-columns: repeat(2, 1fr); }
.cards--grid { grid-template-columns: repeat(3, 1fr); }

.card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 3px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 6px 6px 0 #000;
  transition: transform .2s, border-color .2s;
  min-width: 0;
}
.card:hover { transform: translateY(-3px); border-color: var(--cyan); }
.card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.card__icon {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: #0a0822;
  border: 3px solid #fff;
  border-radius: 14px;
  box-shadow: 0 4px 0 #000;
}
.card__title { margin: 0; font-family: var(--pixel); font-size: 19px; line-height: 1.35; }
.card__desc { margin: 2px 0 0; font-size: 15px; color: var(--muted); line-height: 1.45; }
.card--mini .card__icon { width: 44px; height: 44px; font-size: 22px; }
.card--mini .card__title { font-size: 17px; }
.card--mini .term__body { max-height: 150px; }
#bugfixList .card { border-color: #6b2d5a; }
#bugfixList .card:hover { border-color: var(--pink); }

/* 터미널 창 (프롬프트 상자) */
.term {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  border: 2px solid #000;
  border-radius: 12px;
  overflow: hidden;
  background: #070616;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
.term__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: #1a1745;
  border-bottom: 2px solid #000;
  font-family: var(--pixel);
  font-size: 12px;
  color: var(--muted);
}
.term__bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term__bar i:nth-child(2) { background: #febc2e; }
.term__bar i:nth-child(3) { background: #28c840; }
.term__bar span { margin-left: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.term__body {
  margin: 0;
  padding: 14px 16px;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: anywhere;
  font-family: var(--body);
  font-size: 15.5px;
  line-height: 1.7;
  color: #dfe8ff;
  scrollbar-width: thin;
  scrollbar-color: var(--purple) transparent;
  overscroll-behavior: contain;
}
.term__body.is-open { max-height: none; }
.term__body--tall { max-height: 420px; min-height: 260px; }
.term__body::-webkit-scrollbar { width: 8px; }
.term__body::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 8px; }

/* 대괄호 강조 */
.term__body .fill {
  color: #fff3b0;
  background: rgba(255, 210, 63, .14);
  border-radius: 4px;
  padding: 0 2px;
}
.term__body .sec { color: var(--cyan); font-weight: 700; }

/* ===================== 복사 버튼 (게임 스타일) ===================== */
.copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.copy-btn {
  position: relative;
  flex: 1 1 240px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 12px 18px;
  font-family: var(--pixel);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .5px;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, .45);
  background: linear-gradient(180deg, #22c55e 0%, var(--green) 55%, #128a3e 100%);
  border: 3px solid #000;
  border-radius: 14px;
  box-shadow:
    0 7px 0 var(--green-dark),
    0 7px 0 3px #000,
    inset 0 4px 0 rgba(255, 255, 255, .35),
    inset 0 -5px 0 rgba(0, 0, 0, .2);
  cursor: pointer;
  transition: transform .08s, box-shadow .08s, filter .2s, background .2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.copy-btn::after {
  /* 반짝이는 빛 */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 11px;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 45%, transparent 60%);
  background-size: 250% 100%;
  background-position: 150% 0;
  animation: shine 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shine { 0%, 60% { background-position: 150% 0; } 100% { background-position: -100% 0; } }
.copy-btn:hover { filter: brightness(1.1); transform: translateY(-2px); }
.copy-btn:active {
  transform: translateY(6px);
  box-shadow: 0 1px 0 var(--green-dark), 0 1px 0 3px #000, inset 0 4px 0 rgba(255, 255, 255, .25);
}
.copy-btn__ico {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  font-size: 14px;
  background: rgba(0, 0, 0, .25);
  border: 2px solid rgba(255, 255, 255, .7);
  border-radius: 8px;
  text-shadow: none;
}

/* 복사 완료 상태 = 빨강 */
.copy-btn.is-copied {
  background: linear-gradient(180deg, #f43f5e 0%, var(--red) 55%, #b5121f 100%);
  box-shadow:
    0 7px 0 var(--red-dark),
    0 7px 0 3px #000,
    inset 0 4px 0 rgba(255, 255, 255, .3),
    inset 0 -5px 0 rgba(0, 0, 0, .2);
  animation: copied-pop .45s ease;
}
.copy-btn.is-copied:active {
  box-shadow: 0 1px 0 var(--red-dark), 0 1px 0 3px #000;
}
.copy-btn.is-copied::after { animation: none; }
@keyframes copied-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.06) rotate(-1deg); }
  70% { transform: scale(.98) rotate(1deg); }
  100% { transform: scale(1); }
}

/* +XP 떠오르는 글자 */
.xp-float {
  position: absolute;
  left: 50%;
  top: -6px;
  font-family: var(--pixel);
  font-size: 18px;
  color: var(--yellow);
  text-shadow: 2px 2px 0 #000;
  pointer-events: none;
  animation: float-up 1s ease-out forwards;
  white-space: nowrap;
}
@keyframes float-up {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(.8); }
  20% { opacity: 1; transform: translate(-50%, -10px) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -48px) scale(1); }
}

.btn-ghost {
  flex: 0 0 auto;
  padding: 10px 14px;
  min-height: 44px;
  font-family: var(--pixel);
  font-size: 14px;
  color: var(--text);
  background: transparent;
  border: 2px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.btn-ghost:hover { border-color: var(--cyan); background: rgba(52, 225, 255, .08); }

/* ===================== 메인 퀘스트 ===================== */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 16px;
  font-family: var(--pixel);
  font-size: 15px;
  color: var(--text);
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: transform .15s, background .2s, border-color .2s;
}
.chip:hover { transform: translateY(-2px); border-color: var(--cyan); }
.chip.is-on {
  background: var(--purple);
  border-color: #fff;
  box-shadow: 0 4px 0 #4c2a9c;
}
.chip__n {
  padding: 0 7px;
  font-size: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .35);
}
.chip--sm { min-height: 38px; padding: 6px 12px; font-size: 13px; }

.stagemap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 30px;
  padding: 16px;
  background: rgba(0, 0, 0, .25);
  border: 3px solid var(--line);
  border-radius: var(--radius);
}
.stagemap a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  min-height: 52px;
  text-decoration: none;
  color: var(--text);
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.3;
  transition: transform .15s, border-color .2s, background .2s;
}
.stagemap a:hover { transform: translateY(-3px); border-color: var(--yellow); background: var(--panel-2); }
.stagemap a .e { font-size: 22px; }
.stagemap a .n {
  position: absolute;
  top: -8px;
  right: -6px;
  padding: 0 6px;
  font-family: var(--pixel);
  font-size: 11px;
  color: #2a1f00;
  background: var(--yellow);
  border: 2px solid #000;
  border-radius: 6px;
}
.stagemap a.is-cleared { border-color: var(--green-light); }
.stagemap a.is-cleared::after {
  content: "CLEAR";
  position: absolute;
  bottom: -8px;
  right: 6px;
  padding: 0 5px;
  font-family: var(--pixel);
  font-size: 10px;
  color: #fff;
  background: var(--green);
  border: 2px solid #000;
  border-radius: 5px;
}

.topics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
}
.topic {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 3px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 8px 8px 0 #000;
  scroll-margin-top: calc(var(--hud-h) + 16px);
  min-width: 0;
}
.topic.is-hidden { display: none; }
.topic.flash { animation: flash 1.2s ease; }
@keyframes flash {
  0%, 100% { border-color: var(--line); }
  30%, 60% { border-color: var(--yellow); box-shadow: 8px 8px 0 #000, 0 0 30px rgba(255, 210, 63, .6); }
}
.topic__head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.topic__icon {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  font-size: 34px;
  background: #0a0822;
  border: 3px solid #fff;
  border-radius: 16px;
  box-shadow: 0 5px 0 #000;
}
.topic__no {
  font-family: var(--pixel);
  font-size: 13px;
  color: var(--yellow);
  letter-spacing: 1px;
}
.topic__title { margin: 2px 0 6px; font-family: var(--pixel); font-size: 22px; line-height: 1.3; }
.topic__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 2px 10px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
}
.tag--game { background: rgba(52, 225, 255, .16); border-color: var(--cyan); }
.tag--study { background: rgba(255, 210, 63, .16); border-color: var(--yellow); }
.tag--make { background: rgba(255, 92, 173, .16); border-color: var(--pink); }
.tag--lv { color: var(--yellow); letter-spacing: 1px; }
.topic__desc { margin: 6px 0 0; color: var(--muted); font-size: 15px; line-height: 1.45; }

.phase-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 8px;
  font-family: var(--pixel);
  font-size: 14px;
  color: var(--green-light);
}
.phase-label::before {
  content: "";
  width: 10px;
  height: 10px;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

/* 2단계 잠금 해제 */
.level2 {
  margin-top: 18px;
  border: 2px dashed var(--yellow);
  border-radius: 16px;
  background: rgba(255, 210, 63, .06);
}
.level2 summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  min-height: 52px;
  font-family: var(--pixel);
  font-size: 15px;
  color: var(--yellow);
  cursor: pointer;
}
.level2 summary::-webkit-details-marker { display: none; }
.level2 summary .arrow { transition: transform .25s; }
.level2[open] summary .arrow { transform: rotate(180deg); }
.level2[open] summary .lock::before { content: "🔓"; }
.level2 summary .lock::before { content: "🔒"; margin-right: 6px; }
.level2__body { padding: 0 14px 14px; }
.level2__body .phase-label { color: var(--yellow); }

/* ===================== 나만의 게임 ===================== */
.builder {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 22px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 3px solid var(--pink);
  border-radius: 22px;
  box-shadow: 8px 8px 0 #000, 0 0 40px rgba(255, 92, 173, .25);
}
.builder__form { display: grid; gap: 14px; align-content: start; }
.idea-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-family: var(--pixel); font-size: 14px; }
.field { display: grid; gap: 6px; }
.field span { font-family: var(--pixel); font-size: 15px; }
.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--body);
  font-size: 16px; /* 16px 이상: iOS 확대 방지 */
  color: var(--text);
  background: #0a0822;
  border: 2px solid var(--line);
  border-radius: 12px;
  resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(52, 225, 255, .25);
}
.field ::placeholder { color: #7f78b8; }
.builder__form .btn-ghost { justify-self: start; }
.builder__out { display: flex; flex-direction: column; min-width: 0; }

/* ===================== 푸터 ===================== */
.footer {
  margin-top: 70px;
  padding: 40px 16px 90px;
  text-align: center;
  color: var(--muted);
  border-top: 3px solid var(--line);
  background: rgba(0, 0, 0, .3);
}
.footer p { margin: 4px 0; }
.footer__big { font-family: var(--pixel); font-size: 18px; color: var(--text); margin-bottom: 12px !important; }
.footer__small { font-size: 14px; }

/* ===================== 맨위 버튼 ===================== */
.totop {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  font-family: var(--pixel);
  font-size: 14px;
  line-height: 1.1;
  color: #2a1f00;
  background: var(--yellow);
  border: 3px solid #000;
  border-radius: 16px;
  box-shadow: 0 6px 0 var(--yellow-dark), 0 6px 0 3px #000, inset 0 4px 0 rgba(255, 255, 255, .45);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(.8);
  transition: opacity .25s, transform .25s, visibility .25s;
  -webkit-tap-highlight-color: transparent;
}
.totop span { font-size: 18px; }
.totop.is-show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.totop.is-show:hover { transform: translateY(-3px); }
.totop:active { transform: translateY(5px) !important; box-shadow: 0 1px 0 var(--yellow-dark), 0 1px 0 3px #000; }

/* ===================== 알림 ===================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 70;
  max-width: min(92vw, 460px);
  padding: 12px 20px;
  font-family: var(--pixel);
  font-size: 16px;
  text-align: center;
  color: #fff;
  background: #0a0822;
  border: 3px solid var(--yellow);
  border-radius: 14px;
  box-shadow: 6px 6px 0 #000;
  transform: translate(-50%, 140%);
  opacity: 0;
  transition: transform .3s cubic-bezier(.2, .9, .3, 1.3), opacity .3s;
  pointer-events: none;
}
.toast.is-show { transform: translate(-50%, 0); opacity: 1; }
.toast.is-big { border-color: var(--green-light); font-size: 18px; }

/* ===================== 스크롤 등장 효과 ===================== */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* 색종이 */
.confetti {
  position: fixed;
  top: -20px;
  z-index: 80;
  width: 10px;
  height: 14px;
  pointer-events: none;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(720deg); }
}

/* ===================== 반응형 ===================== */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .topics { grid-template-columns: 1fr; }
  .cards--grid { grid-template-columns: repeat(2, 1fr); }
  .builder { grid-template-columns: 1fr; }
  .formula__grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  :root { --hud-h: 112px; }
  body { font-size: 16px; }
  .hud__row { padding: 8px 12px 4px; }
  .logo { font-size: 16px; }
  .logo__icon { width: 32px; height: 32px; font-size: 17px; }
  .xp__bar { width: 84px; }
  .xp__name { display: none; }
  .xp__num { font-size: 11px; }
  .nav a { font-size: 13px; padding: 5px 10px; }

  .section, .hero { padding: 48px 14px 16px; }
  .hero { padding-top: 32px; }
  .hero__desc { font-size: 16px; }
  .hero__btns .btn-pixel { flex: 1 1 100%; }

  .steps { grid-template-columns: 1fr; gap: 26px; }
  .cards--two, .cards--grid { grid-template-columns: 1fr; }
  .formula__grid { grid-template-columns: repeat(2, 1fr); }
  .formula__grid div:last-child { grid-column: 1 / -1; }

  .topic { padding: 16px; border-radius: 18px; box-shadow: 5px 5px 0 #000; }
  .topic__icon { width: 54px; height: 54px; font-size: 28px; }
  .topic__title { font-size: 19px; }
  .term__body { font-size: 15px; max-height: 220px; }
  .stagemap { grid-template-columns: repeat(2, 1fr); padding: 12px; }

  .copy-btn { font-size: 16px; min-height: 54px; flex-basis: 100%; }
  .copy-row .btn-ghost { flex: 1 1 100%; }
  .builder { padding: 16px; }
  .totop { width: 60px; height: 60px; font-size: 13px; }
  .toast { bottom: 92px; font-size: 14px; }
}

@media (max-width: 380px) {
  .xp__num { display: none; }
  .logo__text { font-size: 14px; }
}

/* 움직임 줄이기 설정을 켠 경우 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* 인쇄 */
@media print {
  .hud, .totop, .toast, .sky, .filters, .stagemap, .copy-row { display: none !important; }
  body { background: #fff; color: #000; }
  .term__body { max-height: none !important; color: #000; }
  .topic, .card { box-shadow: none; border-color: #999; background: #fff; }
}

/* =========================================================
   가독성 개선 + 효과음 버튼 (v2)
   - 큰 제목·로고·단계 표시만 픽셀 글꼴로 남기고
   - 작은 글자(버튼, 메뉴, 카드 제목, 안내문)는 굵고 또렷한 글꼴로 바꿈
   ========================================================= */
:root {
  --muted: #d9d4fb;          /* 회색 글자를 더 밝게 */
  --round: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}

body {
  font-size: 18px;
  line-height: 1.75;
  letter-spacing: -0.01em;
}

/* 작은 글자는 또렷한 굵은 글꼴로 */
.nav a,
.chip,
.card__title,
.topic__title,
.copy-btn,
.btn-ghost,
.btn-pixel,
.field span,
.questboard__head,
.xp__name,
.step h3,
.rules h3,
.formula h3,
.formula__grid b,
.level2 summary,
.phase-label,
.toast,
.idea-chips,
.footer__big,
.badge-pixel,
.totop,
.term__bar,
.sound-btn {
  font-family: var(--round);
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* 제목 크기·간격 */
.card__title { font-size: 20px; line-height: 1.4; }
.card--mini .card__title { font-size: 19px; }
.topic__title { font-size: 24px; line-height: 1.35; }
.step h3 { font-size: 21px; }
.rules h3, .formula h3 { font-size: 21px; }
.section__head h2 { letter-spacing: 0; line-height: 1.35; }
.section__head p { font-size: 18px; line-height: 1.7; }
.hero__desc { font-size: 19px; line-height: 1.75; }

/* 설명 글자 */
.card__desc,
.topic__desc { font-size: 16.5px; line-height: 1.55; }
.step p { font-size: 17px; }
.rules li { font-size: 17px; }
.formula__grid small { font-size: 15px; }
.questlist li { font-size: 17px; }
.questboard__tip { font-size: 15px; }
.tag { font-size: 14px; padding: 3px 11px; }
.footer p { font-size: 16px; }

/* 메뉴·버튼 */
.nav a { font-size: 15.5px; padding: 7px 14px; }
.chip { font-size: 16px; }
.chip--sm { font-size: 14.5px; }
.btn-pixel { font-size: 18px; }
.btn-ghost { font-size: 15px; }
.level2 summary { font-size: 17px; }
.phase-label { font-size: 15.5px; }
.toast { font-size: 17px; line-height: 1.45; }
.copy-btn { font-size: 20px; letter-spacing: 0; }
.term__bar { font-size: 13px; font-weight: 600; }

/* 프롬프트 상자: 더 크고 밝게 */
.term__body {
  font-size: 17px;
  line-height: 1.85;
  color: #f3f5ff;
  max-height: 300px;
  padding: 16px 18px;
}
.term__body .sec { color: #5ff0ff; font-weight: 800; }
.term__body .fill { color: #ffe680; font-weight: 700; }
.card--mini .term__body { max-height: 190px; }
.term__body--tall { max-height: 460px; }

/* 입력칸 */
.field input,
.field textarea { font-size: 17px; line-height: 1.6; }
.field span { font-size: 17px; }

/* ----- 효과음 버튼 ----- */
.xp { margin-left: auto; }
.sound-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 12px;
  font-size: 14px;
  color: #04232b;
  background: var(--cyan);
  border: 3px solid #000;
  border-radius: 10px;
  box-shadow: 0 4px 0 #148aa3;
  cursor: pointer;
  transition: transform .08s, box-shadow .08s, background .2s;
  -webkit-tap-highlight-color: transparent;
}
.sound-btn:hover { transform: translateY(-2px); }
.sound-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #148aa3; }
.sound-btn__ico { font-size: 17px; line-height: 1; }
.sound-btn.is-off {
  color: #e6e3ff;
  background: #3a3478;
  box-shadow: 0 4px 0 #221d52;
}

@media (max-width: 720px) {
  body { font-size: 17px; }
  .term__body { font-size: 16px; line-height: 1.8; max-height: 260px; padding: 14px 15px; }
  .topic__title { font-size: 21px; }
  .card__title { font-size: 19px; }
  .copy-btn { font-size: 18px; }
  .nav a { font-size: 14.5px; padding: 6px 11px; }
  .section__head p, .hero__desc { font-size: 17px; }
  .toast { font-size: 15.5px; }
  .xp__bar { width: 64px; }
  .sound-btn { padding: 6px 9px; min-height: 38px; }
  .sound-btn__txt { display: none; }
}
@media (max-width: 380px) {
  .logo__text { display: none; }
}

/* =========================================================
   주제 바로가기(스테이지 맵) 가독성 개선 (v3)
   ========================================================= */
.stagemap {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  padding: 22px 18px 18px;
}
.stagemap a {
  gap: 12px;
  min-height: 74px;
  padding: 12px 14px;
  font-family: var(--round);
  font-size: 17.5px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: #ffffff;
  border-width: 3px;
  border-radius: 14px;
}
.stagemap a .e {
  flex: 0 0 auto;
  font-size: 30px;
  line-height: 1;
}
.stagemap a .n {
  top: -11px;
  right: -6px;
  padding: 1px 8px;
  font-size: 14px;
}
.stagemap a.is-cleared::after {
  bottom: -10px;
  font-size: 12px;
  padding: 0 6px;
}

@media (max-width: 720px) {
  .stagemap {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 10px;
    padding: 20px 12px 16px;
  }
  .stagemap a {
    min-height: 68px;
    padding: 10px 10px;
    gap: 8px;
    font-size: 16px;
  }
  .stagemap a .e { font-size: 26px; }
}
@media (max-width: 360px) {
  .stagemap a { font-size: 15px; }
}

/* =========================================================
   STAGE 표시 가독성 개선 (v4)
   - 안내문 회색(.section__head p)이 STAGE 글자색을 덮어쓰던 문제 수정
   ========================================================= */
.section__head .stage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 5px;
  font-family: var(--round);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 1.5px;
  line-height: 1.2;
  color: #04131c;
  text-shadow: none;
  background: var(--cyan);
  border: 3px solid #000;
  border-radius: 10px;
  box-shadow: 0 4px 0 #0e6f84;
}
.section__head .stage::before {
  content: "▶";
  font-size: 12px;
}
#mygame .section__head .stage {
  color: #2b0016;
  background: var(--pink);
  box-shadow: 0 4px 0 #a32566;
}

@media (max-width: 720px) {
  .section__head .stage { font-size: 15.5px; padding: 5px 12px 4px; }
}
/* MISSION 번호도 조금 더 크게 */
.topic__no { font-size: 15px; letter-spacing: 1.5px; }

/* =========================================================
   v5 · 전체 글자 크게 + 더 멋진 게임 연출
   ========================================================= */
:root { --maxw: 1240px; }

body { font-size: 19px; line-height: 1.78; }

/* ----- 큰 제목 ----- */
.section { padding-top: 80px; }
.section__head { margin-bottom: 32px; }
.section__head h2 {
  font-size: clamp(30px, 4.8vw, 48px);
  margin: 14px 0 12px;
}
.section__head h2::after {
  content: "";
  display: block;
  width: 120px;
  height: 8px;
  margin-top: 14px;
  border-radius: 4px;
  background: repeating-linear-gradient(90deg, var(--yellow) 0 16px, var(--pink) 16px 32px, var(--cyan) 32px 48px);
  box-shadow: 0 3px 0 #000;
}
.section__head p { font-size: 19.5px; color: #e4e0ff; }

/* ----- HERO ----- */
.hero { position: relative; }
.hero__title .line1 { font-size: clamp(30px, 5.4vw, 50px); color: #d9d4fb; }
.hero__title .line2 { font-size: clamp(50px, 10vw, 104px); }
.hero__title .line3 { font-size: clamp(46px, 9vw, 92px); }
.hero__desc { font-size: 21px; color: #e4e0ff; }
.badge-pixel { font-size: 16px; padding: 8px 16px; }
.btn-pixel { font-size: 20px; padding: 16px 26px; }

.floaters { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.floaters span {
  position: absolute;
  font-size: 40px;
  opacity: .5;
  filter: drop-shadow(0 0 12px rgba(139, 92, 246, .8));
  animation: floaty 7s ease-in-out infinite;
}
.floaters span:nth-child(1) { left: 2%;  top: 8%;  animation-delay: 0s; }
.floaters span:nth-child(2) { left: 46%; top: 4%;  font-size: 30px; animation-delay: -2s; }
.floaters span:nth-child(3) { left: 54%; top: 78%; animation-delay: -4s; }
.floaters span:nth-child(4) { left: 92%; top: 6%;  font-size: 34px; animation-delay: -1s; }
.floaters span:nth-child(5) { left: 38%; top: 92%; font-size: 28px; animation-delay: -3s; }
.floaters span:nth-child(6) { left: 96%; top: 88%; animation-delay: -5s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-22px) rotate(6deg); }
}

/* 퀘스트 보드 */
.questboard__head { font-size: 22px; }
.questlist li { font-size: 18.5px; padding: 12px 14px; }
.chk { width: 34px; height: 34px; font-size: 18px; }
.questboard__tip { font-size: 16px; }

/* ----- 흐르는 전광판 ----- */
.ticker {
  margin-top: 36px;
  overflow: hidden;
  background: var(--yellow);
  border-top: 4px solid #000;
  border-bottom: 4px solid #000;
  transform: rotate(-1.2deg);
  box-shadow: 0 8px 0 rgba(0, 0, 0, .35);
}
.ticker__track {
  display: flex;
  width: max-content;
  animation: ticker 32s linear infinite;
}
.ticker__track span {
  padding: 12px 34px;
  font-family: var(--round);
  font-size: 20px;
  font-weight: 900;
  color: #1d1400;
  white-space: nowrap;
}
@keyframes ticker { to { transform: translateX(-50%); } }

/* ----- 바이브코딩 미리보기 ----- */
.demo { padding-top: 56px; }
.demo__box {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 22px;
  padding: 26px;
  background: linear-gradient(135deg, rgba(52, 225, 255, .12), rgba(255, 92, 173, .12));
  border: 3px solid #fff;
  border-radius: 24px;
  box-shadow: 8px 8px 0 #000;
}
.demo__label { margin: 0 0 10px; font-family: var(--round); font-weight: 900; font-size: 20px; }
.demo__type {
  min-height: 150px;
  max-height: none;
  font-size: 19px;
  line-height: 1.75;
}
.demo__type::after {
  content: "▌";
  color: var(--green-light);
  animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.demo__arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--pixel);
  font-size: 40px;
  color: var(--yellow);
  text-shadow: 3px 3px 0 #000;
  animation: nudge 1.2s ease-in-out infinite;
}
.demo__arrow span {
  font-size: 16px;
  padding: 2px 8px;
  color: #fff;
  background: var(--purple);
  border: 2px solid #fff;
  border-radius: 6px;
  text-shadow: none;
}
@keyframes nudge { 50% { transform: translateX(8px); } }
.demo__screen {
  position: relative;
  min-height: 196px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background:
    radial-gradient(circle at 50% 120%, rgba(74, 222, 128, .35), transparent 60%),
    #070616;
  border: 4px solid #000;
  border-radius: 18px;
  box-shadow: inset 0 0 0 3px #2f2a7a, inset 0 0 40px rgba(52, 225, 255, .2);
  overflow: hidden;
}
.demo__screen::before {
  /* 옛날 게임기 화면 줄무늬 */
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .04) 0 2px, transparent 2px 4px);
  pointer-events: none;
}
.demo__emoji { font-size: 66px; line-height: 1; transition: transform .3s; }
.demo__title { font-family: var(--round); font-weight: 900; font-size: 24px; }
.demo__done {
  font-family: var(--round);
  font-weight: 900;
  font-size: 19px;
  padding: 4px 14px;
  color: #062b12;
  background: var(--green-light);
  border: 3px solid #000;
  border-radius: 10px;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .25s, transform .3s cubic-bezier(.2, .9, .3, 1.6);
}
.demo__screen.is-loading .demo__emoji { transform: scale(.4); opacity: .3; }
.demo__screen.is-done .demo__emoji { animation: bounce .9s ease infinite; }
.demo__screen.is-done .demo__done { opacity: 1; transform: scale(1); }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

/* ----- 준비 단계 ----- */
.step h3 { font-size: 23px; }
.step p { font-size: 18.5px; }
.step__num { width: 46px; height: 46px; font-size: 22px; }
.rules h3, .formula h3 { font-size: 23px; }
.rules li { font-size: 18.5px; }
.formula__grid b { font-size: 20px; }
.formula__grid span { font-size: 24px; }
.formula__grid small { font-size: 16.5px; }

/* ----- 메뉴 ----- */
.nav a { font-size: 17px; padding: 8px 16px; }
.nav a span { width: 24px; height: 24px; font-size: 13px; }
.logo { font-size: 22px; }
.chip { font-size: 17.5px; min-height: 48px; padding: 8px 18px; }

/* ----- 주제 카드: 분야별 색깔 띠 ----- */
.topic { position: relative; padding: 24px; overflow: hidden; }
.topic::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 8px;
  background: var(--cyan);
}
.topic[data-cat="study"]::before { background: var(--yellow); }
.topic[data-cat="make"]::before { background: var(--pink); }
.topic:hover { border-color: #fff; transform: translateY(-4px); }
.topic { transition: transform .2s, border-color .2s; }
.topic__icon { width: 74px; height: 74px; font-size: 40px; }
.topic__no { font-size: 16px; }
.topic__title { font-size: 27px; }
.topic__desc { font-size: 18px; color: #e4e0ff; }
.tag { font-size: 15px; padding: 3px 12px; }
.phase-label { font-size: 17px; margin-top: 8px; }
.level2 summary { font-size: 18.5px; }

/* ----- 작은 카드 ----- */
.card { padding: 22px; }
.card__icon { width: 58px; height: 58px; font-size: 30px; }
.card__title { font-size: 22px; }
.card--mini .card__title { font-size: 21px; }
.card__desc { font-size: 17.5px; color: #e4e0ff; }

/* ----- 프롬프트 상자 ----- */
.term__body { font-size: 18px; line-height: 1.85; max-height: 320px; }
.card--mini .term__body { max-height: 210px; }
.term__bar { font-size: 14px; }

/* ----- 복사 버튼 ----- */
.copy-btn { font-size: 22px; min-height: 64px; border-radius: 16px; }
.copy-btn__ico { width: 34px; height: 34px; font-size: 16px; }
.btn-ghost { font-size: 16.5px; min-height: 50px; }

/* ----- 나만의 게임 ----- */
.field span { font-size: 19px; }
.field input, .field textarea { font-size: 18px; }
.idea-chips { font-size: 17px; }
.chip--sm { font-size: 16px; min-height: 42px; }

/* ----- 기타 ----- */
.toast { font-size: 18.5px; }
.footer__big { font-size: 22px; }
.footer p { font-size: 17px; }
.totop { width: 74px; height: 74px; font-size: 16px; }
.xp__lv { font-size: 16px; }
.xp__name { font-size: 14px; }
.xp__num { font-size: 15px; }
.xp__num b { font-size: 19px; }

/* ----- 태블릿 ----- */
@media (max-width: 1024px) {
  .demo__box { grid-template-columns: 1fr; }
  .demo__arrow { flex-direction: row; gap: 10px; transform: rotate(90deg); justify-self: center; animation: none; }
}

/* ----- 스마트폰 ----- */
@media (max-width: 720px) {
  body { font-size: 17.5px; }
  .section { padding-top: 60px; }
  .section__head h2 { font-size: clamp(27px, 7.4vw, 34px); }
  .section__head p { font-size: 17.5px; }
  .hero__desc { font-size: 18px; }
  .btn-pixel { font-size: 18px; }
  .floaters span { font-size: 28px; }
  .ticker__track span { font-size: 17px; padding: 10px 24px; }
  .demo__box { padding: 16px; gap: 14px; }
  .demo__label { font-size: 18px; }
  .demo__type { font-size: 17px; min-height: 130px; }
  .demo__screen { min-height: 170px; }
  .questlist li { font-size: 17px; }
  .nav a { font-size: 15.5px; padding: 6px 12px; }
  .chip { font-size: 16px; }
  .topic { padding: 18px 16px; }
  .topic__icon { width: 60px; height: 60px; font-size: 32px; }
  .topic__title { font-size: 23px; }
  .topic__desc { font-size: 16.5px; }
  .card { padding: 18px 16px; }
  .card__title { font-size: 20px; }
  .term__body { font-size: 16.5px; max-height: 270px; }
  .copy-btn { font-size: 19.5px; min-height: 60px; }
  .step p, .rules li { font-size: 17px; }
  .field span { font-size: 17.5px; }
  .footer__big { font-size: 19px; }
  .totop { width: 64px; height: 64px; font-size: 14px; }
  .xp__lv { font-size: 14px; }
}
/* 기울어진 전광판·떠다니는 아이콘이 화면 옆으로 넘치지 않게 */
main { overflow-x: hidden; overflow-x: clip; }
@media (max-width: 720px) {
  .xp__num { display: none; }
  .xp__bar { width: 78px; }
  .floaters span { opacity: .3; }
  .floaters span:nth-child(2),
  .floaters span:nth-child(3),
  .floaters span:nth-child(5) { display: none; }
  .floaters span:nth-child(1) { left: 84%; top: 34%; }
}
@media (min-width: 721px) {
  .floaters span:nth-child(1) { left: -3%; top: 46%; }
}

/* =========================================================
   v7 · NEW 미션 표시
   ========================================================= */
.newbadge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  font-style: normal;
  font-family: var(--round);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 1px;
  color: #fff;
  background: var(--pink);
  border: 2px solid #000;
  border-radius: 6px;
  vertical-align: 2px;
  animation: newpulse 1.6s ease-in-out infinite;
}
@keyframes newpulse { 50% { transform: scale(1.1); filter: brightness(1.2); } }
.stagemap a.is-new::before {
  content: "NEW";
  position: absolute;
  top: -11px;
  left: 8px;
  padding: 1px 6px;
  font-family: var(--round);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: .5px;
  color: #fff;
  background: var(--pink);
  border: 2px solid #000;
  border-radius: 6px;
}
.chip--new { border-color: var(--pink); }
.chip--new.is-on { background: var(--pink); box-shadow: 0 4px 0 #a32566; }
