/* ═══════════════════════════════════════════════════════════════
   천하논전 (天下論戰) — Premium Theme v2
   Design language: 墨色 (Ink Dark) · 金 (Gold accent) · 朱 (Crimson action)
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. 디자인 토큰 ─────────────────────────────────────────── */
:root {
  /* Background layers (warm ink tones) */
  --bg-0:         #09080600;  /* transparent base */
  --bg-base:      #0e0c08;
  --bg-surface:   #161310;
  --bg-card:      #1e1a12;
  --bg-raised:    #262018;
  --bg-input:     #1a1710;

  /* Gold (金) — used sparingly for premium / important */
  --gold:         #c8914a;
  --gold-light:   #e6c072;
  --gold-dim:     rgba(200,145,74,0.12);
  --gold-border:  rgba(200,145,74,0.35);

  /* Crimson (朱) — action / penalty */
  --crimson:      #7a2828;
  --crimson-mid:  #9a3838;
  --crimson-light:#c04848;
  --crimson-dim:  rgba(155,56,56,0.15);

  /* Ink Blue (墨靑) — opponent / boss */
  --ink-blue:     #1e3a5a;
  --ink-blue-mid: #2d5278;
  --ink-blue-light:#4a82b8;
  --ink-blue-dim: rgba(45,82,120,0.15);

  /* Text */
  --text-bright:  #f0e2c8;
  --text-main:    #dfd0b4;
  --text-sub:     #a89470;
  --text-muted:   #6e5e48;
  --text-dim:     #3e3428;

  /* Borders */
  --border:       #2a2218;
  --border-mid:   #3a3020;
  --border-bright:#524030;

  /* HP */
  --hp-green:     #3d8c52;
  --hp-yellow:    #b88c20;
  --hp-red:       #8b2424;

  /* Typography */
  --font-serif:   'Noto Serif KR', 'Nanum Myeongjo', Georgia, serif;
  --font-sans:    'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;

  /* Spacing unit */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Transition */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── 2. 리셋 & 기반 ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font-family: inherit; border: none; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* 스크롤바 */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 2px; }

/* ── 3. 화면 레이아웃 ──────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding:
    env(safe-area-inset-top, 0px)
    env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);
}
.screen.hidden  { display: none; }
.screen.active  { display: flex; }

/* 중앙 정렬 컨테이너 */
.screen-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-6);
  gap: var(--space-4);
}

/* 헤더 영역 (뒤로가기 + 타이틀) */
.screen-header {
  padding: var(--space-4) var(--space-5) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* 페이지 타이틀 */
.screen-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-align: center;
  padding: var(--space-3) 0 var(--space-4);
}

/* ── 4. 타이틀 화면 ─────────────────────────────────────────── */

/* 그림의 어두운 중앙 공간을 타이틀 무대로 활용.
   좌우 사상가가 콘텐츠를 자연스럽게 에워싸는 구도. */
#screen-title {
  background:
    /* 상하 페이드 — 그림 끝이 잘리지 않도록 */
    linear-gradient(to bottom,
      rgba(14,12,8,0.75)  0%,
      rgba(14,12,8,0.10)  14%,
      rgba(14,12,8,0.0)   28%,
      rgba(14,12,8,0.0)   68%,
      rgba(14,12,8,0.65)  82%,
      #0e0c08             100%
    ),
    /* 주변 비네팅 — 사상가 윤곽 선명하게, 중앙 어둠 유지 */
    radial-gradient(ellipse 70% 60% at 50% 48%,
      rgba(14,12,8,0.0)  0%,
      rgba(14,12,8,0.45) 100%
    ),
    url('/images/main-background.png') center 20% / cover no-repeat;
  overflow: hidden;
  justify-content: center;
  align-items: center;
}

/* 중앙 타이틀 카드 — 어두운 공간 위에 floating */
.title-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-5);
  text-align: center;
  width: 100%;
  /* 사상가 배치 고려해 살짝 위로 */
  margin-top: -6vh;
}

.title-seal {
  width: 60px;
  height: 60px;
  border: 1.5px solid rgba(200,145,74,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 900;
  color: var(--gold);
  position: relative;
  animation: seal-glow 3.5s ease-in-out infinite;
  margin-bottom: var(--space-1);
}

/* 인장 꼭짓점 장식 */
.title-seal::before,
.title-seal::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: rgba(200,145,74,0.4);
  border-style: solid;
}
.title-seal::before { top: -5px; left: -5px; border-width: 1.5px 0 0 1.5px; }
.title-seal::after  { bottom: -5px; right: -5px; border-width: 0 1.5px 1.5px 0; }

@keyframes seal-glow {
  0%, 100% {
    box-shadow: 0 0 16px rgba(200,145,74,0.12), inset 0 0 16px rgba(200,145,74,0.05);
    border-color: rgba(200,145,74,0.6);
  }
  50% {
    box-shadow: 0 0 36px rgba(200,145,74,0.32), inset 0 0 28px rgba(200,145,74,0.12);
    border-color: rgba(200,145,74,0.95);
  }
}

.title-main {
  font-family: var(--font-serif);
  font-size: 3.4rem;
  font-weight: 900;
  color: var(--gold-light);
  letter-spacing: 0.06em;
  line-height: 1.05;
  text-shadow:
    0 0 50px rgba(200,145,74,0.55),
    0 2px 12px rgba(200,145,74,0.3),
    0 0 2px rgba(0,0,0,0.9);
}

.title-sub {
  font-family: var(--font-serif);
  font-size: 0.7rem;
  color: rgba(200,145,74,0.6);
  letter-spacing: 0.55em;
  text-shadow: 0 0 16px rgba(200,145,74,0.35);
}

/* 타이틀과 설명 사이 금선 구분자 */
.title-rule {
  width: 56px;
  height: 1px;
  background: linear-gradient(to right,
    transparent,
    rgba(200,145,74,0.6),
    transparent
  );
  margin: var(--space-2) 0;
}

.title-desc {
  font-size: 0.82rem;
  color: var(--text-sub);
  line-height: 2;
  letter-spacing: 0.04em;
}

.title-start-btn {
  min-height: 52px;
  min-width: 200px;
  padding: 0.9rem 2.6rem;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold-light);
  background: rgba(14,12,8,0.55);
  border: 1.5px solid rgba(200,145,74,0.6);
  border-radius: 2px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.22s, border-color 0.22s, box-shadow 0.22s, color 0.22s;
  animation: btn-pulse 3.5s ease-in-out infinite;
  margin-top: var(--space-3);
  user-select: none;
}
.title-start-btn:hover {
  background: rgba(200,145,74,0.16);
  border-color: var(--gold);
  box-shadow: 0 0 36px rgba(200,145,74,0.28);
  color: #f5d898;
  animation: none;
}

