/* ============================================================
   DUO GAME ZONE / 인생게임 — 독립 CSS
   - styles.css는 절대 건드리지 않음
   - 다크 테마 토큰은 styles.css의 --bg/--card/--muted/--text 사용
   - 신규 파일이라 충돌 없음 (lg- / gz- prefix)
   ============================================================ */

:root {
  --lg-accent: #9c6cff;
  --lg-accent-2: #ff6cb6;
  --lg-good: #4ade80;
  --lg-bad: #f87171;
  --lg-warn: #facc15;
  --lg-info: #60a5fa;
  --lg-card-bg: #121a27;
  --lg-card-bg-2: #182238;
  --lg-border: rgba(255, 255, 255, 0.08);
  --lg-border-strong: rgba(255, 255, 255, 0.18);
  --lg-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --lg-radius: 16px;
}

/* ===== Topbar nav 게임천국 강조 ===== */
.nav-link-gamezone {
  background: linear-gradient(135deg, rgba(156, 108, 255, 0.16), rgba(255, 108, 182, 0.16));
  border: 1px solid rgba(156, 108, 255, 0.35) !important;
  border-radius: 999px;
  padding: 4px 12px !important;
}
.nav-link-gamezone:hover {
  background: linear-gradient(135deg, rgba(156, 108, 255, 0.28), rgba(255, 108, 182, 0.28));
}

/* ============================================================
   GAME ZONE HUB
   ============================================================ */
.gz-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 16px 80px;
}
.gz-hero {
  text-align: center;
  margin-bottom: 36px;
}
.gz-hero-emoji {
  font-size: 56px;
  filter: drop-shadow(0 4px 12px rgba(156, 108, 255, 0.5));
}
.gz-hero h1 {
  font-size: 32px;
  margin: 8px 0 6px;
  background: linear-gradient(135deg, #b794ff, #ff8fc7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gz-hero p {
  color: var(--lg-muted, #9aa7bd);
  font-size: 14px;
}

.gz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.gz-card {
  position: relative;
  background: var(--lg-card-bg);
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius);
  padding: 22px 18px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
  min-height: 180px;
}
.gz-card:hover {
  transform: translateY(-4px);
  border-color: var(--lg-border-strong);
  box-shadow: var(--lg-shadow);
}
.gz-card.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.gz-card.disabled:hover {
  transform: none;
  border-color: var(--lg-border);
  box-shadow: none;
}
.gz-card-emoji { font-size: 44px; }
.gz-card-title { font-weight: 800; font-size: 18px; }
.gz-card-desc { color: #9aa7bd; font-size: 13px; line-height: 1.5; flex: 1; }
.gz-card-tag {
  align-self: flex-start;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(156, 108, 255, 0.15);
  color: #b794ff;
  border: 1px solid rgba(156, 108, 255, 0.35);
}
.gz-card-tag.coming {
  background: rgba(255, 255, 255, 0.05);
  color: #9aa7bd;
  border-color: var(--lg-border);
}

/* ============================================================
   LIFEGAME COMMON
   ============================================================ */
.lg-app {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 14px 60px;
  min-height: calc(100dvh - 80px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lg-screen { display: none; flex-direction: column; gap: 14px; }
.lg-screen.active { display: flex; }

/* ===== HUD (스탯바) ===== */
.lg-hud {
  background: var(--lg-card-bg);
  border: 1px solid var(--lg-border);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 8px;
  z-index: 5;
  backdrop-filter: blur(6px);
}
.lg-hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.lg-hud-stage {
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.lg-hud-stage-emoji { font-size: 18px; }
.lg-hud-age {
  font-size: 12px;
  color: #9aa7bd;
}
.lg-hud-progress {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
}
.lg-hud-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--lg-accent), var(--lg-accent-2));
  width: 0%;
  transition: width 0.4s ease;
}

.lg-stats {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.lg-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  font-size: 11px;
  cursor: help;
}
.lg-stat-emoji { font-size: 16px; }
.lg-stat-label { color: #9aa7bd; font-size: 10px; display: none; }
.lg-stat-value { font-weight: 700; font-size: 12px; }
.lg-stat.flash-up { animation: lg-flash-up 0.6s ease; }
.lg-stat.flash-down { animation: lg-flash-down 0.6s ease; }
.lg-stat.flash-money-up { animation: lg-flash-money-up 0.6s ease; }
@keyframes lg-flash-up {
  0%, 100% { background: rgba(255,255,255,0.03); }
  50% { background: rgba(74,222,128,0.25); transform: translateY(-2px); }
}
@keyframes lg-flash-down {
  0%, 100% { background: rgba(255,255,255,0.03); }
  50% { background: rgba(248,113,113,0.25); transform: translateY(2px); }
}
@keyframes lg-flash-money-up {
  0%, 100% { background: rgba(255,255,255,0.03); }
  50% { background: rgba(250,204,21,0.3); transform: scale(1.08); }
}

/* ===== SETUP 화면 ===== */
.lg-setup {
  text-align: center;
  background: var(--lg-card-bg);
  border: 1px solid var(--lg-border);
  border-radius: 18px;
  padding: 32px 22px;
  box-shadow: var(--lg-shadow);
}
.lg-setup-emoji {
  font-size: 64px;
  filter: drop-shadow(0 4px 16px rgba(255, 108, 182, 0.5));
}
.lg-setup-title {
  font-size: 28px;
  font-weight: 900;
  margin: 8px 0 4px;
  background: linear-gradient(135deg, #b794ff, #ff8fc7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lg-setup-sub {
  color: #9aa7bd;
  font-size: 13px;
  margin-bottom: 20px;
}
.lg-setup-input {
  width: 100%;
  max-width: 320px;
  padding: 12px 14px;
  font-size: 15px;
  text-align: center;
  border: 1px solid var(--lg-border-strong);
  border-radius: 12px;
  background: rgba(0,0,0,0.25);
  color: #fff;
  margin-bottom: 14px;
}
.lg-setup-input:focus {
  outline: none;
  border-color: var(--lg-accent);
}
.lg-setup-btn {
  width: 100%;
  max-width: 320px;
  padding: 14px;
  font-size: 16px;
  font-weight: 800;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--lg-accent), var(--lg-accent-2));
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease;
  box-shadow: 0 6px 20px rgba(156, 108, 255, 0.35);
}
.lg-setup-btn:hover { transform: translateY(-2px); }
.lg-setup-btn:active { transform: translateY(0); }

.lg-setup-hint {
  margin-top: 16px;
  font-size: 12px;
  color: #9aa7bd;
}

/* ===== PLAY 화면 (이벤트 카드 + 선택지) ===== */
.lg-event-card {
  background: linear-gradient(180deg, var(--lg-card-bg-2) 0%, var(--lg-card-bg) 100%);
  border: 1px solid var(--lg-border);
  border-radius: var(--lg-radius);
  padding: 20px 18px;
  box-shadow: var(--lg-shadow);
  animation: lg-card-in 0.4s ease;
}
@keyframes lg-card-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.lg-event-emoji {
  font-size: 48px;
  text-align: center;
  margin-bottom: 4px;
}
.lg-event-title {
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
}
.lg-event-desc {
  font-size: 14px;
  color: #c5cee0;
  text-align: center;
  line-height: 1.55;
  margin-bottom: 14px;
}
.lg-event-route-tag {
  display: inline-block;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(156,108,255,0.15);
  color: #b794ff;
  border: 1px solid rgba(156,108,255,0.35);
  margin-bottom: 8px;
}

.lg-choices {
  display: grid;
  gap: 10px;
}
.lg-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--lg-border);
  border-radius: 12px;
  padding: 14px 14px;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
  color: #fff;
  font: inherit;
  width: 100%;
}
.lg-choice:hover {
  background: rgba(156,108,255,0.12);
  border-color: rgba(156,108,255,0.5);
  transform: translateX(2px);
}
.lg-choice:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.lg-choice-emoji {
  font-size: 28px;
  flex-shrink: 0;
}
.lg-choice-body { flex: 1; }
.lg-choice-text { font-weight: 700; font-size: 15px; }
.lg-choice-sub { font-size: 11px; color: #9aa7bd; margin-top: 2px; }
.lg-choice-risk {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0,0,0,0.4);
  color: var(--lg-warn);
}
.lg-choice.selected {
  background: linear-gradient(135deg, rgba(156,108,255,0.25), rgba(255,108,182,0.18));
  border-color: var(--lg-accent);
}

