/* apps/candy-catch/style.css — 할로윈 사탕 받기: 한밤 남색 동네 하늘 + 슬라임 라임 + 사탕 분홍 + 호박 주황, 두툼한 아케이드 글꼴.
 * 모바일 한 줄(--app-width 480px). 글꼴은 언어 파일 fonts → :root 변수(--font-display 등, 생성기가 이 파일 뒤에 둔다).
 * 공통 타이틀 바(G.topBar)·끝 화면(data-mg-end)은 --mg-* 변수로만 색을 맞춘다.
 */
:root {
  --night-0: #0a0d24;
  --night-1: #131a45;
  --night-2: #25306e;
  --slime: #b8ff5c;
  --slime-2: #86e02a;
  --candy: #ff5fa2;
  --candy-2: #ff8cc0;
  --pumpkin: #ff8a1f;
  --moon: #fff4c7;
  --ink: #fff6ea;
  --ink-dim: rgba(255, 246, 234, 0.78);
  --ink-faint: rgba(255, 246, 234, 0.5);
  --dark: #1b1026;
  --card: rgba(255, 255, 255, 0.07);
  --line: rgba(184, 255, 92, 0.35);

  --font-display: 'Lilita One', var(--font-sans);
  --display-weight: 400;
  --wb: normal;
  --hyphens: manual;

  /* 공통 타이틀 바 · 언어 선택 */
  --mg-top-fg: var(--ink);
  --mg-top-badge-bg: var(--slime);
  --mg-top-badge-fg: var(--dark);
  --lang-bg: rgba(255, 246, 234, 0.08);
  --lang-fg: var(--ink);
  --lang-border: rgba(184, 255, 92, 0.4);
  /* 공통 끝 화면 */
  --mg-star-on: #ffd23f;
  --mg-star-off: rgba(255, 246, 234, 0.2);
  --mg-heart-bg: rgba(255, 95, 162, 0.1);
  --mg-heart-border: rgba(255, 95, 162, 0.45);
  --mg-heart-fg: var(--candy-2);
  --mg-heart-on: var(--candy);
  --mg-share-bg: rgba(255, 246, 234, 0.06);
  --mg-share-border: rgba(255, 246, 234, 0.16);
  --mg-x: var(--ink);
  --mg-tiktok: var(--ink);
  --mg-faq-bg: rgba(255, 246, 234, 0.05);
  --mg-faq-border: rgba(184, 255, 92, 0.24);
  --mg-end-retry-bg: var(--slime);
  --mg-end-retry-fg: var(--dark);
  --toast-bg: rgba(37, 48, 110, 0.97);
}

html { background: var(--night-0); }
body.cc-body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 120% 60% at 50% -12%, var(--night-2), var(--night-1) 48%, var(--night-0) 82%) fixed;
  color: var(--ink);
  line-height: 1.6;
  word-break: var(--wb);
  hyphens: var(--hyphens);
  -webkit-hyphens: var(--hyphens);
}
[hidden] { display: none !important; }

/* 제목·버튼 글꼴: base.css 의 :lang(zh|th|vi) 규칙보다 뒤에서 다시 지정 */
.cc-h1, .cc-kicker, .cc-h1-main, .cc-h1-main em, .cc-badge, .cc-btn, .cc-how-txt, .cc-facts,
.cc-hud-label, .cc-hud-val, .cc-combo, .cc-count-num, .cc-paused-title,
.cc-eyebrow, .cc-score-big, .cc-points, .cc-newbest, .cc-best, .cc-stat dt, .cc-stat dd, .cc-top, .cc-doc h1 {
  font-family: var(--font-display);
}

/* ---------------- 공통 레이아웃 ---------------- */
.cc-shell { max-width: var(--app-width); margin: 0 auto; padding: 8px 16px 0; }
.cc-screen { padding-top: 12px; }

.cc-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-height: 58px;
  padding: 12px 18px;
  border: 3px solid var(--dark); border-radius: 18px;
  font-size: 20px; font-weight: var(--display-weight);
  line-height: 1.25; letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.cc-btn-primary { background: var(--slime); color: var(--dark); box-shadow: 0 5px 0 var(--slime-2), 0 10px 26px rgba(184, 255, 92, 0.25); }