@keyframes btn-pulse {
  0%, 100% { box-shadow: 0 0 16px rgba(200,145,74,0.06); border-color: rgba(200,145,74,0.55); }
  50%       { box-shadow: 0 0 32px rgba(200,145,74,0.22); border-color: rgba(200,145,74,0.85); }
}

/* ── 5. 버튼 시스템 ─────────────────────────────────────────── */

/* 공통 버튼 기반 */
.btn-base {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 1.6rem;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    background 0.18s,
    border-color 0.18s,
    color 0.18s,
    box-shadow 0.18s;
  border-radius: 2px;
  white-space: nowrap;
  user-select: none;
}
.btn-base:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* Primary — 朱 (주홍, 핵심 행동) */
.btn-primary {
  min-height: 44px;
  padding: 0.65rem 2rem;
  background: var(--crimson);
  color: var(--text-bright);
  border: 1px solid var(--crimson-mid);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
  min-width: 160px;
  user-select: none;
}
.btn-primary:hover {
  background: var(--crimson-mid);
  border-color: var(--crimson-light);
  box-shadow: 0 0 16px rgba(155,56,56,0.4);
}
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

/* Gold primary — 논전 시작 같은 핵심 CTA */
.btn-gold {
  min-height: 44px;
  padding: 0.65rem 2rem;
  background: transparent;
  color: var(--gold-light);
  border: 1px solid var(--gold);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.18s, box-shadow 0.18s;
  min-width: 160px;
}
.btn-gold:hover {
  background: var(--gold-dim);
  box-shadow: 0 0 16px rgba(200,145,74,0.25);
}

/* Secondary — 아웃라인 */
.btn-secondary {
  min-height: 44px;
  padding: 0.6rem 1.5rem;
  background: transparent;
  color: var(--text-sub);
  border: 1px solid var(--border-mid);
  font-family: var(--font-serif);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  border-radius: 2px;
  transition: border-color 0.18s, color 0.18s;
}
.btn-secondary:hover { border-color: var(--border-bright); color: var(--text-main); }

/* Ghost — 텍스트에 가까운 버튼 */
.btn-ghost {
  min-height: 44px;
  padding: 0.65rem 1rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-serif);
  font-size: 0.88rem;
  cursor: pointer;
  border-radius: 2px;
  width: 100%;
  transition: border-color 0.18s, color 0.18s;
}
.btn-ghost:hover { border-color: var(--border-mid); color: var(--text-sub); }

/* Back — 뒤로가기 */
.btn-back {
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  cursor: pointer;
  letter-spacing: 0.02em;
  align-self: flex-start;
  transition: color 0.15s;
}
.btn-back:hover { color: var(--text-sub); }

/* ── 6. 카드 공통 시스템 ──────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  transition: border-color 0.2s, transform 0.15s;
}
.card-interactive { cursor: pointer; }
.card-interactive:hover { border-color: var(--border-bright); }
.card-interactive:hover.card-highlight { border-color: var(--gold); }
.card-selected { border-color: var(--gold) !important; background: var(--bg-raised); }

/* 카드 내부 패딩 */
.card-body  { padding: var(--space-5); }
.card-body-sm { padding: var(--space-4); }

/* 카드 레이블 (상단 소형 텍스트) */
.card-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--font-sans);
  margin-bottom: var(--space-2);
}

/* ── 7. 메인 메뉴 ──────────────────────────────────────────── */
.menu-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  max-width: 300px;
}

.menu-item {
  min-height: 52px;
  padding: 0.85rem 1.5rem;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left;
  border-radius: 2px;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
  letter-spacing: 0.03em;
  position: relative;
}
.menu-item::after {
  content: '›';
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: right 0.18s, color 0.18s;
}
.menu-item:hover {
  border-color: var(--gold-border);
  background: var(--bg-raised);
  color: var(--gold-light);
}
.menu-item:hover::after { right: 1rem; color: var(--gold); }

/* 플랜 토글 (dev mock) */
.plan-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding: var(--space-3) var(--space-4);
  border: 1px dashed var(--border-mid);
  border-radius: 3px;
  background: var(--bg-surface);
  width: 100%;
  max-width: 300px;
}
.plan-badge-text {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  flex: 1;
  font-family: var(--font-sans);
}
.plan-free { color: var(--text-muted); }
.plan-paid { color: var(--gold); }

.btn-plan-toggle {
  background: none;
  border: 1px solid var(--border-mid);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  padding: var(--space-1) var(--space-3);
  cursor: pointer;
  border-radius: 2px;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-plan-toggle:hover { border-color: var(--gold-border); color: var(--gold); }

.dev-plan-wrap { margin-top: 8px; text-align: center; }
.btn-dev-plan {
  font-size: 11px; padding: 4px 12px; border-radius: 4px;
  background: #2a2a2a; color: #aaa; border: 1px dashed #555;
  cursor: pointer;
}
.btn-dev-plan:hover { background: #333; color: #fff; }

/* ── 8. 난이도 선택 ──────────────────────────────────────── */
.difficulty-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.difficulty-card {
  padding: var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  border-radius: 3px;
  transition: border-color 0.2s, background 0.18s, transform 0.15s;
}
.difficulty-card:hover {
  border-color: var(--gold-border);
  background: var(--bg-raised);
  transform: translateY(-1px);
}
.difficulty-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  width: 2.5rem;
  text-align: center;
  margin-top: 2px;
}
.difficulty-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
}
.difficulty-label {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
}
.difficulty-target {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-sans);
}
.difficulty-desc {
  font-size: 0.82rem;
  color: var(--text-sub);
  line-height: 1.6;
  margin-top: var(--space-1);
  font-family: var(--font-sans);
}

/* ── 9. 논제 선택 ────────────────────────────────────────── */
.topic-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}

.topic-card {
  padding: var(--space-4) var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  border-radius: 3px;
  transition: border-color 0.2s, background 0.18s, transform 0.15s;
}
.topic-card:hover:not(.topic-locked) {
  border-color: var(--gold-border);
  background: var(--bg-raised);
  transform: translateY(-1px);
}
.topic-locked { opacity: 0.45; cursor: not-allowed; }

.topic-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.topic-category {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  font-family: var(--font-sans);
  text-transform: uppercase;
}
.topic-title {
  font-family: var(--font-serif);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.45;
}
.topic-conflict {
  font-size: 0.75rem;
  color: var(--crimson-light);
  font-family: var(--font-sans);
  letter-spacing: 0.03em;
}
.topic-desc {
  font-size: 0.8rem;
  color: var(--text-sub);
  line-height: 1.6;
  font-family: var(--font-sans);
}