/* ===== RESULT (선택 결과 카드) ===== */
.lg-result-card {
  background: linear-gradient(180deg, var(--lg-card-bg-2), var(--lg-card-bg));
  border: 1px solid var(--lg-border-strong);
  border-radius: var(--lg-radius);
  padding: 18px;
  box-shadow: var(--lg-shadow);
  animation: lg-card-in 0.45s ease;
}
.lg-result-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.lg-result-emoji { font-size: 32px; }
.lg-result-title { font-weight: 800; font-size: 16px; flex: 1; }
.lg-result-grade {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}
.lg-result-grade.good { background: rgba(74,222,128,0.18); color: var(--lg-good); border: 1px solid rgba(74,222,128,0.4); }
.lg-result-grade.bad  { background: rgba(248,113,113,0.18); color: var(--lg-bad); border: 1px solid rgba(248,113,113,0.4); }
.lg-result-grade.mid  { background: rgba(96,165,250,0.18); color: var(--lg-info); border: 1px solid rgba(96,165,250,0.4); }
.lg-result-grade.crit { background: rgba(250,204,21,0.18); color: var(--lg-warn); border: 1px solid rgba(250,204,21,0.4); }

.lg-result-narrative {
  font-size: 13px;
  color: #c5cee0;
  line-height: 1.6;
  margin-bottom: 12px;
}
.lg-deltas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.lg-delta {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--lg-border);
}
.lg-delta.up { background: rgba(74,222,128,0.15); color: var(--lg-good); border-color: rgba(74,222,128,0.35); }
.lg-delta.down { background: rgba(248,113,113,0.15); color: var(--lg-bad); border-color: rgba(248,113,113,0.35); }

.lg-result-next {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--lg-accent), var(--lg-accent-2));
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.lg-result-next:hover { transform: translateY(-2px); }

/* ===== ENDING 화면 ===== */
.lg-ending {
  background: linear-gradient(180deg, var(--lg-card-bg-2), var(--lg-card-bg));
  border: 1px solid var(--lg-border-strong);
  border-radius: 20px;
  padding: 26px 20px;
  box-shadow: var(--lg-shadow);
  text-align: center;
  animation: lg-card-in 0.5s ease;
}
.lg-ending-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(156,108,255,0.18);
  color: #b794ff;
  border: 1px solid rgba(156,108,255,0.4);
  margin-bottom: 8px;
}
.lg-ending-emoji {
  font-size: 80px;
  filter: drop-shadow(0 6px 22px rgba(156,108,255,0.45));
  margin-bottom: 4px;
}
.lg-ending-title {
  font-size: 26px;
  font-weight: 900;
  margin: 4px 0 8px;
  background: linear-gradient(135deg, #b794ff, #ff8fc7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lg-ending-nick {
  font-size: 14px;
  color: #c5cee0;
  margin-bottom: 12px;
}
.lg-ending-quote {
  font-size: 14px;
  color: #fff;
  background: rgba(0,0,0,0.25);
  border-left: 3px solid var(--lg-accent);
  padding: 10px 14px;
  border-radius: 8px;
  margin: 14px 0;
  text-align: left;
  line-height: 1.6;
}

.lg-ending-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 14px 0;
}
.lg-ending-stat {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--lg-border);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
}
.lg-ending-stat-label { font-size: 11px; color: #9aa7bd; }
.lg-ending-stat-value { font-size: 16px; font-weight: 800; margin-top: 2px; }

.lg-ending-analysis {
  background: rgba(0,0,0,0.25);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 14px 0;
  text-align: left;
}
.lg-ending-analysis-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--lg-accent-2);
  margin-bottom: 6px;
}
.lg-ending-analysis-line {
  font-size: 13px;
  color: #d8dee9;
  line-height: 1.55;
  padding: 4px 0;
}
.lg-ending-analysis-line + .lg-ending-analysis-line {
  border-top: 1px dashed var(--lg-border);
}

