/* apps/brick/style.css — 벽돌깨기: 네온 레트로 오락실 (짙은 남보라 밤 + 격자 바닥 + 빛나는 분홍·하늘·노랑).
 * 모바일 한 줄(--app-width 480px). 글꼴은 언어 파일 fonts → :root 변수(--font-display 등, 생성기가 이 파일 뒤에 둔다).
 * 클래스 앞머리는 tf-(공통 컴포넌트의 mg- 와 겹치지 않게). 공통 타이틀 바(G.topBar)·끝 화면(data-mg-end)은 --mg-* 변수로만 색을 맞춘다.
 * 판(벽돌·공·패들)은 캔버스에 brick.js 가 그린다 — 색은 여기 변수와 같은 값을 brick.js 의 COLORS 에 둔다.
 */
:root {
  --bg-0: #07061a;
  --bg-1: #120a33;
  --bg-2: #1d1150;
  --pink: #ff3ea5;
  --cyan: #2de2e6;
  --yellow: #ffd319;
  --lime: #8bff5a;
  --orange: #ff8a3d;
  --violet: #9b5cff;
  --danger: #ff4d6d;
  --ink: #f4f0ff;
  --ink-dim: rgba(244, 240, 255, 0.8);
  --ink-faint: rgba(244, 240, 255, 0.56);
  --dark: #0b0820;
  --card: rgba(255, 255, 255, 0.06);
  --line: rgba(45, 226, 230, 0.45);

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

  /* 공통 타이틀 바 · 언어 선택 */
  --mg-top-fg: var(--ink);
  --mg-top-badge-bg: var(--pink);
  --mg-top-badge-fg: #fff;
  --lang-bg: rgba(244, 240, 255, 0.08);
  --lang-fg: var(--ink);
  --lang-border: rgba(45, 226, 230, 0.5);
  /* 공통 끝 화면 (짙은 바탕 위에서 읽히게 밝은 글자·옅은 테두리) */
  --mg-star-on: var(--yellow);
  --mg-star-off: rgba(244, 240, 255, 0.22);
  --mg-heart-bg: rgba(255, 62, 165, 0.12);
  --mg-heart-border: rgba(255, 62, 165, 0.5);
  --mg-heart-fg: #ff8fcb;
  --mg-heart-on: var(--pink);
  --mg-share-bg: rgba(244, 240, 255, 0.07);
  --mg-share-border: rgba(244, 240, 255, 0.18);
  --mg-share-primary-bg: var(--cyan);
  --mg-share-primary-fg: var(--dark);
  --mg-x: var(--ink);
  --mg-tiktok: var(--ink);
  --mg-faq-bg: rgba(244, 240, 255, 0.05);
  --mg-faq-border: rgba(45, 226, 230, 0.3);
  --mg-end-retry-bg: var(--pink);
  --mg-end-retry-fg: #fff;
  --toast-bg: rgba(29, 17, 80, 0.97);
}

html { background: var(--bg-0); }
body.tf-body {
  min-height: 100vh;
  background:
    linear-gradient(rgba(155, 92, 255, 0.07) 1px, transparent 1px) 0 0 / 100% 28px,
    linear-gradient(90deg, rgba(155, 92, 255, 0.07) 1px, transparent 1px) 0 0 / 28px 100%,
    radial-gradient(ellipse 120% 60% at 50% -10%, var(--bg-2), var(--bg-1) 50%, var(--bg-0) 85%) fixed;
  background-color: var(--bg-0);
  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) 규칙보다 뒤에서 다시 지정 */
.tf-h1, .tf-kicker, .tf-h1-main, .tf-h1-main em, .tf-badge, .tf-btn, .tf-how-txt,
.tf-hud-label, .tf-msg-text,
.tf-eyebrow, .tf-tier, .tf-points, .tf-newbest, .tf-stat dt, .tf-doc h1 {
  font-family: var(--font-display);
}
/* 숫자는 본문 글꼴 굵게 (Audiowide 의 0 은 Ø 처럼 보인다) */
.tf-hud-val, .tf-score-big, .tf-stat-num, .tf-top, .tf-best { font-family: var(--font-sans); font-weight: 800; }

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

.tf-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-height: 58px;
  padding: 12px 18px;
  border: 2px solid #fff; border-radius: 14px;
  font-size: 19px; font-weight: var(--display-weight);
  line-height: 1.25; letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.tf-btn-primary {
  background: var(--pink); color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 62, 165, 0.35), 0 0 24px rgba(255, 62, 165, 0.6), 0 5px 0 #a3196a;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}