/* 잠금 / 유료 배지 */
.topic-lock-badge {
  font-size: 0.65rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-mid);
  padding: 2px 7px;
  border-radius: 2px;
  font-family: var(--font-sans);
  white-space: nowrap;
}
.topic-paid-badge {
  font-size: 0.65rem;
  color: var(--gold);
  border: 1px solid var(--gold-border);
  padding: 2px 7px;
  border-radius: 2px;
  font-family: var(--font-sans);
  white-space: nowrap;
}

/* 자유 토론 카드 */
.topic-card-free {
  border-color: var(--gold-border);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(200,145,74,0.06) 100%);
}
.topic-card-free:hover {
  border-color: var(--gold);
  background: linear-gradient(135deg, var(--bg-raised) 0%, rgba(200,145,74,0.10) 100%);
}
.topic-free-badge {
  font-size: 0.65rem;
  color: var(--gold);
  border: 1px solid var(--gold-border);
  padding: 2px 7px;
  border-radius: 2px;
  font-family: var(--font-serif);
  white-space: nowrap;
  letter-spacing: 0.06em;
}

/* ── 10. 사상가 선택 ─────────────────────────────────────── */
.thinkers-topic-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
}
.thinkers-topic-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.14em;
  font-family: var(--font-sans);
  text-transform: uppercase;
  margin-bottom: var(--space-1);
}
.thinkers-topic-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 3px;
}
.thinkers-topic-conflict {
  font-size: 0.78rem;
  color: var(--crimson-light);
  font-family: var(--font-sans);
}

.thinkers-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5);
  overflow-y: auto;
  max-width: 620px;
  margin: 0 auto;
  width: 100%;
}

.thinker-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  display: grid;
  grid-template-areas:
    "avatar info"
    "btn btn";
  grid-template-columns: 56px 1fr;
  gap: 0 var(--space-4);
  padding: var(--space-5);
  transition: border-color 0.2s, background 0.18s;
}
.thinker-card:hover { border-color: var(--border-bright); background: var(--bg-raised); }
.thinker-card.thinker-recommended { border-color: var(--gold-border); }
.thinker-card.thinker-recommended:hover { border-color: var(--gold); }

/* 추천 배지 */
.thinker-rec-badge {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: var(--gold);
  color: var(--bg-base);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 1px;
  letter-spacing: 0.05em;
  font-family: var(--font-sans);
}

.thinker-avatar {
  grid-area: avatar;
  font-size: 2.2rem;
  text-align: center;
  line-height: 1;
  padding-top: 2px;
}
.thinker-info {
  grid-area: info;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}
.thinker-name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.02em;
}
.thinker-school {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  font-family: var(--font-sans);
}
.thinker-desc {
  font-size: 0.82rem;
  color: var(--text-sub);
  line-height: 1.65;
  margin-top: var(--space-1);
  font-family: var(--font-sans);
}
.thinker-style {
  font-size: 0.78rem;
  color: var(--text-muted);
  border-left: 2px solid var(--gold-border);
  padding-left: var(--space-3);
  line-height: 1.6;
  margin-top: var(--space-2);
  font-family: var(--font-sans);
  font-style: italic;
}
.thinker-strengths {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.thinker-tag {
  font-size: 0.65rem;
  color: var(--text-muted);
  border: 1px solid var(--border-mid);
  padding: 2px 8px;
  border-radius: 1px;
  font-family: var(--font-sans);
  letter-spacing: 0.04em;
}

.thinker-select-btn {
  grid-area: btn;
  margin-top: var(--space-4);
  align-self: stretch;
}

/* ── 11. 브리핑 ──────────────────────────────────────────── */
.briefing-avatar {
  font-size: 3.5rem;
  margin-bottom: var(--space-2);
  filter: drop-shadow(0 0 12px rgba(200,145,74,0.3));
}
.briefing-name {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.06em;
}
.briefing-text {
  font-size: 0.88rem;
  color: var(--text-sub);
  text-align: center;
  max-width: 320px;
  line-height: 1.9;
  min-height: 80px;
  font-family: var(--font-sans);
}

/* ── 12. 레거시 사상가 선택 (select 화면) ────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  padding: var(--space-5);
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}
@media (min-width: 480px) { .card-grid { grid-template-columns: 1fr 1fr; } }

.philosopher-card {
  padding: var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: border-color 0.2s, transform 0.15s, background 0.18s;
}
.philosopher-card:hover {
  border-color: var(--gold-border);
  transform: translateY(-1px);
  background: var(--bg-raised);
}
.philosopher-card .card-avatar { font-size: 2rem; line-height: 1; }
.philosopher-card .card-name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
}
.philosopher-card .card-school {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-sans);
}
.philosopher-card .card-desc {
  font-size: 0.8rem;
  color: var(--text-sub);
  line-height: 1.55;
  font-family: var(--font-sans);
}

/* ── 13. 논쟁 화면 (Battle) ──────────────────────────────── */
#screen-battle {
  overflow: hidden; /* 화면 자체 스크롤 차단 — chat-log만 스크롤 */
}

/* 헤더 */
.battle-header {
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* 논제 표시 */
.battle-topic-title {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-sans);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

/* 상대 정보 행 */
.battle-opponent {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}
.boss-avatar {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}
.battle-opponent-info { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.boss-name {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--gold);
}
.boss-school {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-sans);
  letter-spacing: 0.04em;
}
.turn-indicator {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-sans);
  white-space: nowrap;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 2px 9px;
  border-radius: 10px;
}

/* ── 14. HP 바 (공통) ────────────────────────────────────── */
.hp-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.hp-block {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.hp-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  width: 2.8rem;
  flex-shrink: 0;
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hp-bar-wrap {
  flex: 1;
  height: 5px;
  background: var(--bg-base);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.hp-bar-wrap::after {
  content: '';
  position: absolute;
  left: 30%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255,255,255,0.06);
}
.hp-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.55s var(--ease-out), background-color 0.55s;
}
.hp-green  { background: var(--hp-green); }
.hp-yellow { background: var(--hp-yellow); }
.hp-red    { background: var(--hp-red); box-shadow: 0 0 6px rgba(139,36,36,0.5); }
.hp-val {
  font-size: 0.65rem;
  color: var(--text-muted);
  width: 2rem;
  text-align: right;
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
}