.lg-ending-brand {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--lg-border);
  font-size: 11px;
  color: #9aa7bd;
}
.lg-ending-brand strong {
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #b794ff, #ff8fc7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lg-ending-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.lg-ending-actions button,
.lg-ending-actions a {
  padding: 12px;
  border: 1px solid var(--lg-border-strong);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.15s ease;
}
.lg-ending-actions button:hover,
.lg-ending-actions a:hover { background: rgba(156,108,255,0.2); border-color: var(--lg-accent); }
.lg-ending-actions .lg-btn-primary {
  background: linear-gradient(135deg, var(--lg-accent), var(--lg-accent-2));
  border: none;
}

/* ===== HISTORY (선택 로그) ===== */
.lg-history-toggle {
  background: none;
  border: 1px solid var(--lg-border);
  color: #9aa7bd;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
}
.lg-history-toggle:hover { color: #fff; border-color: var(--lg-border-strong); }
.lg-history {
  background: var(--lg-card-bg);
  border: 1px solid var(--lg-border);
  border-radius: 12px;
  padding: 12px;
  display: none;
}
.lg-history.open { display: block; }
.lg-history-item {
  font-size: 12px;
  color: #c5cee0;
  padding: 6px 0;
  border-bottom: 1px dashed var(--lg-border);
}
.lg-history-item:last-child { border-bottom: none; }
.lg-history-item .age { color: #9aa7bd; margin-right: 6px; }
.lg-history-item .arrow { color: var(--lg-accent); margin: 0 4px; }

/* ===== TOAST ===== */
.lg-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  border: 1px solid var(--lg-border-strong);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.lg-toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

/* ===== MOBILE ===== */
@media (max-width: 480px) {
  .lg-stats { grid-template-columns: repeat(7, 1fr); gap: 2px; }
  .lg-stat { padding: 4px 1px; }
  .lg-stat-emoji { font-size: 14px; }
  .lg-stat-value { font-size: 11px; }
  .lg-event-emoji { font-size: 40px; }
  .lg-event-title { font-size: 16px; }
  .lg-ending-emoji { font-size: 64px; }
  .lg-ending-title { font-size: 22px; }
  .lg-setup-title { font-size: 22px; }
  .lg-setup-emoji { font-size: 52px; }
}

/* ============================================================
   MULTI MODE — 로비/대기실/게임/엔딩
   ============================================================ */

/* ===== 멀티 진입 (lobby) ===== */
.lgm-entry {
  background: var(--lg-card-bg);
  border: 1px solid var(--lg-border);
  border-radius: 18px;
  padding: 28px 22px;
  text-align: center;
  box-shadow: var(--lg-shadow);
}
.lgm-entry h2 {
  font-size: 22px;
  margin: 0 0 4px;
  background: linear-gradient(135deg, #b794ff, #ff8fc7);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lgm-entry-sub { color: #9aa7bd; font-size: 13px; margin-bottom: 16px; }
.lgm-entry-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.lgm-entry-btn {
  padding: 16px 12px;
  border: 1px solid var(--lg-border-strong);
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  color: #fff;
  cursor: pointer;
  font: inherit;
  text-align: center;
  transition: all 0.15s ease;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
}
.lgm-entry-btn:hover { border-color: var(--lg-accent); background: rgba(156,108,255,0.1); }
.lgm-entry-btn .emoji { font-size: 28px; }
.lgm-entry-btn .label { font-weight: 800; font-size: 14px; }
.lgm-entry-btn .desc { font-size: 11px; color: #9aa7bd; }
.lgm-entry-btn.primary {
  background: linear-gradient(135deg, var(--lg-accent), var(--lg-accent-2));
  border: none;
}
.lgm-entry-btn.primary .desc { color: rgba(255,255,255,0.8); }

.lgm-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 18px;
  text-align: center;
  border: 1px solid var(--lg-border-strong);
  border-radius: 12px;
  background: rgba(0,0,0,0.25);
  color: #fff;
  letter-spacing: 4px;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, monospace;
}
.lgm-input:focus { outline: none; border-color: var(--lg-accent); }

.lgm-login-warn {
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.4);
  color: #fbb;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  margin: 10px 0;
}

/* ===== 대기실 (Lobby Waiting Room) ===== */
.lgm-waiting {
  background: var(--lg-card-bg);
  border: 1px solid var(--lg-border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--lg-shadow);
}
.lgm-room-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.lgm-room-code {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--lg-accent-2);
}
.lgm-copy-btn {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(156,108,255,0.18);
  border: 1px solid rgba(156,108,255,0.4);
  color: #b794ff;
  cursor: pointer;
}
.lgm-copy-btn:hover { background: rgba(156,108,255,0.28); }

.lgm-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 8px 0 14px;
}
.lgm-opt {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--lg-border);
  border-radius: 10px;
  padding: 8px 10px;
}
.lgm-opt-label { font-size: 11px; color: #9aa7bd; }
.lgm-opt-value { font-weight: 800; font-size: 14px; margin-top: 2px; }
.lgm-opt select {
  width: 100%;
  margin-top: 4px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--lg-border-strong);
  color: #fff;
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
}

.lgm-roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.lgm-roster-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--lg-border);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
  position: relative;
}
.lgm-roster-card.host { border-color: rgba(250,204,21,0.6); background: rgba(250,204,21,0.1); }
.lgm-roster-host-badge {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--lg-warn);
  color: #000;
}
.lgm-roster-empty {
  background: rgba(255,255,255,0.02);
  border: 1px dashed var(--lg-border);
  color: #5a6577;
  font-size: 12px;
  padding: 24px 8px;
}
.lgm-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #555, #333) center/cover no-repeat;
  margin: 0 auto 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; color: #fff; font-size: 18px;
  border: 2px solid transparent;
}
.lgm-avatar.guest { background: linear-gradient(135deg, #4b5563, #1f2937); }
.lgm-roster-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lgm-roster-tag {
  font-size: 10px;
  color: #9aa7bd;
  margin-top: 2px;
}

.lgm-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.lgm-actions button {
  flex: 1;
  min-width: 120px;
  padding: 12px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid var(--lg-border-strong);
  background: rgba(255,255,255,0.04);
  color: #fff;
}
.lgm-actions button.primary {
  background: linear-gradient(135deg, var(--lg-accent), var(--lg-accent-2));
  border: none;
}
.lgm-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ===== Multi 게임 화면 ===== */
.lgm-players-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px;
  margin-bottom: 8px;
  scrollbar-width: thin;
}
.lgm-pcard {
  flex: 0 0 110px;
  background: var(--lg-card-bg);
  border: 1px solid var(--lg-border);
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
  position: relative;
  transition: all 0.2s ease;
}
.lgm-pcard.current-turn {
  border-color: var(--lg-accent);
  box-shadow: 0 0 0 2px rgba(156,108,255,0.3), 0 6px 18px rgba(156,108,255,0.35);
  background: linear-gradient(180deg, rgba(156,108,255,0.18), rgba(255,108,182,0.1));
  transform: translateY(-2px);
}
.lgm-pcard.disconnected { opacity: 0.45; filter: grayscale(0.6); }
.lgm-pcard-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  margin: 0 auto 4px;
  background: linear-gradient(135deg, #555, #333) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; color: #fff; font-size: 14px;
}
.lgm-pcard-name {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lgm-pcard-stats {
  font-size: 10px;
  color: #c5cee0;
  margin-top: 4px;
  line-height: 1.5;
}
.lgm-pcard-turn-badge {
  position: absolute;
  top: -8px;
  right: -2px;
  background: var(--lg-accent-2);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  animation: lgm-pulse 1.2s ease-in-out infinite;
}
@keyframes lgm-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* ===== 턴 헤더 (현재 누구 차례) ===== */
.lgm-turn-header {
  background: linear-gradient(135deg, rgba(156,108,255,0.18), rgba(255,108,182,0.1));
  border: 1px solid rgba(156,108,255,0.4);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.lgm-turn-header-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #555, #333) center/cover no-repeat;
  flex-shrink: 0;
  font-weight: 900;
  display: flex; align-items: center; justify-content: center;
}
.lgm-turn-header-text { flex: 1; }
.lgm-turn-header-label { font-size: 11px; color: #c5cee0; }
.lgm-turn-header-name { font-size: 16px; font-weight: 800; }
.lgm-turn-header-name.you { color: var(--lg-accent-2); }
.lgm-turn-timer {
  font-size: 22px;
  font-weight: 900;
  font-family: ui-monospace, SFMono-Regular, monospace;
  min-width: 44px;
  text-align: center;
  color: var(--lg-warn);
}
.lgm-turn-timer.urgent { color: var(--lg-bad); animation: lgm-blink 0.5s infinite; }
@keyframes lgm-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ===== 비활성 상태 (남의 턴) ===== */
.lgm-spectator .lg-choice {
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.5;
}
.lgm-spectator-overlay {
  background: rgba(0,0,0,0.4);
  border: 1px dashed var(--lg-border);
  border-radius: 10px;
  padding: 8px 12px;
  text-align: center;
  font-size: 12px;
  color: #c5cee0;
  margin-top: 8px;
}

/* ===== 결과 카드 (서버 emit turnResult) ===== */
.lgm-turn-result {
  background: linear-gradient(180deg, var(--lg-card-bg-2), var(--lg-card-bg));
  border: 1px solid var(--lg-border-strong);
  border-radius: 14px;
  padding: 14px;
  margin-top: 8px;
  animation: lg-card-in 0.4s ease;
}
.lgm-turn-result-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.lgm-turn-result-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #555, #333) center/cover no-repeat;
  flex-shrink: 0;
}
.lgm-turn-result-who { font-weight: 800; font-size: 14px; flex: 1; }
.lgm-turn-result-timeout {
  font-size: 10px; padding: 2px 6px; border-radius: 6px;
  background: rgba(248,113,113,0.2); color: var(--lg-bad);
}

/* ===== 엔딩 비교 화면 ===== */
.lgm-ending-wrap {
  display: flex; flex-direction: column; gap: 12px;
}
.lgm-ending-title {
  text-align: center;
  font-size: 24px;
  font-weight: 900;
  background: linear-gradient(135deg, #b794ff, #ff8fc7);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 4px;
}
.lgm-rank-list {
  display: flex; flex-direction: column; gap: 8px;
}
.lgm-rank-card {
  background: var(--lg-card-bg);
  border: 1px solid var(--lg-border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.lgm-rank-card.first {
  border-color: rgba(250,204,21,0.6);
  background: linear-gradient(180deg, rgba(250,204,21,0.12), var(--lg-card-bg));
}
.lgm-rank-card.r2 { border-color: rgba(192,200,224,0.45); }
.lgm-rank-card.r3 { border-color: rgba(255,157,61,0.45); }
.lgm-rank-card.me {
  border-color: rgba(56,189,248,0.65);
  box-shadow: 0 0 14px rgba(56,189,248,0.28);
}
.lgm-rank-card.me.first { box-shadow: 0 0 16px rgba(250,204,21,0.4), 0 0 14px rgba(56,189,248,0.25); }
.lgm-rank-me-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  background: rgba(56,189,248,0.18);
  border: 1px solid rgba(56,189,248,0.5);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  color: #7dd3fc;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.lgm-rank-num {
  font-size: 24px;
  font-weight: 900;
  width: 36px;
  text-align: center;
  font-family: ui-monospace, monospace;
}
.lgm-rank-num.first { color: var(--lg-warn); }
.lgm-rank-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #555, #333) center/cover no-repeat;
  flex-shrink: 0;
}
.lgm-rank-info { flex: 1; min-width: 0; }
.lgm-rank-name { font-weight: 800; font-size: 15px; }
.lgm-rank-ending {
  font-size: 12px;
  color: #c5cee0;
  margin-top: 2px;
  display: flex; align-items: center; gap: 4px;
}
.lgm-rank-score {
  font-weight: 900;
  font-size: 18px;
  color: var(--lg-accent);
  font-family: ui-monospace, monospace;
}

.lgm-cats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.lgm-cat {
  background: var(--lg-card-bg);
  border: 1px solid var(--lg-border);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
.lgm-cat-emoji { font-size: 24px; }
.lgm-cat-label { font-size: 11px; color: #9aa7bd; }
.lgm-cat-winner {
  font-weight: 800; font-size: 13px; margin-top: 4px;
  display: flex; align-items: center; gap: 5px;
  justify-content: center;
  min-width: 0;
}
.lgm-cat-winner-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  max-width: 80px;
}
.lgm-cat-winner-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  flex: 0 0 auto;
  background-size: cover; background-position: center;
  background-color: rgba(140, 160, 220, 0.18);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #14080a;
  border: 1.5px solid rgba(250, 204, 21, 0.55);
  box-shadow: 0 0 6px rgba(250, 204, 21, 0.3);
}
.lgm-cat-winner-avatar-empty {
  background: transparent;
  border-color: rgba(140, 160, 220, 0.2);
  color: #6a6a76;
  box-shadow: none;
}
.lgm-cat-value { font-size: 11px; color: var(--lg-accent-2); margin-top: 2px; }

@media (max-width: 480px) {
  .lgm-pcard { flex: 0 0 96px; }
  .lgm-options { grid-template-columns: 1fr; }
  .lgm-entry-row { grid-template-columns: 1fr; }
}

/* ============================================================
   MULTI: 결과 상세 모달 (각 플레이어 엔딩 카드)
   - 솔로 .lg-ending-* 재사용 (lg-ending, lg-ending-emoji, lg-ending-title 등)
   - 랭킹 카드 클릭 / [결과 보기] 버튼으로 오픈
   - ◀ ▶ 좌우 이동 / ESC / 바깥 클릭 / X 버튼으로 닫기
   ============================================================ */
.lgm-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  backdrop-filter: blur(6px);
}
.lgm-detail-overlay.hidden { display: none; }
.lgm-detail-box {
  position: relative;
  background: var(--lg-card-bg);
  border: 1px solid var(--lg-border-strong);
  border-radius: 18px;
  padding: 14px 14px 14px;
  max-width: 480px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--lg-shadow);
}
.lgm-detail-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--lg-border);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lgm-detail-close:hover {
  background: rgba(248, 113, 113, 0.3);
  border-color: var(--lg-bad);
}
.lgm-detail-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding-right: 36px; /* close btn 자리 */
}
.lgm-detail-arrow {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--lg-border);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}
.lgm-detail-arrow:hover {
  background: rgba(156, 108, 255, 0.2);
  border-color: var(--lg-accent);
}
.lgm-detail-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.lgm-detail-page {
  font-size: 12px;
  color: #9aa7bd;
  font-weight: 700;
}
.lgm-rank-card {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.lgm-rank-card:hover {
  border-color: var(--lg-border-strong);
  background: rgba(156, 108, 255, 0.06);
}
.lgm-rank-detail-btn {
  flex-shrink: 0;
  padding: 6px 10px;
  border: 1px solid var(--lg-border-strong);
  border-radius: 999px;
  background: rgba(156, 108, 255, 0.18);
  color: #b794ff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  margin-left: 6px;
}
.lgm-rank-detail-btn:hover {
  background: rgba(156, 108, 255, 0.32);
}

@media (max-width: 480px) {
  .lgm-detail-box { padding: 10px; }
  .lgm-detail-arrow { width: 32px; height: 32px; }
}

/* ============================================================
   PC SIDE AD — 1200px 이상에서만 표시 (모바일/태블릿 숨김)
   - 게임 화면 중앙 + 좌우 대칭 사이드 광고
   - sticky로 스크롤 따라옴, 게임 UI 가림 금지
   ============================================================ */
.lg-side-ad { display: none; }

@media (min-width: 1200px) {
  .lg-page-shell {
    display: grid;
    /* [좌측 광고] [게임] [우측 광고] */
    grid-template-columns: 180px minmax(0, 1fr) 180px;
    gap: 24px;
    align-items: start;
    max-width: 1148px; /* 180 + 24 + 720 + 24 + 180 + 20(padding) */
    margin: 0 auto;
    padding: 0 12px;
  }
  /* grid 내부에서는 lg-app의 자체 max-width 풀고 grid 셀에 맞춤 */
  .lg-page-shell > .lg-app {
    max-width: none;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
  }
  .lg-side-ad {
    display: block;
    position: sticky;
    top: 88px;
    width: 160px;
    min-height: 600px;
    background: transparent;
  }
  .lg-side-ad ins.adsbygoogle {
    width: 160px !important;
    min-height: 600px;
  }
}

/* ============================================================
   1199px 이하 (태블릿/모바일): 좌우 광고 모두 숨김
   - 게임 컨테이너는 단일 column으로 자동 복귀 (grid 미적용)
   ============================================================ */

/* ===== Rules box (entry 게임 룰) — 멀티 인생게임 ===== */
.lgm-rules-box {
  margin-top: 16px;
  padding: 12px 14px;
  background: rgba(156,108,255,0.06);
  border: 1px solid rgba(156,108,255,0.25);
  border-radius: 12px;
  text-align: left;
}
.lgm-rules-title {
  font-size: 12px; font-weight: 800; color: var(--lg-accent);
  margin-bottom: 6px; letter-spacing: 0.5px;
}
.lgm-rules-list { padding-left: 20px; margin: 0; font-size: 12px; color: #c5cee0; line-height: 1.6; }
.lgm-rules-list li { margin: 2px 0; }

/* ===== Other multi games shortcut ===== */
.lgm-other-games {
  margin-top: 16px;
  padding: 14px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--lg-border);
  border-radius: 14px;
}
.lgm-other-games-title {
  font-size: 12px;
  font-weight: 800;
  color: #c5cee0;
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}
.lgm-other-games-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.lgm-other-game-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--lg-border);
  border-radius: 10px;
  text-decoration: none;
  color: #fff;
  transition: all 0.15s ease;
}
.lgm-other-game-card:hover {
  border-color: var(--lg-accent);
  background: rgba(156,108,255,0.08);
  transform: translateY(-2px);
}
.lgm-other-game-emoji { font-size: 24px; line-height: 1; }
.lgm-other-game-title { font-size: 12px; font-weight: 800; }
.lgm-other-game-sub { font-size: 10px; color: #9aa7bd; text-align: center; }
.lgm-other-games-more {
  display: block;
  margin-top: 10px;
  text-align: center;
  font-size: 11px;
  color: var(--lg-accent);
  text-decoration: none;
  padding: 6px;
}
.lgm-other-games-more:hover { text-decoration: underline; }
@media (max-width: 380px) {
  .lgm-other-game-sub { display: none; }
  .lgm-other-game-card { padding: 10px 4px; }
}

/* ============================================================
   v20260514_1 — 성별 선택 / 특수 이벤트 / 관계 / 희귀도 뱃지
   ============================================================ */

/* ===== 성별 선택 (setup 화면) ===== */
.lg-gender-label {
  font-size: 12px;
  color: #9aa7bd;
  margin: 6px 0 6px;
  text-align: center;
}
.lg-gender-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  width: 100%;
  max-width: 320px;
  margin: 0 auto 14px;
}
.lg-gender-btn {
  padding: 10px 6px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--lg-border-strong);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  color: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}
