/* ───────── 태블릿 UI: 상시 조작 버튼 · 미션 바 · 타일 · 게임 요소 ───────── */
body { padding-bottom: 96px; }
.wrap { max-width: 1080px; }

/* 상단 바 */
.topbar { gap: 10px; }
.me { max-width: 46%; }
.me-txt { display: grid; text-align: left; line-height: 1.2; min-width: 0; }
.me-txt b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-txt small { color: #FFC93C; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stamps { align-items: center; }
.live-pill { display: inline-flex; align-items: center; gap: 4px; background: #2EC4B6; color: #17223B; border-radius: 999px; padding: 3px 12px 3px 6px; font-size: 13px; font-weight: 800; margin-right: 6px; white-space: nowrap; }
.lp-ic { width: 26px; height: 26px; }
.live-pill b { font-size: 16px; animation: pulseScale 2s ease-in-out infinite; display: inline-block; }

/* 상시 조작 버튼 (반투명 유리) */
#dock { position: fixed; right: 12px; bottom: 96px; z-index: 45; display: grid; gap: 8px; }
.dk { width: 58px; height: 58px; border-radius: 18px; border: 1px solid #ffffff80; background: rgba(23, 34, 59, .42); backdrop-filter: blur(10px) saturate(1.4); -webkit-backdrop-filter: blur(10px) saturate(1.4); display: grid; place-items: center; align-content: center; gap: 0; cursor: pointer; color: #fff; box-shadow: 0 6px 18px #17223B33; opacity: .82; transition: opacity .2s, transform .15s, background .2s; padding: 4px 0 2px; }
.dk:hover, .dk:focus-visible { opacity: 1; transform: translateY(-2px); background: rgba(23, 34, 59, .7); }
.dk:active { transform: scale(.92); }
.dk-ic { width: 34px; height: 34px; filter: drop-shadow(0 2px 3px #0005); }
.dk span { font-size: 10px; font-weight: 800; letter-spacing: .02em; line-height: 1; }
.dk.on { background: rgba(184, 146, 255, .75); }

/* 하단 미션 바 */
#missionNav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 44; display: flex; gap: 6px; justify-content: center; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid #E3E7F0; overflow-x: auto; }
.navi { position: relative; flex: 0 0 auto; display: grid; justify-items: center; gap: 2px; min-width: 72px; padding: 6px 8px 4px; border-radius: 16px; text-decoration: none; color: var(--ink); font-size: 12px; font-weight: 800; border: 2px solid transparent; }
.nv-ic { width: 38px; height: 38px; transition: transform .2s; }
.navi:hover .nv-ic { transform: translateY(-3px) scale(1.08); }
.navi.here { background: color-mix(in srgb, var(--c) 25%, #fff); border-color: var(--c); }
.navi.now::after { content: "지금"; position: absolute; top: -6px; right: 2px; background: var(--coral); color: #fff; font-size: 10px; border-radius: 999px; padding: 1px 6px; animation: pulseScale 1.2s infinite; }
.navi.rest { min-width: 56px; opacity: .8; }
.nv-ok { position: absolute; top: 2px; left: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--mint); color: #fff; font-style: normal; font-size: 11px; display: grid; place-items: center; }
.navi.padlet { background: #E3F8F5; }

/* 홈 히어로: 레벨 · 반 에너지 */
.home-hero h1 { margin-bottom: 12px; }
.lvbox { display: flex; gap: 12px; align-items: center; background: #ffffff14; border-radius: 16px; padding: 10px 14px; max-width: 560px; }
.lvbox .lv-emo { font-size: 38px; }
.lvbox b { font-size: 18px; color: #fff; }
.lvbox small { color: #C9D6EE; }
.lvbox > div { flex: 1; }
.lvbox .progress { margin-top: 6px; }
.energy { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-top: 12px; max-width: 560px; font-weight: 800; color: #FFC93C; font-size: 14px; }
.en-ic { width: 24px; height: 24px; }
.ebar { height: 14px; background: #ffffff22; border-radius: 999px; overflow: hidden; }
.ebar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #FF6B6B, #FFC93C, #2EC4B6, #5AA9E6, #B892FF); background-size: 200% 100%; border-radius: 999px; transition: width .8s cubic-bezier(.2, .9, .3, 1.2); animation: shimmer 3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* 미션 타일 (한눈에) */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
@media (min-width: 1000px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { position: relative; display: grid; justify-items: center; text-align: center; gap: 4px; padding: 16px 12px 14px; border-radius: 22px; background: #fff; text-decoration: none; color: var(--ink); box-shadow: 0 4px 14px #17223B14; border: 3px solid transparent; overflow: hidden; }
.tile::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 46%; background: color-mix(in srgb, var(--c) 22%, #fff); z-index: 0; }
.tile > * { position: relative; z-index: 1; }
.tile:hover { transform: translateY(-4px); box-shadow: 0 10px 24px #17223B22; }
.tile:active { transform: scale(.97); }
.t-no { font-size: 11px; font-weight: 900; letter-spacing: .08em; color: color-mix(in srgb, var(--c) 70%, #17223B); }
.t-ic { width: 86px; height: 86px; filter: drop-shadow(0 6px 8px #17223B26); transition: transform .3s; }
.tile:hover .t-ic { transform: scale(1.1) rotate(-4deg); }
.t-title { font-size: 19px; line-height: 1.25; }
.t-sub { font-size: 14px; color: var(--muted); }
.t-tool { font-size: 12px; font-weight: 800; background: #F3F5FA; border-radius: 999px; padding: 2px 10px; }
.t-live { font-size: 13px; font-weight: 700; color: #12907F; }
.tile.done { border-color: var(--mint); }
.tile.done::after { content: "CLEAR"; position: absolute; top: 12px; right: -30px; transform: rotate(35deg); background: var(--mint); color: #fff; font-size: 11px; font-weight: 900; padding: 2px 34px; z-index: 2; }
.tile.now { border-color: var(--c); animation: glow 1.6s ease-in-out infinite; box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 30%, transparent); }
.now-tag { position: absolute !important; top: 10px; left: 10px; background: var(--coral); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 900; padding: 2px 10px; animation: pulseScale 1.2s infinite; }
.tile.rest { opacity: .85; }
.tile.rest .t-ic { width: 64px; height: 64px; }
.padlet-tile::before { background: #DDF7F3; }

/* 순위 */
.rank { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.rank li { display: grid; grid-template-columns: 36px 30px 1fr auto; gap: 8px; align-items: center; background: #F3F5FA; border-radius: 12px; padding: 6px 12px; font-weight: 700; }
.rank li.me { background: #FFF3CF; outline: 2px solid var(--yellow); }
.rank .rk { font-size: 20px; text-align: center; }
.rank em { font-style: normal; color: var(--muted); font-size: 14px; }
.rank.big li { font-size: 18px; }

/* 미션 머리: 실시간 해결 인원 */
.mh-live { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; background: #ffffff1f; border-radius: 999px; padding: 3px 12px 3px 6px; font-weight: 700; color: #fff; }
.mhl-ic { width: 24px; height: 24px; }
.mh-live b { color: #FFC93C; }

/* 게임 상자 공통 */
.game-box { border: 3px solid #17223B10; }
.gb-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.gb-head h3 { margin: 0; }
.score { display: inline-flex; align-items: center; gap: 4px; background: var(--navy); color: #FFC93C; font-weight: 900; border-radius: 999px; padding: 4px 14px 4px 6px; font-size: 18px; }
.sc-ic { width: 26px; height: 26px; }
.ready { padding: 10px 0; }
.ready .btn { min-width: 240px; }
.quiz-card { background: linear-gradient(135deg, #FFF8DC, #FFE8E8); border: 2px solid #FFC93C; }
.small { font-size: 14px; }

/* 제한시간 링 */
.clock { position: relative; width: 52px; height: 52px; display: grid; place-items: center; }
.clock svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.clock circle { fill: none; stroke-width: 4; }
.clock circle:first-child { stroke: #EEF1F6; }
.clock #ring { stroke: var(--sky); stroke-dasharray: 94.2; stroke-dashoffset: 0; stroke-linecap: round; transition: stroke-dashoffset .1s linear; }
.clock b { font-size: 18px; position: relative; }
.clock.hurry #ring { stroke: var(--coral); }
.clock.hurry b { color: var(--coral); animation: bump .5s infinite; }

/* 탐정 목숨 */
.lives { display: inline-flex; gap: 2px; }
.life-ic { width: 32px; height: 32px; transition: transform .3s, filter .3s; }
.lives .lost .life-ic { filter: grayscale(1) opacity(.35); transform: scale(.8); }

/* 결과 카드 · 등급 */
.result-card { text-align: center; display: grid; justify-items: center; gap: 6px; padding: 10px 0; }
.result-card h2 { margin: 4px 0; }
.grade { width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; font-size: 64px; font-weight: 900; color: #fff; box-shadow: 0 8px 24px #17223B33; animation: slam .6s cubic-bezier(.2, .9, .3, 1.4) both; }
.g-S { background: linear-gradient(135deg, #FFC93C, #FF6B6B); }
.g-A { background: linear-gradient(135deg, #2EC4B6, #5AA9E6); }
.g-B { background: linear-gradient(135deg, #5AA9E6, #B892FF); }
.g-C { background: #8A94A8; }

/* AI 화가 결과 공개 */
.painter .compare { align-items: stretch; }
.painter .vs { display: grid; align-content: start; gap: 6px; }
.reveal-btn { border: 3px dashed #C3CBDA; background: #fff; border-radius: 16px; aspect-ratio: 1; width: 100%; font-size: 20px; font-weight: 800; cursor: pointer; color: var(--muted); }
.reveal-btn:hover { border-color: var(--navy); color: var(--navy); }
.ai-paint { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 1; box-shadow: 0 6px 18px #17223B33; }
.ai-paint img { width: 100%; height: 100%; object-fit: cover; display: block; animation: paintIn 1.2s ease both; }
.ai-paint .brush { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 40%, #fff 50%, transparent 60%); background-size: 300% 100%; animation: sweep 1.2s ease both; pointer-events: none; }
@keyframes paintIn { 0% { filter: blur(18px) saturate(0); clip-path: inset(0 100% 0 0); } 60% { clip-path: inset(0 0 0 0); } 100% { filter: none; } }
@keyframes sweep { from { background-position: 150% 0; } to { background-position: -50% 0; } }

/* 캔바 미션 */
.canva-start { display: grid; gap: 12px; }
.my-order { background: #F7F3FF; border-radius: 14px; padding: 12px; display: grid; gap: 6px; }
.my-order small { font-weight: 800; color: #7B5BD6; }
.qbar.big { height: 14px; margin: 4px 0 12px; }
.qbar.big i { background: linear-gradient(90deg, #B892FF, #5AA9E6); }
.padlet-cta { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #E3F8F5, #FFF8DC); border: 3px solid var(--mint); font-size: 17px; }
.padlet-cta > span:nth-child(2) { flex: 1; }
.row3 .link { width: auto; }

/* 점수 떠오르기 · 레벨업 */
.xp-float { position: fixed; z-index: 90; transform: translate(-50%, 0); font-weight: 900; font-size: 24px; color: #FFC93C; -webkit-text-stroke: 1.5px #17223B; pointer-events: none; animation: xpUp 1.3s ease-out forwards; }
@keyframes xpUp { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -10px) scale(1.2); } 100% { opacity: 0; transform: translate(-50%, -90px) scale(1); } }
.slam.lvl { --c: #FFC93C; background: radial-gradient(circle, #fff 60%, #FFF3CF); }
.slam.lvl .lv-emo { font-size: 64px; line-height: 1; }

/* 태블릿 세로·휴대폰 */
@media (max-width: 760px) {
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .t-ic { width: 66px; height: 66px; }
  .t-title { font-size: 17px; }
}
@media (max-width: 560px) {
  .live-pill { padding: 2px 8px 2px 4px; font-size: 11px; margin-right: 2px; }
  .lp-ic { width: 20px; height: 20px; }
  .live-pill b { font-size: 13px; }
  .me-txt small { display: none; }
  #dock { right: 6px; bottom: 88px; gap: 6px; }
  .dk { width: 46px; height: 46px; border-radius: 14px; }
  .dk-ic { width: 26px; height: 26px; }
  .dk span { display: none; }
  .navi { min-width: 58px; padding: 4px; font-size: 10px; }
  .nv-ic { width: 30px; height: 30px; }
  .painter .compare { grid-template-columns: 1fr 1fr; }
}

/* ── 생각 시간 · 읽는 시간 · 통과 조건 · 잠금 ── */
.think { position: relative; height: 34px; border-radius: 999px; background: #EEF1F6; overflow: hidden; margin: 6px 0 8px; display: grid; place-items: center; }
.think i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #CADCFC, #5AA9E6); animation: thinkFill linear forwards; }
.think span { position: relative; font-weight: 800; font-size: 15px; color: var(--navy); }
@keyframes thinkFill { to { width: 100%; } }
.btn.thinking { opacity: .45; filter: grayscale(.4); }
.btn.reading { background: #EEF1F6 !important; border-color: #EEF1F6 !important; color: var(--muted) !important; }
.goal { text-align: center; font-weight: 800; color: #7B5BD6; background: #F7F3FF; border-radius: 14px; padding: 10px 14px; }
.goal-card h3 { margin-bottom: 6px; }
.goals { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.goals li { background: #F3F5FA; border-radius: 12px; padding: 8px 12px; font-weight: 700; }
.goals li.ok { background: #E3F8F5; color: #12907F; }
.goal-card .btn.big { width: 100%; }
.goal-card .btn:disabled { opacity: .5; }
.tile.locked, .navi.locked { filter: grayscale(.9); opacity: .55; }
.tile.locked::after { content: "🔒"; position: absolute; top: 10px; right: 12px; font-size: 22px; z-index: 2; }
.steps li.next label { outline: 3px solid var(--purple); }
.steps input:disabled + b { opacity: .55; }
.wait-hint { grid-column: 2; font-style: normal; font-size: 14px; font-weight: 800; color: #7B5BD6; }

/* 접속 순서 번호 */
.my-no { display: inline-grid; place-items: center; min-width: 46px; height: 40px; padding: 0 8px; border-radius: 12px; background: #FFC93C; color: #17223B; font-size: 22px; font-weight: 900; margin-right: 4px; line-height: 1; }
.my-no small { font-size: 11px; }
.no-badge { display: inline-block; background: #FFC93C; color: #17223B; border-radius: 14px; padding: 0 12px; }
.sandbox-cta { display: flex; gap: 14px; align-items: center; background: #F7F3FF; border: 3px solid #B892FF; }
.sb-no { flex: none; width: 90px; height: 90px; border-radius: 22px; background: #17223B; color: #FFC93C; display: grid; place-items: center; align-content: center; font-size: 40px; font-weight: 900; line-height: 1; }
.sb-no small { font-size: 14px; color: #fff; }
.sandbox-cta .btn { margin-top: 8px; }
.mem-no { min-width: 26px; height: 26px; border-radius: 8px; background: #17223B; color: #FFC93C; display: grid; place-items: center; font-size: 13px; }