.cc-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--slime-2); }
.cc-field:focus-visible { outline: none; border-color: rgba(255, 95, 162, 0.7); }
.cc-btn:focus-visible, .cc-pause:focus-visible { outline: 3px solid var(--candy); outline-offset: 3px; }
.cc-btn-sm { width: auto; min-height: 50px; padding: 10px 28px; font-size: 18px; }

/* ---------------- 시작 화면 (티징 + 짧은 방법) ---------------- */
.cc-start { text-align: center; padding-top: 14px; }
.cc-badge {
  display: inline-block; margin: 0 0 10px;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 95, 162, 0.16); color: var(--candy-2);
  border: 1.5px solid rgba(255, 95, 162, 0.5);
  font-size: 13px; line-height: 1.35;
}
.cc-hero { position: relative; height: 150px; margin: 0 auto 4px; max-width: 300px; }
.cc-hero-moon {
  position: absolute; right: 22px; top: 6px; width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffbe6, var(--moon) 55%, #f2d98a);
  box-shadow: 0 0 30px rgba(255, 244, 199, 0.45);
}
.cc-hero-bucket { position: absolute; left: 50%; bottom: 0; width: 118px; height: auto; margin-left: -59px; filter: drop-shadow(0 6px 14px rgba(255, 138, 31, 0.35)); }
.cc-hero-drop {
  position: absolute; top: 0; font-size: 34px; line-height: 1;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  animation: cc-drop 2.4s ease-in infinite;
}
.cc-hero-drop.is-1 { left: 22%; animation-delay: 0s; }
.cc-hero-drop.is-2 { left: 47%; animation-delay: -0.8s; }
.cc-hero-drop.is-3 { left: 68%; animation-delay: -1.6s; }
@keyframes cc-drop {
  0% { transform: translateY(-6px) rotate(-10deg); opacity: 0; }
  12% { opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translateY(78px) rotate(20deg); opacity: 0; }
}
.cc-h1 { margin: 12px 0 10px; line-height: 1.15; font-weight: var(--display-weight); }
.cc-kicker {
  display: inline-block; max-width: 100%; margin-bottom: 10px; padding: 3px 12px;
  background: var(--pumpkin); color: var(--dark); border-radius: 8px;
  font-size: 15px; line-height: 1.35; letter-spacing: 0.02em; transform: rotate(-1.5deg);
}
.cc-h1-main { display: block; font-size: 34px; color: var(--ink); overflow-wrap: break-word; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); }
.cc-h1-main em { font-style: normal; color: var(--slime); }
.cc-hook { margin: 0 auto 16px; max-width: 380px; font-size: 16px; color: var(--ink-dim); }
.cc-how {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin: 0 0 18px; padding: 0; list-style: none;
}
.cc-how li {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0;
  padding: 10px 6px; border-radius: 14px;
  background: var(--card); border: 1.5px solid rgba(255, 246, 234, 0.12);
}
.cc-how-ico { font-size: 24px; line-height: 1; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.cc-how-txt { font-size: 13.5px; line-height: 1.25; color: var(--ink); overflow-wrap: break-word; max-width: 100%; }
.cc-facts { margin: 14px 0 0; font-size: 13px; color: var(--ink-faint); letter-spacing: 0.02em; }

/* ---------------- 게임 화면 ---------------- */
.cc-play { padding-top: 6px; }
.cc-hud {
  display: grid; grid-template-columns: 1.25fr 1fr 1fr auto; gap: 6px; align-items: stretch;
  margin: 0 auto 8px;
}
.cc-hud-box {
  position: relative; display: flex; flex-direction: column; justify-content: center; min-width: 0;
  padding: 4px 8px 5px; border-radius: 12px; background: rgba(255, 255, 255, 0.07); border: 1.5px solid rgba(255, 246, 234, 0.12);
}
.cc-hud-label { font-size: 11px; line-height: 1.2; letter-spacing: 0.06em; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-hud-val { font-size: 22px; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.cc-hud-score .cc-hud-val { color: var(--slime); }
.cc-hud-time.is-low .cc-hud-val { color: var(--candy); }
.cc-timebar { display: block; height: 4px; margin-top: 3px; border-radius: 999px; background: rgba(255, 246, 234, 0.14); overflow: hidden; }
.cc-timebar-fill { display: block; height: 100%; background: var(--pumpkin); transform-origin: left center; }
.cc-hud-time.is-low .cc-timebar-fill { background: var(--candy); }
.cc-hud-hearts { display: flex; gap: 2px; height: 24px; align-items: center; }
.cc-heart svg { display: block; width: 20px; height: 18px; fill: var(--candy); }
.cc-heart.is-off svg { fill: rgba(255, 246, 234, 0.16); }
.cc-pause {
  display: grid; place-items: center; width: 44px; min-height: 44px; padding: 0;
  border-radius: 12px; border: 1.5px solid rgba(255, 246, 234, 0.2); background: rgba(255, 255, 255, 0.07); cursor: pointer;
}
.cc-pause span { display: block; width: 14px; height: 16px; border-left: 5px solid var(--ink); border-right: 5px solid var(--ink); }

.cc-field {
  position: relative; margin: 0 auto; width: 100%; aspect-ratio: 2 / 3; max-width: 448px;
  border-radius: 20px; overflow: hidden; outline: none;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
  border: 2px solid rgba(184, 255, 92, 0.28);
  background:
    radial-gradient(circle at 82% 11%, rgba(255, 244, 199, 0.95) 0 5.5%, rgba(255, 244, 199, 0.18) 6.5%, transparent 14%),
    radial-gradient(1.5px 1.5px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 36% 9%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 58% 22%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 24% 36%, rgba(255,255,255,0.8) 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 40%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 90% 30%, rgba(255,255,255,0.7) 50%, transparent 51%),
    linear-gradient(to top, #07091b 0 7%, transparent 7.2%),
    linear-gradient(180deg, #1a2160 0%, #121848 55%, #0c1033 100%);
  box-shadow: inset 0 -40px 60px rgba(134, 224, 42, 0.07), 0 12px 32px rgba(0, 0, 0, 0.35);
}
.cc-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; cursor: none; }
.cc-combo {
  position: absolute; left: 50%; top: 10px; margin: 0; transform: translateX(-50%);
  padding: 3px 14px; border-radius: 999px; white-space: nowrap;
  background: var(--candy); color: #fff; border: 2px solid var(--dark);
  font-size: 18px; line-height: 1.3; pointer-events: none;
  opacity: 0; transition: opacity 0.2s ease;
}
.cc-combo.is-on { opacity: 1; }
.cc-combo[data-mult="3"] { background: var(--pumpkin); color: var(--dark); }
.cc-combo[data-mult="4"] { background: var(--slime); color: var(--dark); }
.cc-combo.is-bump { animation: cc-bump 0.35s ease; }
@keyframes cc-bump { 0% { transform: translateX(-50%) scale(1); } 40% { transform: translateX(-50%) scale(1.25); } 100% { transform: translateX(-50%) scale(1); } }
.cc-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  text-align: center; padding: 16px;
}
.cc-count { background: rgba(10, 13, 36, 0.28); pointer-events: none; }
.cc-count-num { font-size: 88px; line-height: 1; color: var(--slime); text-shadow: 0 5px 0 var(--dark), 0 0 30px rgba(184, 255, 92, 0.5); }
.cc-count-num.is-go { font-size: 52px; color: var(--candy-2); }
.cc-count-num.is-pop { animation: cc-pop 0.5s ease-out; }
@keyframes cc-pop { 0% { transform: scale(1.6); opacity: 0; } 60% { transform: scale(0.95); opacity: 1; } 100% { transform: scale(1); } }
.cc-paused { background: rgba(10, 13, 36, 0.72); }
.cc-paused-title { margin: 0; font-size: 34px; line-height: 1.2; color: var(--ink); }

/* ---------------- 끝 화면: 점수 카드 ---------------- */
.cc-end { padding-top: 10px; }
.cc-result {
  position: relative; margin: 0 0 22px; padding: 20px 16px 18px; text-align: center;
  border-radius: 24px; border: 2px solid var(--line);
  background: linear-gradient(170deg, rgba(37, 48, 110, 0.9), rgba(19, 26, 69, 0.95));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}
.cc-eyebrow {
  display: inline-block; max-width: 100%; margin: 0 0 6px; padding: 4px 14px; border-radius: 999px;
  background: var(--pumpkin); color: var(--dark); font-size: 16px; line-height: 1.35;
}
.cc-eyebrow[data-reason="lives"] { background: var(--candy); color: #fff; }
.cc-score-line { margin: 4px 0 0; line-height: 1; }
.cc-score-big { font-size: 68px; line-height: 1.05; color: var(--slime); font-variant-numeric: tabular-nums; text-shadow: 0 4px 0 var(--dark); }
.cc-points { font-size: 20px; color: var(--ink-dim); }
.cc-newbest {
  display: inline-block; margin: 10px 0 0; padding: 3px 12px; border-radius: 8px;
  background: var(--slime); color: var(--dark); font-size: 16px; line-height: 1.35; transform: rotate(-2deg);
}
.cc-best { margin: 8px 0 0; font-size: 16px; color: var(--ink-dim); }
.cc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0 0; }
.cc-stat { min-width: 0; padding: 10px 6px; border-radius: 14px; background: var(--card); border: 1.5px solid rgba(255, 246, 234, 0.12); }
.cc-stat dt { font-size: 13px; line-height: 1.3; color: var(--ink-faint); overflow-wrap: break-word; }
.cc-stat dd { margin: 2px 0 0; font-size: 26px; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; }
.cc-rank { margin: 14px 0 0; padding: 12px 10px; border-radius: 14px; background: rgba(184, 255, 92, 0.08); border: 1.5px dashed rgba(184, 255, 92, 0.4); }
.cc-comparing { margin: 0; font-size: 14px; color: var(--ink-faint); }
.cc-top { margin: 0; font-size: 30px; line-height: 1.2; color: var(--slime); }
.cc-beat { margin: 4px 0 0; font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--ink); }
.cc-others { margin: 2px 0 0; font-size: 13px; line-height: 1.4; color: var(--ink-faint); }

/* ---------------- 언어별 ---------------- */
html:lang(th) .cc-h1-main, html:lang(th) .cc-kicker, html:lang(th) .cc-how-txt, html:lang(th) .cc-btn, html:lang(th) .cc-hook { line-height: 1.55; letter-spacing: 0; }
html:lang(th) .cc-hud-label, html:lang(th) .cc-stat dt { line-height: 1.5; letter-spacing: 0; }
html:lang(vi) .cc-h1-main, html:lang(vi) .cc-kicker { line-height: 1.3; }
html:lang(ja) .cc-h1-main, html:lang(zh) .cc-h1-main, html:lang(ko) .cc-h1-main { font-size: 32px; line-height: 1.25; }
html:lang(ja) .cc-how-txt, html:lang(zh) .cc-how-txt, html:lang(ko) .cc-how-txt { font-size: 13px; }
html:lang(ru) .cc-h1-main, html:lang(vi) .cc-h1-main { font-size: 31px; }
html:lang(ru) .cc-hud-label { letter-spacing: 0.02em; }

/* ---------------- 개인정보처리방침 ---------------- */
.cc-doc { padding: 16px 0 8px; }
.cc-doc h1 { font-size: 28px; line-height: 1.25; margin: 8px 0 14px; }
.cc-doc h2 { font-size: 17px; margin: 22px 0 6px; color: var(--slime); }
.cc-doc p { color: var(--ink-dim); font-size: 15px; }
.cc-doc a, .site-footer a { color: var(--candy-2); }

/* ---------------- 움직임 줄이기 ---------------- */
@media (prefers-reduced-motion: reduce) {
  .cc-hero-drop { animation: none; top: 30px; }
  .cc-hero-drop.is-2 { top: 10px; }
  .cc-combo.is-bump, .cc-count-num.is-pop { animation: none; }
  .cc-btn { transition: none; }
}
@media (max-width: 359px) {
  .cc-h1-main { font-size: 29px; }
  .cc-hud-val { font-size: 19px; }
}