.tf-btn-primary:active { transform: translateY(4px); box-shadow: 0 0 0 3px rgba(255, 62, 165, 0.35), 0 0 14px rgba(255, 62, 165, 0.5), 0 1px 0 #a3196a; }
.tf-btn:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

/* ---------------- 시작 화면 (티징 + 짧은 방법) ---------------- */
.tf-start { text-align: center; padding-top: 14px; }
.tf-badge {
  display: inline-block; margin: 0 0 10px;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(45, 226, 230, 0.1); color: var(--cyan);
  border: 1.5px solid rgba(45, 226, 230, 0.55);
  box-shadow: 0 0 12px rgba(45, 226, 230, 0.25);
  font-size: 13px; line-height: 1.35;
}
.tf-hero {
  position: relative; height: 150px; margin: 0 auto 4px; width: 264px;
  border-radius: 14px; border: 2px solid rgba(155, 92, 255, 0.55);
  background: linear-gradient(180deg, rgba(29, 17, 80, 0.9), rgba(7, 6, 26, 0.95));
  box-shadow: 0 0 22px rgba(155, 92, 255, 0.35), inset 0 0 24px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.tf-hero-bricks { position: absolute; left: 10px; right: 10px; top: 12px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.tf-hbk { display: block; height: 11px; border-radius: 3px; }
.tf-c1 { background: var(--pink); box-shadow: 0 0 8px var(--pink); }
.tf-c2 { background: var(--orange); box-shadow: 0 0 8px var(--orange); }
.tf-c3 { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.tf-c4 { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.tf-hbk-gone { visibility: hidden; }
.tf-hero-ball {
  position: absolute; left: 0; top: 0; width: 10px; height: 10px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 10px #fff, 0 0 18px var(--cyan);
  animation: tf-ball 2.4s linear infinite;
}
@keyframes tf-ball {
  0% { transform: translate(122px, 116px); }
  25% { transform: translate(230px, 70px); }
  50% { transform: translate(150px, 66px); }
  75% { transform: translate(30px, 100px); }
  100% { transform: translate(122px, 116px); }
}
.tf-hero-paddle {
  position: absolute; left: 0; bottom: 14px; width: 58px; height: 8px; border-radius: 4px;
  background: var(--cyan); box-shadow: 0 0 12px var(--cyan);
  animation: tf-paddle 2.4s ease-in-out infinite;
}
@keyframes tf-paddle { 0%, 100% { transform: translateX(98px); } 40% { transform: translateX(170px); } 75% { transform: translateX(14px); } }

.tf-h1 { margin: 12px 0 10px; line-height: 1.15; font-weight: var(--display-weight); }
.tf-kicker {
  display: inline-block; max-width: 100%; margin-bottom: 10px; padding: 3px 12px;
  background: var(--yellow); color: var(--dark); border-radius: 6px;
  font-size: 15px; line-height: 1.35; letter-spacing: 0.02em; transform: rotate(-1.5deg);
  box-shadow: 0 0 14px rgba(255, 211, 25, 0.5);
}
.tf-h1-main {
  display: block; font-size: 30px; color: var(--ink); overflow-wrap: break-word;
  text-shadow: 0 0 10px rgba(155, 92, 255, 0.8), 0 3px 0 rgba(0, 0, 0, 0.5);
}
.tf-h1-main em { font-style: normal; color: var(--pink); text-shadow: 0 0 12px rgba(255, 62, 165, 0.9), 0 3px 0 rgba(0, 0, 0, 0.5); }
.tf-hook { margin: 0 auto 16px; max-width: 390px; font-size: 16px; color: var(--ink-dim); }
.tf-how {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin: 0 0 18px; padding: 0; list-style: none;
}
.tf-how li {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0;
  padding: 10px 6px; border-radius: 12px;
  background: var(--card); border: 1.5px solid rgba(155, 92, 255, 0.35);
}
.tf-how-ico { font-size: 24px; line-height: 1; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.tf-how-txt { font-size: 12.5px; line-height: 1.3; color: var(--ink); overflow-wrap: break-word; max-width: 100%; }
.tf-facts { margin: 14px 0 0; font-size: 13px; color: var(--ink-faint); letter-spacing: 0.02em; }

/* ---------------- 게임 화면 ---------------- */
.tf-play { padding-top: 4px; }
.tf-hud { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 auto 8px; max-width: 448px; }
.tf-hud-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0;
  padding: 4px 8px 5px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); border: 1.5px solid rgba(155, 92, 255, 0.4);
}
.tf-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; max-width: 100%; }
.tf-hud-val { font-size: 22px; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf-hud-score .tf-hud-val { color: var(--cyan); text-shadow: 0 0 10px rgba(45, 226, 230, 0.6); }
.tf-hud-stage .tf-hud-val { color: var(--yellow); text-shadow: 0 0 10px rgba(255, 211, 25, 0.5); }
.tf-hud-lives .tf-hud-val { color: var(--pink); text-shadow: 0 0 10px rgba(255, 62, 165, 0.6); letter-spacing: 0.08em; }

/* 판: 360×520 비율, 화면 높이에 맞춰 줄어든다 (타이틀 바·HUD 를 뺀 높이) */
.tf-field {
  position: relative; margin: 0 auto;
  width: min(100%, 448px, calc((100vh - 150px) * 360 / 520));
  width: min(100%, 448px, calc((100dvh - 150px) * 360 / 520));
  min-width: 240px;
  aspect-ratio: 360 / 520;
  border-radius: 14px; overflow: hidden;
  border: 2px solid rgba(45, 226, 230, 0.6);
  box-shadow: 0 0 0 1px rgba(155, 92, 255, 0.5), 0 0 26px rgba(45, 226, 230, 0.28), 0 14px 34px rgba(0, 0, 0, 0.5);
  background: var(--dark);
}
.tf-canvas {
  display: block; width: 100%; height: 100%;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
  cursor: none;
}
.tf-msg {
  position: absolute; left: 0; right: 0; top: 56%; z-index: 2; display: flex; justify-content: center;
  padding: 0 16px; pointer-events: none;
}
.tf-msg-text {
  margin: 0; padding: 6px 16px; border-radius: 10px; max-width: 100%; text-align: center;
  font-size: 20px; line-height: 1.3; color: #fff;
  background: rgba(11, 8, 32, 0.78); border: 1.5px solid var(--pink);
  box-shadow: 0 0 16px rgba(255, 62, 165, 0.5);
  animation: tf-blink 1.2s ease-in-out infinite;
}
.tf-msg-big .tf-msg-text { font-size: 28px; border-color: var(--yellow); box-shadow: 0 0 18px rgba(255, 211, 25, 0.55); animation: none; }
@keyframes tf-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ---------------- 끝 화면: 점수·등급 카드 ---------------- */
.tf-end { padding-top: 10px; }
.tf-result {
  position: relative; margin: 0 0 22px; padding: 20px 16px 18px; text-align: center;
  border-radius: 20px; border: 2px solid var(--line);
  background: linear-gradient(170deg, rgba(29, 17, 80, 0.95), rgba(7, 6, 26, 0.97));
  box-shadow: 0 0 24px rgba(45, 226, 230, 0.2), 0 14px 34px rgba(0, 0, 0, 0.4);
}
.tf-eyebrow {
  display: inline-block; max-width: 100%; margin: 0 0 8px; padding: 4px 14px; border-radius: 999px;
  background: var(--pink); color: #fff; font-size: 15px; line-height: 1.35;
  box-shadow: 0 0 14px rgba(255, 62, 165, 0.55);
}
.tf-tier-line { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0 0; line-height: 1.2; }
.tf-tier-emoji { font-size: 40px; line-height: 1; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.tf-tier { min-width: 0; font-size: 23px; line-height: 1.25; color: var(--yellow); overflow-wrap: break-word; text-shadow: 0 0 12px rgba(255, 211, 25, 0.55); }
.tf-score-line { margin: 10px 0 0; line-height: 1; }
.tf-score-big { font-size: 60px; line-height: 1.05; color: var(--cyan); font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgba(45, 226, 230, 0.7); }
.tf-points { font-size: 18px; color: var(--ink-dim); }
.tf-newbest {
  display: inline-block; margin: 10px 0 0; padding: 3px 12px; border-radius: 8px;
  background: var(--lime); color: var(--dark); font-size: 15px; line-height: 1.35; transform: rotate(-2deg);
}
.tf-best { margin: 8px 0 0; font-size: 15px; color: var(--ink-dim); }
.tf-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0 0; }
.tf-stat { min-width: 0; padding: 10px 6px; border-radius: 12px; background: var(--card); border: 1.5px solid rgba(155, 92, 255, 0.35); }
.tf-stat dt { font-size: 12.5px; line-height: 1.3; color: var(--ink-faint); overflow-wrap: break-word; }
.tf-stat dd { margin: 6px 0 0; }
.tf-stat-num { font-size: 28px; line-height: 1.4; color: var(--ink); font-variant-numeric: tabular-nums; }
.tf-rank { margin: 14px 0 0; padding: 12px 10px; border-radius: 12px; background: rgba(45, 226, 230, 0.07); border: 1.5px dashed rgba(45, 226, 230, 0.45); }
.tf-comparing { margin: 0; font-size: 14px; color: var(--ink-faint); }
.tf-top { margin: 0; font-size: 28px; line-height: 1.2; color: var(--cyan); }
.tf-beat { margin: 4px 0 0; font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--ink); }
.tf-others { margin: 2px 0 0; font-size: 13px; line-height: 1.4; color: var(--ink-faint); }

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

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

/* ---------------- 움직임 줄이기 ---------------- */
@media (prefers-reduced-motion: reduce) {
  .tf-hero-ball, .tf-hero-paddle, .tf-msg-text { animation: none; }
  .tf-hero-ball { transform: translate(122px, 100px); }
  .tf-hero-paddle { transform: translateX(103px); }
  .tf-btn { transition: none; }
}
@media (max-width: 359px) {
  .tf-h1-main { font-size: 26px; }
  .tf-hud-val { font-size: 19px; }
}