/* ── 15. 채팅 로그 (메신저 스타일) ──────────────────────── */
.chat-log {
  flex: 1;
  min-height: 0;        /* flex 자식 축소 허용 — 핵심 */
  overflow-y: auto;
  padding: var(--space-4) var(--space-3) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  /* 은은한 배경 패턴 */
  background-image: radial-gradient(circle, rgba(200,145,74,0.03) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* 날짜 구분선 */
.chat-date-sep {
  text-align: center;
  font-size: 0.62rem;
  color: var(--text-dim);
  font-family: var(--font-sans);
  letter-spacing: 0.06em;
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.chat-date-sep::before,
.chat-date-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* 채팅 버블 공통 */
.bubble {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  max-width: 85%;
  animation: bubble-in 0.2s var(--ease-out);
}

/* 시스템 메시지 (가운데 정렬) */
.bubble-system {
  align-self: center;
  max-width: 90%;
  justify-content: center;
}
.bubble-system .bubble-text,
.bubble-system .game-over-notice {
  background: transparent;
  color: var(--text-sub);
  font-size: 0.78rem;
  text-align: center;
  padding: var(--space-1) 0;
  opacity: 0.7;
}
.game-over-notice {
  color: var(--gold);
  opacity: 1 !important;
  font-family: var(--font-serif);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  line-height: 1.7;
  padding: var(--space-2) var(--space-4);
  border-top: 1px solid rgba(200,145,74,0.3);
  border-bottom: 1px solid rgba(200,145,74,0.3);
  animation: bubble-in 0.3s var(--ease-out);
}

/* 사상가(왼쪽) */
.bubble-boss {
  align-self: flex-start;
  align-items: flex-start; /* 아바타는 위에 고정 */
}

/* 플레이어(오른쪽) */
.bubble-player {
  align-self: flex-end;
  flex-direction: row-reverse; /* body가 오른쪽 */
}

/* 버블 아바타 (사상가) */
.bubble-avatar {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  margin-top: 2px;
}

/* 버블 본문 래퍼 */
.bubble-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 발신자 이름 (사상가만) */
.bubble-sender-name {
  font-size: 0.65rem;
  color: var(--gold);
  font-family: var(--font-serif);
  font-weight: 700;
  padding-left: var(--space-1);
  letter-spacing: 0.04em;
}

/* 사상가 말풍선 */
.bubble-boss .bubble-text {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-serif);
  font-size: 0.88rem;
  line-height: 1.85;
  color: var(--text-bright);
  border-radius: 2px 16px 16px 16px;
  position: relative;
}
/* 말풍선 꼬리 */
.bubble-boss .bubble-text::before {
  content: '';
  position: absolute;
  top: 10px;
  left: -6px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 7px solid var(--border);
}
.bubble-boss .bubble-text::after {
  content: '';
  position: absolute;
  top: 10px;
  left: -5px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 7px solid var(--bg-card);
}

/* 플레이어 말풍선 */
.bubble-player .bubble-text {
  background: #2c200e;
  border: 1px solid rgba(200,145,74,0.25);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--text-bright);
  border-radius: 16px 2px 16px 16px;
  position: relative;
}
.bubble-player .bubble-text::before {
  content: '';
  position: absolute;
  top: 10px;
  right: -6px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid rgba(200,145,74,0.25);
}
.bubble-player .bubble-text::after {
  content: '';
  position: absolute;
  top: 10px;
  right: -5px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid #2c200e;
}

.bubble-meta {
  font-size: 0.6rem;
  color: var(--text-dim);
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
}
.bubble-boss   .bubble-meta { padding-left: var(--space-1); }
.bubble-player .bubble-meta { text-align: right; padding-right: var(--space-1); }

/* 타이핑 점 애니메이션 */
@keyframes blink {
  0%, 80%, 100% { opacity: 0; }
  40%           { opacity: 1; }
}
.typing-dots span {
  animation: blink 1.4s infinite both;
  font-size: 1.4rem;
  color: var(--gold-border);
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

/* 타이핑 커서 */
@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 0.9em;
  background: var(--gold);
  margin-left: 1px;
  vertical-align: text-bottom;
  animation: cursor-blink 0.55s infinite;
}

/* 인라인 패널티 */
.turn-penalty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: 6px var(--space-3);
  background: var(--crimson-dim);
  border-left: 2px solid var(--crimson-light);
  border-radius: 0 8px 8px 0;
}
.turn-penalty-cat {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--crimson-light);
  letter-spacing: 0.04em;
  font-family: var(--font-sans);
}
.turn-penalty-hp {
  font-size: 0.65rem;
  color: #e08080;
  font-weight: 700;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
}
.turn-penalty-advice {
  width: 100%;
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
  font-family: var(--font-sans);
}

/* 배지 */
.turn-badges { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-2); }
.turn-badge {
  font-size: 0.62rem;
  color: var(--gold);
  border: 1px solid var(--gold-border);
  padding: 1px 7px;
  border-radius: 10px;
  font-family: var(--font-sans);
}

/* ── 16. 입력 영역 (메신저 스타일) ──────────────────────── */
.input-area {
  flex-shrink: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: var(--space-2) var(--space-3);
  padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
}

.readonly-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-1) 0;
}
.readonly-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.btn-view-result {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 0.82rem;
  padding: var(--space-2) var(--space-4);
  min-width: auto;
  min-height: 40px;
}

.input-row {
  display: flex;
  gap: var(--space-2);
  align-items: flex-end;
}

.player-input {
  flex: 1;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-mid);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  padding: 10px 16px;
  resize: none;
  line-height: 1.5;
  min-height: 44px;
  max-height: 120px;
  border-radius: 22px;
  transition: border-color 0.18s, background 0.18s;
  overflow-y: auto;
}
.player-input:focus {
  outline: none;
  border-color: rgba(200,145,74,0.45);
  background: #1e1a0e;
}
.player-input::placeholder { color: var(--text-dim); }
.player-input:disabled { opacity: 0.4; }

/* 원형 전송 버튼 */
.btn-send {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: var(--crimson);
  color: var(--text-bright);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, transform 0.12s;
}
.btn-send:hover    { background: var(--crimson-mid); transform: scale(1.06); }
.btn-send:active   { transform: scale(0.95); }
.btn-send:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

.battle-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  gap: var(--space-3);
}

.input-guide {
  font-size: 0.65rem;
  color: var(--text-dim);
  font-family: var(--font-sans);
  flex: 1;
}