.lg-gender-btn:hover {
  background: rgba(156,108,255,0.10);
  border-color: rgba(156,108,255,0.5);
}
.lg-gender-btn.selected {
  background: linear-gradient(135deg, rgba(156,108,255,0.30), rgba(255,108,182,0.22));
  border-color: var(--lg-accent);
  box-shadow: 0 4px 14px rgba(156,108,255,0.25);
}

/* ===== 특수 이벤트 — glow + 강조 카드 ===== */
.lg-event-card[data-special="special"] {
  border-color: rgba(255,108,182,0.55);
  background: linear-gradient(180deg, #1f1530 0%, #181126 100%);
  box-shadow:
    0 0 0 1px rgba(255,108,182,0.25) inset,
    0 10px 40px rgba(255, 108, 182, 0.25),
    0 0 60px rgba(156, 108, 255, 0.18);
  animation: lg-special-in 0.5s ease, lg-special-pulse 3.2s ease-in-out infinite;
}
@keyframes lg-special-in {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes lg-special-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255,108,182,0.25) inset, 0 10px 40px rgba(255,108,182,0.25), 0 0 60px rgba(156,108,255,0.18); }
  50% { box-shadow: 0 0 0 1px rgba(255,108,182,0.45) inset, 0 14px 50px rgba(255,108,182,0.35), 0 0 80px rgba(156,108,255,0.28); }
}
.lg-special-tag {
  background: linear-gradient(135deg, rgba(255,108,182,0.20), rgba(156,108,255,0.20));
  color: #ffb1d6;
  border-color: rgba(255,108,182,0.55);
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* ===== 장기(longterm) 결과 이벤트 ===== */
.lg-event-card[data-special="longterm"] {
  border-color: rgba(250,204,21,0.50);
  background: linear-gradient(180deg, #1f1c12 0%, #181610 100%);
  box-shadow:
    0 0 0 1px rgba(250,204,21,0.22) inset,
    0 10px 36px rgba(250,204,21,0.18);
}
.lg-longterm-tag {
  background: rgba(250,204,21,0.18);
  color: #facc15;
  border-color: rgba(250,204,21,0.45);
  font-weight: 800;
}
.lg-choice-lt {
  top: auto;
  bottom: 8px;
  right: 10px;
  background: rgba(250,204,21,0.22);
  color: #facc15;
}

/* ===== 관계 chip (HUD 옆) ===== */
.lg-relations {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.lg-rel-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: #c5cee0;
}

.lg-ending-relations {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin: 10px 0;
}

/* ===== 엔딩 희귀도 뱃지 ===== */
.lg-ending-rarity {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 4px 12px;
  border-radius: 999px;
  margin: 8px auto 0;
  text-align: center;
}
.lg-rarity-hidden {
  background: linear-gradient(135deg, rgba(156,108,255,0.30), rgba(255,108,182,0.25));
  color: #ffb1d6;
  border: 1px solid rgba(255,108,182,0.55);
  box-shadow: 0 0 14px rgba(255,108,182,0.35);
}
.lg-rarity-rare {
  background: rgba(250,204,21,0.18);
  color: #facc15;
  border: 1px solid rgba(250,204,21,0.40);
}

/* ===== 멀티 결과 카드 — 특수/장기 표시 (선택사항) ===== */
.lgm-event-card[data-special="special"] {
  border-color: rgba(255,108,182,0.55) !important;
  box-shadow: 0 0 0 1px rgba(255,108,182,0.25) inset, 0 10px 40px rgba(255,108,182,0.25) !important;
}
.lgm-event-card[data-special="longterm"] {
  border-color: rgba(250,204,21,0.50) !important;
}

/* ===== v20260514_2 — 초대 링크 (공통 lgm-*) ===== */
.lgm-invite-link-wrap {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--lg-border);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
}
.lgm-invite-link-label {
  font-size: 11px;
  color: #9aa7bd;
  margin-bottom: 4px;
}
.lgm-invite-link {
  width: 100%;
  padding: 6px 8px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 6px;
  background: rgba(0,0,0,0.30);
  color: #c5cee0;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  cursor: pointer;
  user-select: all;
}
.lgm-invite-link:focus {
  outline: none;
  border-color: var(--lg-accent);
}

/* ============================================================
   SEO 섹션 — 게임 페이지 하단 검색엔진용 텍스트 정보
   ============================================================ */
.seo-info {
  margin: 32px auto 24px;
  max-width: 720px;
  padding: 20px 18px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--lg-border);
  border-radius: 12px;
  color: var(--lg-text-dim);
  font-size: 13px;
  line-height: 1.7;
}
.seo-info h2 {
  font-size: 16px;
  color: var(--lg-text);
  margin: 0 0 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.seo-info h3 {
  font-size: 14px;
  color: var(--lg-text);
  margin: 18px 0 8px;
  font-weight: 700;
}
.seo-info p { margin: 6px 0; }
.seo-info ul { margin: 8px 0; padding-left: 22px; }
.seo-info li { margin: 4px 0; }
.seo-info dl {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px 12px;
  margin: 10px 0;
}
.seo-info dt {
  font-weight: 700;
  color: var(--lg-text);
  font-size: 12px;
}
.seo-info dd { margin: 0; font-size: 12px; }
.seo-info a { color: var(--lg-accent); text-decoration: none; }
.seo-info a:hover { text-decoration: underline; }

/* 게임 진행 중(entry/setup이 아닌 다른 화면 활성)일 때 SEO 섹션 자동 숨김
   — 모든 게임 화면 클래스 매칭: .lg-screen, .fb-screen, .lr-screen, .ox-screen, .bp-screen, .cg-screen, .om-screen 등
   - entry는 ID가 "Entry"로 끝남 (lrEntry/bpEntry/cgEntry/omEntry/fbEntry/oxEntry/lgmEntry)
   - lifegame solo는 "Setup" (lgSetup)
   - SEO 봇은 SSR/초기 HTML에서 여전히 보임 (그땐 entry가 active이므로) */
main:has([class*="-screen"].active:not([id$="Entry"]):not([id$="Setup"])) .seo-info {
  display: none;
}

/* ============================================================
   gamezone 게임 카드 — 메타 칩 (인원/팀전/카테고리/모바일)
   ============================================================ */
.gz-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--lg-border);
}
.gz-card-meta-chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--lg-border);
  color: var(--lg-text-dim);
  font-weight: 600;
  white-space: nowrap;
}
.gz-card-meta-chip.team {
  background: linear-gradient(135deg, rgba(236,72,153,0.18), rgba(190,24,93,0.12));
  border-color: rgba(236,72,153,0.45);
  color: #f9a8d4;
}

