/* 닫기 — 가짜 웹페이지 클리커 스타일 */

.cl-root {
  position: relative;
  height: calc(100svh - var(--pium-header-h, 76px) - var(--pium-footer-h, 60px));
  overflow: hidden;
  font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', system-ui, sans-serif;
  color: #222;
  background: #e8eaf0;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

/* ── 가짜 블로그 (배경) — 정화될수록 선명해짐 (--clean 0~1) ── */
.cl-page {
  position: absolute; inset: 0;
  overflow: hidden;
  padding: 52px 16px 16px;
  filter: blur(calc((1 - var(--clean, 0)) * 2.5px)) grayscale(calc((1 - var(--clean, 0)) * 60%));
  opacity: calc(0.55 + var(--clean, 0) * 0.45);
  transition: filter 0.6s ease, opacity 0.6s ease;
}
.cl-blog {
  max-width: 520px; margin: 0 auto;
  background: #fff; border-radius: 10px;
  padding: 22px 20px 26px;
  box-shadow: 0 2px 14px rgba(20, 24, 60, 0.08);
}
.cl-blog-title { margin: 0 0 4px; font-size: 21px; }
.cl-blog-meta { margin: 0 0 16px; font-size: 12px; color: #99a; }
.cl-blog-p { margin: 0 0 12px; font-size: 14px; line-height: 1.7; color: #445; }
.cl-blog-bar {
  height: 12px; border-radius: 6px; background: #eef0f5; margin: 10px 0;
}
.cl-blog-bar:nth-child(2n) { width: 82%; }

/* ── HUD ── */
.cl-hud {
  position: absolute; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: rgba(20, 24, 44, 0.92);
  color: #fff;
}
.cl-hud-left { min-width: 92px; }
.cl-calm { font-size: 14px; font-weight: 700; }
.cl-combo { font-size: 11px; color: #ffd866; min-height: 14px; }
.cl-hud-mid { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.cl-gauge {
  height: 8px; border-radius: 4px; background: #333a5c; overflow: hidden;
}
.cl-gauge-fill {
  height: 100%; width: 0; border-radius: 4px;
  background: linear-gradient(90deg, #22d3ee, #a78bfa);
  transition: width 0.15s ease;
}
.cl-gauge-fill.full { animation: cl-gauge-blink 0.5s steps(2) infinite; }
@keyframes cl-gauge-blink { 50% { filter: brightness(1.8); } }
.cl-prog { position: relative; height: 14px; border-radius: 7px; background: #333a5c; overflow: hidden; }
.cl-prog-fill { height: 100%; width: 0; background: #34d399; transition: width 0.3s ease; }
.cl-prog-txt {
  position: absolute; inset: 0; font-size: 10px; line-height: 14px; text-align: center;
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.cl-shopbtn {
  font: inherit; font-size: 12px; font-weight: 700;
  color: #14182c; background: #ffd866;
  border: 0; border-radius: 8px; padding: 8px 10px;
  cursor: pointer; touch-action: manipulation;
}
.cl-shopbtn:active { filter: brightness(0.85); }

/* ── 팝업 ── */
.cl-field { position: absolute; inset: 0; z-index: 20; }
.cl-pop {
  position: absolute;
  background: #fff;
  border: 1px solid #c9cede;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(20, 24, 60, 0.25);
  overflow: visible;
}
.cl-pop-title {
  background: linear-gradient(#5b6cff, #4152e8);
  color: #fff; font-size: 12px; font-weight: 700;
  padding: 6px 30px 6px 10px;
  border-radius: 7px 7px 0 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cl-pop-body { padding: 12px 10px 14px; font-size: 12px; color: #556; }
.cl-pop-moving { animation: cl-drift alternate infinite ease-in-out; }
@keyframes cl-drift {
  from { transform: translateX(-26px); }
  to { transform: translateX(26px); }
}

/* 닫기 버튼 — 초반 손맛은 정조준 */
.cl-x {
  position: absolute; top: -10px; right: -10px;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #39406a; color: #fff;
  font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  touch-action: manipulation;
}
.cl-x:active { transform: scale(0.85); }
.cl-x.cl-x-left { right: auto; left: -10px; }
/* 돋보기 업그레이드 — 판정 확대 */
.cl-zoom .cl-x { width: 34px; height: 34px; font-size: 16px; }
/* 가짜 ✕ — 미묘하게 다름 (개발자 도구 설치 시 붉게 드러남) */
.cl-x-fake { background: #454a70; }
.reveal-fake .cl-x-fake {
  background: #b3223a;
  box-shadow: 0 0 0 2px rgba(255, 60, 60, 0.55), 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* 쿠키 배너 */
.cl-pop-cookie { border-radius: 10px; }
.cl-cookie-body { padding: 12px 34px 12px 12px; font-size: 11.5px; }
.cl-cookie-body strong { display: block; margin-bottom: 8px; font-size: 12px; color: #223; }
.cl-cookie-togs { display: flex; flex-wrap: wrap; gap: 6px; }
.cl-cookie-tog {
  width: 26px; height: 14px; border-radius: 7px; background: #cfd4e4; position: relative;
}
.cl-cookie-tog::after {
  content: ''; position: absolute; left: 1px; top: 1px;
  width: 12px; height: 12px; border-radius: 50%; background: #fff;
}

/* 파편/획득 연출 */
.cl-shard {
  position: absolute; width: 8px; height: 8px; z-index: 25;
  background: #fff; border: 1px solid #aab;
  pointer-events: none;
  animation: cl-shard 0.45s ease-out forwards;
}
@keyframes cl-shard {
  to { transform: translate(var(--dx), var(--dy)) rotate(220deg); opacity: 0; }
}
.cl-gain {
  position: absolute; z-index: 26; pointer-events: none;
  font-size: 14px; font-weight: 800; color: #16a34a;
  text-shadow: 0 1px 0 #fff;
  animation: cl-gain 0.65s ease-out forwards;
}
@keyframes cl-gain {
  to { transform: translateY(-34px); opacity: 0; }
}

/* ── 정화 모드 ── */
.cl-purging .cl-field { cursor: crosshair; }
.cl-purging::after {
  content: '';
  position: absolute; inset: 0; z-index: 15; pointer-events: none;
  box-shadow: inset 0 0 60px rgba(34, 211, 238, 0.55);
  animation: cl-purge-breathe 0.8s ease-in-out infinite alternate;
}
@keyframes cl-purge-breathe { to { box-shadow: inset 0 0 100px rgba(167, 139, 250, 0.6); } }
.cl-laser-dot {
  position: absolute; z-index: 24; pointer-events: none;
  width: 26px; height: 26px; border-radius: 50%;
  margin: -13px 0 0 -13px;
  background: radial-gradient(circle, rgba(34,211,238,0.9), rgba(167,139,250,0) 70%);
  animation: cl-dot 0.3s ease-out forwards;
}
@keyframes cl-dot { to { transform: scale(2.2); opacity: 0; } }

/* 퍼펙트 스킵 — 화면에 금 가는 프리즈 */
.cl-perfect::before {
  content: '';
  position: absolute; inset: 0; z-index: 40; pointer-events: none;
  background:
    linear-gradient(105deg, transparent 48%, rgba(255,255,255,0.9) 49%, transparent 51%),
    linear-gradient(15deg, transparent 46%, rgba(255,255,255,0.7) 50%, transparent 53%);
  animation: cl-flash 0.6s ease-out forwards;
}
@keyframes cl-flash { from { opacity: 1; } to { opacity: 0; } }

/* 흔들림 (가짜 ✕ 페널티) */
.cl-shake { animation: cl-shake 0.3s linear; }
@keyframes cl-shake {
  20% { transform: translate(-5px, 2px); }
  40% { transform: translate(4px, -3px); }
  60% { transform: translate(-3px, -2px); }
  80% { transform: translate(3px, 2px); }
}

/* ── 동영상 광고 보스 ── */
.cl-video {
  position: absolute; inset: 0; z-index: 35;
  background: rgba(8, 8, 16, 0.94);
  display: flex; align-items: center; justify-content: center;
}
.cl-video-box { text-align: center; color: #ccc; }
.cl-video-label {
  display: inline-block; font-size: 11px; letter-spacing: 2px;
  border: 1px solid #888; border-radius: 3px; padding: 2px 8px; margin-bottom: 14px;
  color: #aaa;
}
.cl-video-count { font-size: 64px; font-weight: 800; color: #fff; min-height: 76px; }
.cl-video-sub { font-size: 12px; color: #889; }
.cl-skip {
  position: absolute; right: 14px; bottom: 18px;
  font: inherit; font-size: 14px; font-weight: 700;
  background: #fff; color: #111; border: 0; border-radius: 4px;
  padding: 10px 14px; cursor: pointer; touch-action: manipulation;
  animation: cl-skip-in 0.12s ease-out;
}
@keyframes cl-skip-in { from { transform: translateY(8px); opacity: 0; } }

/* ── 오버레이 (타이틀/클리어/시트) ── */
.cl-overlay { position: absolute; inset: 0; z-index: 50; pointer-events: none; }
.cl-overlay > * { pointer-events: auto; }
.cl-title {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, #171a30, #0d0f20);
  display: flex; align-items: center; justify-content: center;
  color: #fff; text-align: center;
}
.cl-title-box { padding: 24px; max-width: 420px; }
.cl-title-tag { margin: 0 0 10px; font-size: 13px; color: #8b93b8; }
.cl-logo {
  margin: 0 0 14px; font-size: 64px; font-weight: 900; letter-spacing: 6px;
  background: linear-gradient(120deg, #22d3ee, #a78bfa, #f472b6);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cl-logo-clear { font-size: 42px; letter-spacing: 2px; }
.cl-title-sub { margin: 0 0 26px; font-size: 14px; line-height: 1.7; color: #aab2d4; white-space: pre-line; }
.cl-title-menu { display: flex; flex-direction: column; gap: 10px; max-width: 240px; margin: 0 auto; }
.cl-title-ver { margin: 22px 0 0; font-size: 11px; color: #565e84; letter-spacing: 1px; }

.cl-btn {
  font: inherit; font-size: 15px; font-weight: 700;
  color: #dfe3f5; background: #262c4e;
  border: 1px solid #3d4573; border-radius: 10px;
  padding: 11px 16px; cursor: pointer; touch-action: manipulation;
}
.cl-btn:active { filter: brightness(1.25); }
.cl-btn:disabled { opacity: 0.45; cursor: default; }
.cl-btn-primary { background: #ffd866; border-color: #ffd866; color: #14182c; }

/* 시트 (상점/도움말) */
.cl-sheet {
  position: absolute; inset: 0;
  background: rgba(8, 10, 22, 0.72);
  display: flex; align-items: flex-end; justify-content: center;
}
.cl-sheet-box {
  width: 100%; max-width: 480px; max-height: 76%;
  overflow-y: auto;
  background: #171a30; color: #e8ebfa;
  border-radius: 16px 16px 0 0;
  padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
}
.cl-sheet-title { margin: 0 0 4px; font-size: 17px; }
.cl-sheet-sub { margin: 0 0 14px; font-size: 12px; color: #9aa2c8; }
.cl-help-p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.6; color: #c6cce8; }
.cl-shop-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 2px; border-bottom: 1px solid #262c4e;
}
.cl-shop-row.owned { opacity: 0.55; }
.cl-shop-info { flex: 1; }
.cl-shop-name { font-size: 14.5px; font-weight: 700; }
.cl-shop-desc { font-size: 12px; color: #9aa2c8; margin-top: 2px; }
.cl-shop-row .cl-btn { font-size: 13px; padding: 8px 12px; min-width: 74px; }
.cl-sheet-box > .cl-btn-primary { width: 100%; margin-top: 14px; }

/* 토스트 */
.cl-toast {
  position: absolute; left: 50%; bottom: 18px; z-index: 60;
  transform: translate(-50%, 10px); opacity: 0;
  background: rgba(20, 24, 44, 0.95); color: #fff;
  border-radius: 10px; padding: 9px 16px; font-size: 13px;
  transition: transform 0.2s ease, opacity 0.2s ease;
  pointer-events: none; max-width: 86%;
  text-align: center;
}
.cl-toast.on { transform: translate(-50%, 0); opacity: 1; }