.btn-surrender {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.65rem;
  cursor: pointer;
  padding: 2px 0;
  font-family: var(--font-sans);
  transition: color 0.15s;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-surrender:hover { color: var(--crimson-light); }

/* ── 17. 페널티 토스트 ───────────────────────────────────── */
.penalty-toast {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-3) var(--space-5);
  background: rgba(100, 30, 30, 0.97);
  border-bottom: 2px solid var(--crimson-light);
  backdrop-filter: blur(4px);
}
.penalty-toast[data-severity="low"] {
  background: rgba(80, 55, 15, 0.97);
  border-bottom-color: var(--gold);
}
.penalty-toast[data-severity="high"],
.penalty-toast[data-severity="critical"] {
  background: rgba(80, 15, 15, 0.98);
  border-bottom-color: #f06060;
}
.penalty-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-1);
}
.penalty-category {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-sans);
}
.penalty-amount {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffa0a0;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
}
.penalty-advice {
  font-size: 0.73rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.45;
  font-family: var(--font-sans);
}

@keyframes toast-in  { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toast-out { from { transform: translateY(0); opacity: 1; }    to { transform: translateY(-100%); opacity: 0; } }
.toast-show { animation: toast-in  0.22s var(--ease-out) forwards; }
.toast-hide { animation: toast-out 0.3s  ease-in forwards; }

/* ── 18. 카드 드로어 ─────────────────────────────────────── */
.card-drawer {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding: var(--space-2) 0;
  margin-bottom: var(--space-3);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.card-drawer::-webkit-scrollbar { display: none; }
.card-drawer.hidden { display: none; }

.card-item {
  flex-shrink: 0;
  min-width: 88px;
  min-height: 60px;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
  font-size: 0.72rem;
  color: var(--text-sub);
  font-family: var(--font-sans);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  transition: border-color 0.15s;
}
.card-item:hover   { border-color: var(--border-bright); }
.card-item.selected { border-color: var(--gold); background: var(--bg-raised); }
.card-item-name { font-size: 0.78rem; color: var(--text-main); }
.card-item .card-type-attack  { color: var(--crimson-light); }
.card-item .card-type-defense { color: var(--hp-green); }
.card-item .card-type-special { color: var(--gold); }

.used-card { margin-bottom: var(--space-2); font-size: 0.72rem; color: var(--gold); font-family: var(--font-sans); }
.used-card.hidden { display: none; }

/* ── 19. 결과 화면 ───────────────────────────────────────── */

/* 결과 배너 (등급 표시) */
.result-banner {
  padding: 3rem 2rem 2.5rem;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  position: relative;
}

/* 배너 구분선 */
.result-banner::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 2px;
  background: currentColor;
  opacity: 0.3;
}

.result-banner-win  {
  background: linear-gradient(175deg, #1e160a 0%, var(--bg-base) 100%);
  border-bottom: 1px solid var(--border-mid);
  color: var(--gold);
}
.result-banner-lose {
  background: linear-gradient(175deg, #160a0a 0%, var(--bg-base) 100%);
  border-bottom: 1px solid var(--border);
  color: var(--crimson-light);
}
.result-banner-draw {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

/* 등급 한자 — 대형 */
.result-grade-char {
  font-family: var(--font-serif);
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  display: block;
}
.result-banner-win  .result-grade-char {
  color: var(--gold-light);
  text-shadow: 0 0 32px rgba(200,145,74,0.45);
}
.result-banner-lose .result-grade-char { color: var(--crimson-light); }
.result-banner-draw .result-grade-char { color: var(--text-muted); }

.result-grade-text {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

/* 결과 바디 */
.result-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  overflow-y: auto;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* 카드 공통 */
.result-context-card,
.result-score-card,
.result-metrics-card,
.result-analysis-card,
.result-advice-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: var(--space-5);
}

.result-card-title {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
  font-family: var(--font-sans);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

/* 논제 + 사상가 카드 */
.result-context-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  font-family: var(--font-sans);
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}
.result-context-topic {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: var(--space-4);
  line-height: 1.45;
}
.result-context-thinker {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.result-thinker-avatar { font-size: 1.8rem; flex-shrink: 0; }
.result-thinker-name {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--gold);
}
.result-thinker-school {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-sans);
  margin-top: 2px;
}

/* 점수 비교 카드 */
.result-score-compare {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border);
}
.result-score-side {
  text-align: center;
  flex: 1;
  max-width: 120px;
}
.result-score-who {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-sans);
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2);
  text-transform: uppercase;
}
.result-score-final {
  font-family: var(--font-serif);
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.result-score-winner .result-score-final { color: var(--gold-light); }
.result-score-detail {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-top: var(--space-2);
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}
.result-score-vs {
  font-size: 0.68rem;
  color: var(--text-dim);
  flex-shrink: 0;
  font-family: var(--font-sans);
  letter-spacing: 0.08em;
  padding-bottom: 1.2rem;
}

/* HP 비교 */
.result-hp-compare {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.result-hp-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.result-hp-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  width: 3.2rem;
  flex-shrink: 0;
  font-family: var(--font-sans);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.result-hp-bar-wrap {
  flex: 1;
  height: 5px;
  background: var(--bg-base);
  border-radius: 3px;
  overflow: hidden;
}
.result-hp-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 1s var(--ease-out);
}
.result-hp-val {
  font-size: 0.68rem;
  color: var(--text-muted);
  width: 2.2rem;
  text-align: right;
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
}

/* 5대 지표 */
.result-metrics-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.result-metric-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.result-metric-label {
  font-size: 0.72rem;
  color: var(--text-sub);
  width: 9rem;
  flex-shrink: 0;
  font-family: var(--font-sans);
  letter-spacing: -0.01em;
}
.result-metric-bar-wrap {
  flex: 1;
  height: 5px;
  background: var(--bg-base);
  border-radius: 3px;
  overflow: hidden;
}
.result-metric-bar {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  transition: width 1.1s var(--ease-out);
}
.result-metric-val {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold);
  width: 3rem;
  text-align: right;
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
}
.result-metric-max {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* 분석 카드 */
.result-analysis-2col {
  display: flex;
  gap: var(--space-3);
  padding: 0;
  background: none;
  border: none;
}
.result-analysis-2col > .result-analysis-card {
  flex: 1;
  min-width: 0;
  padding: var(--space-4);
}
.result-col-good .result-card-title { color: var(--hp-green); border-bottom-color: rgba(61,140,82,0.2); }
.result-col-bad  .result-card-title { color: var(--crimson-light); border-bottom-color: rgba(192,72,72,0.2); }

.result-analysis-text {
  font-size: 0.84rem;
  color: var(--text-sub);
  line-height: 1.8;
  margin: 0;
  font-family: var(--font-sans);
}
.result-advice-text { color: var(--gold-light); }
.result-advice-card {
  border-color: var(--gold-border);
  background: linear-gradient(to bottom right, var(--bg-card), var(--bg-raised));
}
.result-list {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.result-list li {
  font-size: 0.78rem;
  color: var(--text-sub);
  line-height: 1.6;
  font-family: var(--font-sans);
}

/* 결과 액션 버튼 */
.result-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-bottom: var(--space-5);
}

/* ── 20. 페이월 모달 ─────────────────────────────────────── */
.paywall-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}
.paywall-overlay.hidden { display: none; }