/* ============================================================
   gamezone 추천 섹션 — 상황별/인원별
   ============================================================ */
.gz-recommend {
  margin: 36px auto 24px;
  max-width: 1200px;
  padding: 0 12px;
}
.gz-recommend-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--lg-text);
  margin: 0 0 18px;
  text-align: center;
  letter-spacing: 0.5px;
}
.gz-recommend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.gz-rec-block {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--lg-border);
  border-radius: 12px;
  padding: 16px 18px;
  transition: border-color .2s;
}
.gz-rec-block:hover {
  border-color: var(--lg-accent);
}
.gz-rec-block h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--lg-accent);
  margin: 0 0 10px;
  letter-spacing: 0.3px;
}
.gz-rec-block ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.gz-rec-block li {
  padding: 4px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--lg-text-dim);
}
.gz-rec-block li a {
  color: var(--lg-text);
  text-decoration: none;
  font-weight: 600;
}
.gz-rec-block li a:hover {
  color: var(--lg-accent);
  text-decoration: underline;
}
.gz-rec-note {
  font-size: 11px;
  color: var(--lg-text-dim);
  margin: 8px 0 0;
  opacity: 0.8;
  font-style: italic;
}
@media (max-width: 480px) {
  .gz-recommend-title { font-size: 18px; }
  .gz-rec-block { padding: 12px 14px; }
}
.seo-info-tags {
  margin-top: 14px;
  font-size: 11px;
  color: var(--lg-text-dim);
  opacity: 0.7;
}
@media (max-width: 480px) {
  .seo-info dl { grid-template-columns: 90px 1fr; }
}

