/* ───────── 아이콘 · 애니메이션 · 재미 요소 ───────── */
.ic { display: inline-block; width: 1.4em; height: 1.4em; object-fit: contain; vertical-align: middle; user-select: none; -webkit-user-drag: none; }
.ic.emo { font-size: 1.1em; line-height: 1.4em; text-align: center; font-style: normal; }
.me-av { width: 34px; height: 34px; }
.me { padding: 4px 14px 4px 6px; }
.mute { border: 0; background: var(--navy2); color: #fff; border-radius: 50%; width: 32px; height: 32px; cursor: pointer; margin-left: 4px; font-size: 15px; }
.h-ic { width: 34px; height: 34px; margin: -6px 4px 0 0; }
.btn-ic { width: 30px; height: 30px; margin: -4px 2px; }
.inline-ic { width: 22px; height: 22px; margin-top: -3px; }
.chip-ic, .nt-ic { width: 24px; height: 24px; margin: -3px 0; }
.who-ic { width: 22px; height: 22px; }
.why-ic { width: 40px; height: 40px; flex: none; }
.why p { display: flex; gap: 10px; align-items: center; }
.tip-ic { width: 46px; height: 46px; flex: none; }
.card.tip { display: flex; gap: 12px; align-items: center; }
.state-ic { width: 30px; height: 30px; }
.gl-ic { width: 54px; height: 54px; flex: none; }
.gallery-link { display: flex; align-items: center; gap: 12px; }
.gallery-link > span:nth-child(2) { flex: 1; }
.res-ic { width: 70px; height: 70px; }
.res-big { width: 110px; height: 110px; display: block; margin: 0 auto 6px; }
.big-num { font-size: 1.5em; font-weight: 800; color: var(--navy); }
.avatar.mini { width: 26px; height: 26px; }
.who-av { display: inline-flex; align-items: center; gap: 4px; }

/* 히어로 마스코트 */
.hero { padding-right: 140px; }
.hero > * { position: relative; z-index: 1; }
.hero-mascot { position: absolute !important; right: 14px; bottom: 10px; width: 120px; height: 120px; filter: drop-shadow(0 8px 14px #0006); }
.hero-mascot.sm { width: 96px; height: 96px; }
.hero-mascot.emo { font-size: 80px; width: auto; height: auto; line-height: 1; }
.progress { height: 10px; background: #ffffff22; border-radius: 999px; overflow: hidden; margin-top: 12px; max-width: 420px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--yellow), var(--mint)); border-radius: 999px; transition: width .6s cubic-bezier(.2, .9, .3, 1.4); }

/* 탐험 지도 카드 */
.mcard .badge { position: relative; width: 62px; height: 62px; background: color-mix(in srgb, var(--c) 28%, #fff); border: 3px solid var(--c); }
.mcard .badge .mic { width: 50px; height: 50px; }
.mcard .badge em { position: absolute; right: -6px; bottom: -6px; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; font-style: normal; font-size: 13px; display: grid; place-items: center; border: 2px solid #fff; }
.map::before { left: 47px; }
.mcard:hover .mic { animation: wiggle .5s ease-in-out; }
.mcard.done .badge { background: color-mix(in srgb, var(--c) 45%, #fff); }
.mcard.rest .badge { width: 46px; height: 46px; margin-left: 8px; border-width: 2px; }
.mcard.rest .badge .mic { width: 36px; height: 36px; }
.mcard.rest .badge em { display: none; }

/* 미션 머리 */
.mhead { position: relative; overflow: hidden; }
.mhead > * { position: relative; z-index: 1; }
.mh-ic { width: 92px; height: 92px; flex: none; filter: drop-shadow(0 6px 10px #0005); }
.mhead::after { content: ""; position: absolute; right: -60px; bottom: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c) 45%, transparent), transparent 70%); }

/* 입장 */
.av { padding: 4px; display: grid; place-items: center; animation: popIn .4s calc(var(--i) * 30ms) both cubic-bezier(.2, .9, .3, 1.5); }
.av .ic { width: 100%; height: 100%; }
.av .ic.emo { font-size: 30px; }
.av.on { animation: none; transform: scale(1.12) rotate(-4deg); box-shadow: 0 6px 14px #17223B33; }
.dice.roll { animation: roll .5s ease-out; }
.go .btn-ic { animation: float 1.6s ease-in-out infinite; }
.pick-ic { width: 90px; height: 90px; }

/* 퀴즈 */
.qtop { display: flex; justify-content: space-between; align-items: center; }
.streak { background: #FFE8E8; color: #D9480F; font-weight: 800; border-radius: 999px; padding: 2px 12px; animation: pulseScale 1s ease-in-out infinite; }
.qbar { height: 8px; background: #EEF1F6; border-radius: 999px; overflow: hidden; margin: 6px 0 4px; }
.qbar i { display: block; height: 100%; background: var(--sky); border-radius: 999px; transition: width .4s; }
.ox-o:not(:disabled):hover { border-color: var(--mint); }
.ox-x:not(:disabled):hover { border-color: var(--coral); }

/* AI 그림 탐정 */
.ai-img { position: relative; border-radius: 18px; overflow: hidden; background: #EEF1F6; max-width: 420px; justify-self: center; width: 100%; aspect-ratio: 1; }
.ai-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ai-img .scan { position: absolute; left: 0; right: 0; height: 30%; top: -30%; background: linear-gradient(180deg, transparent, #5AA9E655, transparent); animation: scan 2.4s linear infinite; pointer-events: none; }
.ai-img.reveal .scan { display: none; }
.ai-img.reveal { box-shadow: 0 0 0 5px var(--coral); }
.ai-img .noimg { font-size: 40px; }

/* 쉬는 시간 */
.rest-ic { width: 140px; height: 140px; display: block; margin: 0 auto 8px; }
.breathe { display: grid; place-items: center; gap: 10px; margin-top: 20px; }
.breathe i { width: 80px; height: 80px; border-radius: 50%; background: radial-gradient(circle, var(--mint), #2EC4B655); animation: breathe 8s ease-in-out infinite; }
.breathe span { color: var(--muted); font-weight: 700; }

/* 캔바 능력치 */
.stats { display: grid; gap: 8px; margin-bottom: 12px; background: #F7F3FF; border-radius: 14px; padding: 12px; }
.stat { display: grid; grid-template-columns: 80px 1fr 90px; align-items: center; gap: 10px; font-weight: 700; }
.stat input { min-height: 0; padding: 0; border: 0; accent-color: var(--purple); margin: 0; }
.stat b { color: #D9A400; letter-spacing: 1px; }
.gstats { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; color: #B07F00; font-weight: 700; }
.noimg-ic { width: 90px; height: 90px; }

/* 배지 잠금 */
.locked { position: relative; width: 160px; margin: 16px auto; }
.lock-medal { width: 160px; height: 160px; filter: grayscale(1) opacity(.45); }
.locked span { position: absolute; right: 10px; bottom: 10px; font-size: 40px; animation: wiggle 2s ease-in-out infinite; }
.badge-in { animation: badgeIn .9s cubic-bezier(.2, .9, .3, 1.4) both; }

/* 도장 쾅! */
.stamp-slam { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; pointer-events: none; background: #17223B55; animation: fadeOut 1.9s ease forwards; }
.slam { display: grid; place-items: center; align-content: center; gap: 2px; width: 240px; height: 240px; border-radius: 50%; background: #fff; border: 10px solid var(--c); box-shadow: 0 0 0 10px #fff, 0 20px 50px #0007; animation: slam .55s cubic-bezier(.2, .9, .3, 1.4) both; transform: rotate(-12deg); }
.slam-ic { width: 96px; height: 96px; }
.slam b { font-size: 20px; color: var(--navy); line-height: 1.1; }
.slam span { font-size: 34px; font-weight: 900; color: var(--c); -webkit-text-stroke: 1.5px var(--navy); letter-spacing: .04em; line-height: 1.1; }

/* 공지·하트·대기 점 */
.announce { display: flex; align-items: center; justify-content: center; gap: 8px; }
.announce[hidden] { display: none; }
.ann-ic { width: 30px; height: 30px; }
.float-heart { position: fixed; z-index: 75; font-size: 22px; pointer-events: none; animation: heartUp 1.3s ease-out forwards; }
.wait { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: dot 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
#lv.bump { animation: bump .45s ease; display: inline-block; }

/* 공통 모션 */
.page-in { animation: pageIn .35s ease both; }
.pop-in { animation: popIn .45s calc(var(--i, 0) * 60ms) both cubic-bezier(.2, .9, .3, 1.4); }
.slide-in { animation: slideIn .35s ease both; }
.drop-in { animation: dropIn .6s cubic-bezier(.2, .9, .3, 1.4) both; }
.float { animation: float 3s ease-in-out infinite; }
.pulse { animation: pulseScale 1.6s ease-in-out infinite; }
.bounce { animation: bounce .5s ease; }
.shake { animation: shake .45s ease; }
.wiggle-hover:hover { animation: wiggle .5s ease-in-out; }
.btn, .chip, .cheer, .av, .heart { transition: transform .12s, background .2s, border-color .2s, box-shadow .2s; }
.btn:hover:not(:disabled), .chip:hover, .cheer:hover { transform: translateY(-2px); }
.chip.on { animation: bounce .35s ease; }

@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes popIn { from { opacity: 0; transform: scale(.6) translateY(16px); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-40px) rotate(-6deg) scale(.8); } }
@keyframes float { 50% { transform: translateY(-10px) rotate(2deg); } }
@keyframes pulseScale { 50% { transform: scale(1.04); } }
@keyframes bounce { 30% { transform: scale(1.15); } 60% { transform: scale(.95); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes wiggle { 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }
@keyframes roll { to { transform: rotate(720deg); } }
@keyframes bump { 40% { transform: scale(1.5); color: var(--coral); } }
@keyframes scan { to { top: 100%; } }
@keyframes breathe { 0%, 100% { transform: scale(.6); } 50% { transform: scale(1.25); } }
@keyframes slam { 0% { transform: scale(3) rotate(-12deg); opacity: 0; } 60% { transform: scale(.9) rotate(-12deg); opacity: 1; } 100% { transform: scale(1) rotate(-12deg); } }
@keyframes fadeOut { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes heartUp { to { transform: translateY(-120px) scale(1.6); opacity: 0; } }
@keyframes dot { 50% { transform: translateY(-6px); background: var(--sky); } }
@keyframes badgeIn { from { transform: rotateY(90deg) scale(.6); opacity: 0; } }

@media (max-width: 560px) {
  .hero { padding-right: 24px; padding-bottom: 96px; }
  .hero-mascot { width: 86px; height: 86px; }
  .hero-mascot.sm { width: 72px; height: 72px; }
  .mh-ic { width: 64px; height: 64px; }
  .stat { grid-template-columns: 70px 1fr 70px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.topbar[hidden] { display: none; }

/* tpicks 교실 게임 */
.game-card { display: flex; gap: 14px; align-items: center; background: linear-gradient(135deg, #FFF8DC, #EDE4FF); border: 2px dashed #B892FF; }
.game-card small { font-weight: 800; color: #7B5BD6; }
.game-card h3 { margin: 2px 0; }
.game-card p { margin: 2px 0; }
.game-ic { width: 72px; height: 72px; flex: none; }
.game-hint { font-size: 15px; }
#gameFab { position: fixed; right: 12px; top: 62px; z-index: 40; display: flex; align-items: center; gap: 10px; background: var(--navy); color: #fff; text-decoration: none; border-radius: 999px; padding: 8px 20px 8px 10px; box-shadow: 0 10px 30px #17223B66; border: 3px solid var(--yellow); animation: pulseScale 1.4s ease-in-out infinite; }
#gameFab small { display: block; color: var(--yellow); font-weight: 800; font-size: 12px; }
#gameFab b { font-size: 17px; }
.fab-ic { width: 46px; height: 46px; }

@media (max-width: 560px) {
  .topbar { padding: 6px 10px; gap: 6px; }
  .me { max-width: 42%; padding: 3px 10px 3px 4px; font-size: 14px; }
  .me-av { width: 28px; height: 28px; }
  .stamps { gap: 3px; flex: none; }
  .stamp { width: 21px; height: 21px; font-size: 11px; }
  .mute { width: 26px; height: 26px; font-size: 13px; margin-left: 2px; }
  #gameFab { top: auto; bottom: 12px; right: 10px; padding: 6px 14px 6px 6px; }
  #gameFab b { font-size: 15px; }
  .fab-ic { width: 36px; height: 36px; }
  .game-card { flex-direction: column; align-items: flex-start; }
  .game-ic { width: 56px; height: 56px; }
}
@media (max-width: 560px) { .result-prompt { position: static; } }

/* 미리와 우리 반의 일주일 */
.miri { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: 16px; align-items: start; border: 3px solid #FFC93C; background: linear-gradient(160deg, #FFFDF5, #FFF3D6); }
.miri-thumb { position: relative; display: block; border-radius: 16px; overflow: hidden; aspect-ratio: 1200/630; background: #F3E7C9; box-shadow: 0 6px 18px #17223B22; }
.miri-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.miri-thumb:hover img { transform: scale(1.05); }
.miri-thumb.noimg img { display: none; }
.miri-thumb .play { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; background: #17223BCC; color: #FFC93C; display: grid; place-items: center; font-size: 28px; animation: pulseScale 1.6s ease-in-out infinite; }
.miri-body small { font-weight: 800; color: #B07F00; }
.miri-body h3 { font-size: 22px; margin: 2px 0 4px; }
.miri-how { margin: 6px 0 10px; padding-left: 20px; font-size: 15px; }
.days { display: grid; gap: 8px; margin-bottom: 12px; }
.day { display: grid; grid-template-columns: 26px auto 1fr; grid-template-rows: auto auto; gap: 0 8px; align-items: center; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; cursor: pointer; }
.day input { width: 22px; height: 22px; min-height: 0; grid-row: span 2; accent-color: var(--mint); margin: 0; }
.day b { color: var(--navy); }
.day em { grid-column: 2 / 4; font-style: normal; color: var(--muted); font-size: 14px; }
.day.ok { background: #E3F8F5; border-color: var(--mint); }
.miri .btn.big { width: 100%; }
@media (max-width: 640px) { .miri { grid-template-columns: 1fr; } }