.paywall-card {
  background: var(--bg-surface);
  border: 1px solid var(--gold-border);
  border-radius: 4px;
  padding: 2.5rem 2rem;
  max-width: 340px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  animation: modal-in 0.28s var(--ease-out);
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.paywall-icon {
  font-size: 2.2rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(200,145,74,0.3));
}
.paywall-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.06em;
}
.paywall-desc {
  font-size: 0.84rem;
  color: var(--text-sub);
  text-align: center;
  line-height: 1.85;
  font-family: var(--font-sans);
  margin: 0;
}
.paywall-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  margin-top: var(--space-2);
}
.paywall-btn { width: 100%; }

/* ── 21. 애니메이션 ─────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.bubble { animation: bubble-in 0.25s var(--ease-out); }

/* ── 22. 상태 메시지 (로딩/빈값/에러) ─────────────────────── */

.state-msg {
  text-align: center;
  padding: 2.5rem var(--space-5);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  line-height: 1.6;
}
.state-loading { color: var(--text-muted); }
.state-loading::before { content: '⏳ '; }
.state-empty   { color: var(--text-muted); }
.state-error   { color: var(--crimson-light); }
.state-error::before { content: '⚠ '; }

/* ── 23. 모바일 반응형 ──────────────────────────────────── */

/* 375px 이하 소형 스마트폰 */
@media (max-width: 375px) {
  html { font-size: 15px; }

  .title-seal { width: 50px; height: 50px; font-size: 1.7rem; }
  .title-main { font-size: 2.8rem; }
  .title-card { margin-top: -4vh; }

  .screen-center { padding: var(--space-6) var(--space-5); gap: var(--space-3); }

  .battle-header { padding: var(--space-3) var(--space-4); }
  .thinker-card { grid-template-columns: 48px 1fr; padding: var(--space-4); }
  .thinker-avatar { font-size: 1.9rem; }

  .result-score-final { font-size: 2.6rem; }
  .result-metric-label { width: 7.5rem; font-size: 0.68rem; }

  .result-analysis-2col { flex-direction: column; }
  .result-analysis-2col > .result-analysis-card { padding: var(--space-4); }
}

/* 480px 이상 — 카드 2열 */
@media (min-width: 480px) {
  .card-grid { grid-template-columns: 1fr 1fr; }

  .result-body { padding: var(--space-5) var(--space-6); }

  .battle-header { padding: var(--space-3) var(--space-5); }
  .chat-log      { padding: var(--space-5) var(--space-5) var(--space-4); }
  .input-area    { padding: var(--space-3) var(--space-5); padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px)); }
  .bubble        { max-width: 78%; }
}

/* 600px 이상 — 결과 화면 더 넓게 */
@media (min-width: 600px) {
  .thinkers-list { padding: var(--space-6); }
  .result-grade-char { font-size: 5rem; }
  .result-metric-label { width: 10.5rem; }
}

/* ── 24. 인증 UI (로그인/로그아웃/유저바) ──────────────────── */

.menu-user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  background: rgba(255,255,255,0.6);
  border-bottom: 1px solid var(--border-light);
  min-height: 52px;
  gap: var(--space-3);
}

.user-bar-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.user-name {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-guest {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.btn-auth {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}
.btn-auth:active { opacity: 0.75; }

.btn-login {
  background: var(--ink-dark);
  color: var(--paper-warm);
}

.btn-logout {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

/* ── 25. 나의 기록 화면 ─────────────────────────────────── */

.history-list {
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.history-card {
  background: var(--surface-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
  animation: fadeIn 0.25s var(--ease-out);
}
.history-card:active {
  transform: scale(0.99);
  box-shadow: none;
}

.history-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.history-thinker {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.history-result {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}
.result-win     { background: #dcfce7; color: #166534; }
.result-draw    { background: #fef9c3; color: #854d0e; }
.result-lose    { background: #fee2e2; color: #991b1b; }
.result-ongoing { background: var(--border-light); color: var(--text-muted); }

.history-topic {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-sub);
  margin: 0 0 var(--space-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.history-diff,
.history-turns,
.history-score,
.history-date {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.history-diff::before  { content: '🎖 '; }
.history-turns::before { content: '🔄 '; }
.history-date          { margin-left: auto; }

.history-empty,
.history-loading,
.history-error,
.history-empty-text {
  text-align: center;
  padding: var(--space-8) var(--space-5);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.8;
}
.history-error { color: var(--crimson-light); }

/* ══════════════════════════════════════════════════════════════
   26. 성장 리포트 (나의 기록 / /me · /history)
   디자인 레퍼런스: result 화면의 카드 + 바 시스템
   ══════════════════════════════════════════════════════════════ */

/* ── 쉘 레이아웃 ──────────────────────────────────────────── */

.rr-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.rr-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.04em;
}

.rr-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-4) var(--space-5) var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ── 섹션 공통 ────────────────────────────────────────────── */

.rr-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: var(--space-5);
  animation: fadeIn 0.3s var(--ease-out) both;
}
.rr-section-last { margin-bottom: var(--space-4); }

.rr-section-title {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}

/* ── 비로그인 게스트 ──────────────────────────────────────── */

.rr-guest-wall {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-5);
  gap: var(--space-4);
  text-align: center;
}

.rr-guest-seal {
  width: 80px;
  height: 80px;
  border: 2px solid var(--gold-border);
  border-radius: 4px;
  font-family: var(--font-serif);
  font-size: 2.2rem;
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-2);
}

.rr-guest-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--text-main);
}

.rr-guest-desc {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.8;
}

/* ── 빈 상태 / 로딩 / 에러 ───────────────────────────────── */

.rr-state {
  text-align: center;
  padding: var(--space-8) var(--space-5);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--text-muted);
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rr-error { color: var(--crimson-light); }

.rr-no-data {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-3) 0;
}

.rr-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-8) var(--space-5);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-muted);
  gap: var(--space-3);
}

.rr-empty-seal {
  width: 64px;
  height: 64px;
  border: 1px solid var(--border-bright);
  border-radius: 4px;
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── 1. 프로필 + 종합 통계 ───────────────────────────────── */

.rr-profile-section { padding-bottom: var(--space-4); }

.rr-profile-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.rr-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--gold-border);
  object-fit: cover;
  flex-shrink: 0;
}