/* ============================================================
   v20260516_2 — 시각 강화: 단계별 컬러 + progress + popup + 모먼트
   ============================================================ */

/* ===== 인생 단계 progress bar (PLAY 상단) ===== */
.lg-stage-progress {
  position: relative;
  margin-bottom: 16px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--lg-card-bg-2, #2a1f3a) 0%, var(--lg-card-bg, #1d1729) 100%);
  border: 1px solid var(--lg-border, rgba(156,108,255,0.25));
  border-radius: 14px;
  box-shadow: var(--lg-shadow, 0 4px 16px rgba(0,0,0,0.4));
}
.lg-stage-progress-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: #b8c4dd; margin-bottom: 8px;
  font-weight: 700; letter-spacing: 0.3px;
}
.lg-stage-progress-name {
  font-size: 14px; font-weight: 900;
  background: linear-gradient(135deg, #b794ff, #ff8fc7);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lg-stage-progress-turn { color: #9aa7bd; font-variant-numeric: tabular-nums; }
.lg-stage-progress-bar {
  position: relative;
  height: 10px;
  background: rgba(0,0,0,0.35);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}
.lg-stage-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #b794ff 0%, #ff8fc7 50%, #ffd166 100%);
  border-radius: 6px;
  transition: width 0.6s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 0 12px rgba(255, 143, 199, 0.5), inset 0 1px 0 rgba(255,255,255,0.3);
  position: relative;
}
.lg-stage-progress-fill::after {
  content: "";
  position: absolute; right: -8px; top: 50%;
  width: 16px; height: 16px;
  background: radial-gradient(circle, #fff 0%, #ffd166 60%, transparent 80%);
  border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: 0 0 12px #ffd166;
}
/* 단계 마커 (5개 stage 표시) */
.lg-stage-progress-markers {
  display: flex; justify-content: space-between;
  margin-top: 6px;
  font-size: 10px; color: #7d6f95;
}
.lg-stage-progress-marker.active { color: #b794ff; font-weight: 800; }

/* ===== 이벤트 카드 단계별 컬러 ===== */
.lg-event-card { position: relative; overflow: hidden; }
.lg-event-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--lg-stage-color, #b794ff);
  box-shadow: 0 0 12px var(--lg-stage-color, #b794ff);
}
.lg-event-card[data-stage="infant"]   { --lg-stage-color: #ffd166; --lg-stage-bg: rgba(255, 209, 102, 0.06); }
.lg-event-card[data-stage="child"]    { --lg-stage-color: #66e9a8; --lg-stage-bg: rgba(102, 233, 168, 0.06); }
.lg-event-card[data-stage="teen"]     { --lg-stage-color: #4ecdc4; --lg-stage-bg: rgba(78, 205, 196, 0.06); }
.lg-event-card[data-stage="adult"]    { --lg-stage-color: #b794ff; --lg-stage-bg: rgba(183, 148, 255, 0.06); }
.lg-event-card[data-stage="midlife"]  { --lg-stage-color: #ff8fc7; --lg-stage-bg: rgba(255, 143, 199, 0.06); }
.lg-event-card[data-stage]:not([data-stage=""]) {
  background:
    linear-gradient(180deg, var(--lg-stage-bg, transparent) 0%, transparent 70%),
    linear-gradient(180deg, var(--lg-card-bg-2, #2a1f3a) 0%, var(--lg-card-bg, #1d1729) 100%);
  border-color: var(--lg-stage-color, var(--lg-border, #2c3445));
}

.lg-event-emoji {
  text-shadow: 0 4px 16px rgba(0,0,0,0.4);
  filter: drop-shadow(0 0 12px var(--lg-stage-color, rgba(255,255,255,0.1)));
  animation: lg-event-emoji-float 3s ease-in-out infinite;
}
@keyframes lg-event-emoji-float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ===== 선택지 강화 ===== */
.lg-choice {
  position: relative;
  overflow: hidden;
  transition: transform 0.18s cubic-bezier(.34,1.56,.64,1), box-shadow 0.2s, border-color 0.2s, background 0.2s;
}
.lg-choice::before {
  content: "";
  position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  transition: left 0.5s;
}
.lg-choice:hover:not(:disabled)::before { left: 200%; }
.lg-choice:hover:not(:disabled) {
  transform: translateX(4px) scale(1.02);
  box-shadow: 0 6px 18px rgba(156, 108, 255, 0.25), 0 0 0 2px rgba(183, 148, 255, 0.4);
  border-color: #b794ff;
}

/* ===== 스탯 +/- popup (떠오름) ===== */
.lg-stat-popup {
  position: fixed;
  pointer-events: none;
  font-weight: 900;
  font-size: 22px;
  z-index: 2500;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  animation: lg-stat-popup 1.4s cubic-bezier(.34,1.56,.64,1) forwards;
  white-space: nowrap;
}
.lg-stat-popup-up { color: #66e9a8; text-shadow: 0 0 12px rgba(102,233,168,0.6), 0 2px 8px rgba(0,0,0,0.6); }
.lg-stat-popup-down { color: #ff6b6b; text-shadow: 0 0 12px rgba(255,107,107,0.6), 0 2px 8px rgba(0,0,0,0.6); }
.lg-stat-popup-money { color: #ffd166; text-shadow: 0 0 12px rgba(255,209,102,0.7), 0 2px 8px rgba(0,0,0,0.6); }
@keyframes lg-stat-popup {
  0%   { opacity: 0; transform: translate(-50%, 10px) scale(0.6); }
  20%  { opacity: 1; transform: translate(-50%, -10px) scale(1.2); }
  60%  { opacity: 1; transform: translate(-50%, -40px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -70px) scale(0.9); }
}

/* ===== flag 획득 모먼트 ===== */
.lg-flag-moment {
  position: fixed; top: 30%; left: 50%;
  transform: translateX(-50%);
  padding: 16px 28px;
  background: linear-gradient(135deg, #ffd166 0%, #ff8fc7 50%, #b794ff 100%);
  color: #1d1729;
  border-radius: 14px;
  font-size: 18px; font-weight: 900;
  letter-spacing: 1px;
  box-shadow: 0 12px 40px rgba(183, 148, 255, 0.5);
  pointer-events: none; z-index: 2400;
  animation: lg-flag-moment 2s cubic-bezier(.34,1.56,.64,1) forwards;
}
@keyframes lg-flag-moment {
  0%   { opacity: 0; transform: translate(-50%, 30px) scale(0.5) rotate(-5deg); }
  20%  { opacity: 1; transform: translate(-50%, 0) scale(1.1) rotate(2deg); }
  40%  { transform: translate(-50%, 0) scale(1) rotate(0); }
  85%  { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -20px) scale(0.95); }
}

/* ===== 엔딩 화면 — 등급별 톤 + 풀스크린 느낌 ===== */
.lg-ending {
  position: relative;
  overflow: hidden;
}
.lg-ending::before {
  content: "";
  position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: conic-gradient(from 0deg, transparent 0deg, var(--lg-ending-glow, rgba(183,148,255,0.08)) 90deg, transparent 180deg);
  animation: lg-ending-rotate 25s linear infinite;
  pointer-events: none;
}
@keyframes lg-ending-rotate { to { transform: rotate(360deg); } }
.lg-ending > * { position: relative; z-index: 1; }

/* 등급별 — badge.S / .A / .B / .C / .F */
.lg-ending[data-grade="S"] {
  --lg-ending-glow: rgba(255, 209, 102, 0.18);
  border-color: #ffd166;
  box-shadow: 0 12px 48px rgba(255, 209, 102, 0.3);
}
.lg-ending[data-grade="S"] .lg-ending-badge {
  background: linear-gradient(135deg, #ffd166, #ff8fc7);
  color: #1d1729; border-color: transparent;
  text-shadow: 0 1px 2px rgba(255,255,255,0.3);
}
.lg-ending[data-grade="A"] {
  --lg-ending-glow: rgba(102, 233, 168, 0.12);
  border-color: #66e9a8;
}
.lg-ending[data-grade="A"] .lg-ending-badge { background: rgba(102,233,168,0.2); color: #66e9a8; border-color: rgba(102,233,168,0.5); }
.lg-ending[data-grade="B"] {
  --lg-ending-glow: rgba(78, 205, 196, 0.1);
}
.lg-ending[data-grade="B"] .lg-ending-badge { background: rgba(78,205,196,0.2); color: #4ecdc4; border-color: rgba(78,205,196,0.5); }
.lg-ending[data-grade="C"] {
  --lg-ending-glow: rgba(156, 108, 255, 0.08);
}
.lg-ending[data-grade="F"] {
  --lg-ending-glow: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.4);
}
.lg-ending[data-grade="F"] .lg-ending-badge { background: rgba(255,107,107,0.2); color: #ff6b6b; border-color: rgba(255,107,107,0.5); }

.lg-ending-emoji { animation: lg-ending-emoji-pop 1s cubic-bezier(.34,1.56,.64,1); }
@keyframes lg-ending-emoji-pop {
  0% { transform: scale(0) rotate(-15deg); opacity: 0; }
  50% { transform: scale(1.3) rotate(8deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}

/* ===== 스탯 카드 강화 ===== */
.lg-stats { padding: 8px; background: linear-gradient(135deg, rgba(0,0,0,0.2) 0%, transparent 100%); border-radius: 12px; }
.lg-stat {
  transition: background 0.3s, transform 0.3s;
  position: relative;
}
.lg-stat-emoji {
  transition: transform 0.3s, filter 0.3s;
}
.lg-stat.flash-up .lg-stat-emoji,
.lg-stat.flash-money-up .lg-stat-emoji {
  filter: drop-shadow(0 0 8px currentColor);
  transform: scale(1.3);
}

/* 단계 전환 모먼트 */
.lg-stage-transition {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 2300;
  pointer-events: none;
  animation: lg-stage-fade 2.5s ease-in-out forwards;
}
.lg-stage-transition-text {
  font-size: 56px; font-weight: 900;
  background: linear-gradient(135deg, #b794ff, #ff8fc7, #ffd166);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: 4px;
  text-shadow: 0 4px 24px rgba(0,0,0,0.4);
  animation: lg-stage-text-pop 1.8s cubic-bezier(.34,1.56,.64,1);
}
@keyframes lg-stage-fade {
  0% { background: rgba(0,0,0,0.7); }
  60% { background: rgba(0,0,0,0.7); }
  100% { background: rgba(0,0,0,0); }
}
@keyframes lg-stage-text-pop {
  0% { transform: scale(0.3) rotate(-8deg); opacity: 0; }
  30% { transform: scale(1.2) rotate(3deg); opacity: 1; }
  70% { transform: scale(1) rotate(0); opacity: 1; }
  100% { transform: scale(1.1) translateY(-10px); opacity: 0; }
}

/* 짧은 뷰포트 컴팩트 — lifegame 공용 (lgm 카드/HUD 축소) */
@media (max-height: 720px){
  .lg-setup{ padding: 14px 18px; }
  .lg-setup-emoji{ font-size: 38px; }
  .lg-setup-title{ font-size: 22px; }
  .lg-setup-sub{ font-size: 12px; }
  .lg-setup-input{ padding: 8px 10px; font-size: 14px; }
  .lg-setup-btn{ padding: 10px 14px; font-size: 14px; }
  .lgm-pcard{ flex: 0 0 110px; }
  .lgm-pcard-avatar{ width: 36px; height: 36px; }
  .lgm-pcard-name{ font-size: 12px; }
  .lgm-pcard-stats{ font-size: 11px; }
}
@media (max-height: 560px){
  .lg-setup-emoji{ font-size: 26px; }
  .lg-setup-title{ font-size: 18px; }
  .lg-setup-sub, .lg-setup-hint{ display: none; }
  .lgm-pcard{ flex: 0 0 88px; }
  .lgm-pcard-avatar{ width: 28px; height: 28px; }
}