.rr-avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--gold-border);
  background: var(--gold-dim);
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rr-profile-name {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.rr-profile-sub {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.rr-win-rate { color: var(--hp-green); font-weight: 600; }

.rr-stat-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.rr-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.rr-stat-val {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
}

.rr-stat-key {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.rr-color-win  { color: var(--hp-green); }
.rr-color-draw { color: var(--gold); }
.rr-color-lose { color: var(--crimson-light); }
.rr-color-gold { color: var(--gold-light); }

/* ── 2. 성장 추이 차트 ───────────────────────────────────── */

.rr-trend-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-1);
  height: 100px;
  margin-bottom: var(--space-2);
}

.rr-trend-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.rr-trend-val {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  color: var(--text-muted);
  line-height: 1;
}

.rr-trend-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  min-height: 12px;
}

.rr-trend-bar {
  width: 100%;
  min-height: 4px;
  border-radius: 2px 2px 0 0;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  transition: height 0.6s var(--ease-out);
}
.rr-trend-bar.rr-win  { background: rgba(61,140,82,0.25); border-color: var(--hp-green); }
.rr-trend-bar.rr-draw { background: rgba(200,145,74,0.2);  border-color: var(--gold); }
.rr-trend-bar.rr-lose { background: rgba(155,56,56,0.25);  border-color: var(--crimson-light); }

.rr-trend-label {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.rr-trend-note {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: right;
}

/* ── 3. 5대 지표 ─────────────────────────────────────────── */

.rr-metrics-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.rr-metric-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.rr-metric-label {
  width: 9rem;
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-sub);
}

.rr-metric-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--bg-raised);
  border-radius: 3px;
  overflow: hidden;
}

.rr-metric-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim) 0%, var(--gold) 100%);
  border-radius: 3px;
  transition: width 0.6s var(--ease-out);
}

.rr-metric-val {
  width: 3.2rem;
  text-align: right;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  flex-shrink: 0;
}

.rr-metric-max {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 400;
}

/* ── 4. 인사이트 ─────────────────────────────────────────── */

.rr-insight-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.rr-insight-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
}

.rr-insight-icon {
  font-size: 1.4rem;
  width: 2rem;
  text-align: center;
  flex-shrink: 0;
  line-height: 1.3;
}

.rr-insight-body { flex: 1; min-width: 0; }

.rr-insight-title {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 3px;
  letter-spacing: 0.04em;
}

.rr-insight-main {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.rr-insight-sub {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.rr-insight-weak  { border-left: 3px solid var(--crimson-light); }
.rr-insight-rival { border-left: 3px solid var(--gold); }
.rr-insight-penalty { border-left: 3px solid var(--ink-blue-light); }

.rr-penalty-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.rr-penalty-tag {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--text-sub);
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: 10px;
  padding: 2px 8px;
}

.rr-penalty-tag b {
  color: var(--crimson-light);
  font-weight: 700;
}

/* ── 5. 논전 카드 목록 ───────────────────────────────────── */

.rr-session-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.rr-session-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.rr-session-card:hover  { border-color: var(--gold-border); }
.rr-session-card:active { background: var(--bg-surface); }

.rr-session-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.rr-session-thinker {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.rr-session-badge {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

.rr-badge-rr-win  { background: rgba(61,140,82,0.2);  color: #6abf7a; border: 1px solid rgba(61,140,82,0.35); }
.rr-badge-rr-draw { background: rgba(200,145,74,0.15); color: var(--gold-light); border: 1px solid var(--gold-border); }
.rr-badge-rr-lose { background: var(--crimson-dim);    color: var(--crimson-light); border: 1px solid rgba(155,56,56,0.3); }
.rr-badge-        { background: var(--bg-surface);     color: var(--text-muted); border: 1px solid var(--border); }

.rr-session-topic {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--text-sub);
  margin-bottom: var(--space-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rr-session-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.rr-session-score {
  color: var(--gold-light);
  font-weight: 600;
}
.rr-score-vs { color: var(--text-muted); font-weight: 400; }
.rr-session-date { margin-left: auto; }

/* ── 반응형 ──────────────────────────────────────────────── */

@media (max-width: 375px) {
  .rr-metric-label { width: 7.5rem; font-size: 0.68rem; }
  .rr-stat-val     { font-size: 1.2rem; }
  .rr-stat-key     { font-size: 0.62rem; }
  .rr-trend-chart  { height: 80px; }
}

@media (min-width: 480px) {
  .rr-content { padding: var(--space-5) var(--space-6) var(--space-8); }
  .rr-insight-grid { display: grid; grid-template-columns: 1fr 1fr; }
  .rr-insight-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Pricing Screen  (.pr-*)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.screen-pricing-root {
  flex-direction: column;
  min-height: 100dvh;
  background: var(--bg-base);
  color: var(--text-main);
}

.pr-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.pr-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.pr-body {
  flex: 1;
  padding: var(--space-5) var(--space-4) var(--space-8);
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* 현재 플랜 배지 */
.pr-current-badge {
  text-align: center;
  padding: var(--space-2) var(--space-4);
  border-radius: 20px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: var(--space-5);
  display: inline-block;
  width: 100%;
  box-sizing: border-box;
}
.pr-badge-free {
  background: var(--bg-raised);
  color: var(--text-sub);
  border: 1px solid var(--border);
}
.pr-badge-paid {
  background: rgba(200,145,74,0.12);
  color: var(--gold-light);
  border: 1px solid var(--gold-border);
}

/* 플랜 카드 */
.pr-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.pr-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: var(--space-5);
  position: relative;
}
.pr-card-active {
  border-color: var(--gold-border);
  background: rgba(200,145,74,0.04);
}
.pr-card-premium {
  border-color: var(--border-mid);
}
.pr-card-premium.pr-card-active {
  border-color: var(--gold-light);
  box-shadow: 0 0 0 1px rgba(200,145,74,0.25);
}

.pr-card-badge {
  position: absolute;
  top: -1px;
  right: var(--space-4);
  background: var(--gold-light);
  color: var(--bg-base);
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 0 0 4px 4px;
  letter-spacing: 0.05em;
}

.pr-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.pr-card-name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}
.pr-card-price {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold-light);
}
.pr-price-unit {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-sub);
}

/* 기능 목록 */
.pr-features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.pr-features li {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  padding-left: 1.4em;
  position: relative;
  line-height: 1.5;
}
.pr-feat-ok {
  color: var(--text-main);
}
.pr-feat-ok::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #6abf7a;
  font-weight: 700;
}
.pr-feat-no {
  color: var(--text-muted);
}
.pr-feat-no::before {
  content: '✕';
  position: absolute;
  left: 0;
  color: var(--crimson-light);
  font-size: 0.8em;
}
.pr-feat-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pr-current-label {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--gold-light);
  text-align: center;
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
  font-weight: 600;
}

.pr-upgrade-btn {
  width: 100%;
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-size: 0.95rem;
}

/* 로그인 안내 */
.pr-login-hint {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--text-sub);
  text-align: center;
  margin-top: var(--space-2);
}
.pr-link-btn {
  background: none;
  border: none;
  color: var(--gold-light);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

/* 구독 취소 영역 */
.pr-cancel-area {
  text-align: center;
  margin-top: var(--space-6);
}
.pr-cancel-btn {
  background: none;
  border: 1px solid var(--border-mid);
  border-radius: 4px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.pr-cancel-btn:hover {
  color: var(--crimson-light);
  border-color: var(--crimson-light);
}
.pr-cancel-hint {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-2);
}

/* 개발 전용 토글 */
.pr-dev-area {
  margin-top: var(--space-8);
  text-align: center;
  border-top: 1px dashed var(--border);
  padding-top: var(--space-4);
}
.pr-dev-btn {
  background: none;
  border: 1px dashed var(--border-mid);
  border-radius: 4px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  letter-spacing: 0.02em;
}
.pr-dev-btn:hover { color: var(--gold-light); border-color: var(--gold-border); }

@media (min-width: 480px) {
  .pr-cards { flex-direction: row; align-items: stretch; }
  .pr-card  { flex: 1; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Cards Screen  (.cd-*)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.cd-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
.cd-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}
.cd-body {
  padding: var(--space-4) var(--space-4) var(--space-8);
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
.cd-error { color: var(--text-muted); font-family: var(--font-sans); text-align: center; padding: var(--space-6) 0; }

.cd-summary-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.cd-summary-num {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-light);
}
.cd-summary-total { font-size: 1rem; color: var(--text-muted); font-weight: 400; }
.cd-summary-label { font-family: var(--font-sans); font-size: 0.82rem; color: var(--text-sub); }

.cd-group { margin-bottom: var(--space-6); }
.cd-group-title {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-sub);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}
.cd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

/* 카드 */
.cd-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: var(--space-3) var(--space-3) var(--space-4);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  transition: border-color 0.15s;
}
.cd-owned  { border-color: var(--border-mid); }
.cd-locked { opacity: 0.48; }
.cd-card:hover.cd-owned { border-color: var(--gold-border); }

.cd-lock {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  font-size: 0.75rem;
  opacity: 0.7;
}

.cd-type-tag {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 3px;
  align-self: flex-start;
  margin-bottom: var(--space-1);
}
.cd-type-attack  { background: rgba(155,56,56,0.18);  color: var(--crimson-light); border: 1px solid rgba(155,56,56,0.3); }
.cd-type-defense { background: rgba(56,112,155,0.18); color: #7ab4d9;              border: 1px solid rgba(56,112,155,0.3); }
.cd-type-special { background: rgba(200,145,74,0.15); color: var(--gold-light);    border: 1px solid var(--gold-border); }

.cd-card-name {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}
.cd-card-effect {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--gold-light);
  font-weight: 600;
}
.cd-card-desc {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--text-sub);
  line-height: 1.5;
  flex: 1;
  margin-top: var(--space-1);
}
.cd-card-flavor {
  font-family: var(--font-serif);
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
  font-style: italic;
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Achievements Screen  (.ach-*)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.ach-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
.ach-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}
.ach-body {
  padding: var(--space-4) var(--space-4) var(--space-8);
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
.ach-error { color: var(--text-muted); font-family: var(--font-sans); text-align: center; padding: var(--space-6) 0; }

.ach-progress-wrap {
  margin-bottom: var(--space-5);
}
.ach-progress-track {
  height: 6px;
  background: var(--bg-raised);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: var(--space-2);
}
.ach-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-border), var(--gold-light));
  border-radius: 3px;
  transition: width 0.6s ease;
  width: 0;
}
.ach-progress-label {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: right;
}

.ach-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.ach-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: var(--space-3) var(--space-4);
  transition: border-color 0.15s;
}
.ach-earned  { border-color: var(--border-mid); }
.ach-unearned { opacity: 0.5; }
.ach-earned:hover { border-color: var(--gold-border); }

.ach-icon-wrap {
  position: relative;
  flex-shrink: 0;
}
.ach-icon {
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--bg-raised);
  border-radius: 50%;
  border: 1px solid var(--border);
}
.ach-check {
  position: absolute;
  bottom: -2px;
  right: -4px;
  background: #3d8c52;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ach-info { flex: 1; min-width: 0; }
.ach-name {
  font-family: var(--font-serif);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}
.ach-desc {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--text-sub);
  line-height: 1.5;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Radar Chart  (.radar-*)  — result.js에서 사용
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.radar-svg {
  display: block;
  width: 100%;
  max-width: 240px;
  margin: var(--space-3) auto var(--space-2);
  overflow: visible;
}

.radar-grid {
  fill: none;
  stroke: var(--border-mid);
  stroke-width: 0.8;
}
.radar-axis {
  stroke: var(--border-mid);
  stroke-width: 0.8;
}
.radar-score {
  fill: rgba(200, 145, 74, 0.18);
  stroke: var(--gold-light);
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.radar-dot {
  fill: var(--gold-light);
}
.radar-label {
  font-family: var(--font-sans);
  font-size: 9px;
  fill: var(--text-sub);
}

/* 5대 지표 숫자 그리드 */
.result-metrics-score-grid {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}
.result-ms-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: var(--space-2) var(--space-3);
  min-width: 52px;
}
.result-ms-val {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
}
.result-ms-max {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  color: var(--text-muted);
}
.result-ms-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: var(--text-sub);
  margin-top: 2px;
}
.ms-high .result-ms-val { color: #6abf7a; }
.ms-mid  .result-ms-val { color: var(--gold-light); }
.ms-low  .result-ms-val { color: var(--crimson-light); }

@media (min-width: 480px) {
  .cd-grid { grid-template-columns: repeat(3, 1fr); }
  .ach-grid { display: grid; grid-template-columns: 1fr 1fr; }
  .radar-svg { max-width: 280px; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Achievement Toast  (#ach-toast-container, .ach-toast)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

#ach-toast-container {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 80px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  z-index: 9999;
  pointer-events: none;
}

.ach-toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--bg-surface);
  border: 1px solid var(--gold-border);
  border-radius: 8px;
  padding: var(--space-3) var(--space-4);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.3s ease, transform 0.3s ease;
  min-width: 220px;
  max-width: 320px;
}

.ach-toast-show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.ach-toast-hide {
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
}

.ach-toast-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.ach-toast-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ach-toast-label {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ach-toast-name {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}
