/* __PHASE_20B_SPLIT__ index.html 에서 그대로 이사한 CSS (내용 무변경, 20차) */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: #0a0a1a;
  color: #fff;
  /* Phase 2zd : Noto Color Emoji fallback — 모든 OS 이모지 균일 */
  font-family: 'Segoe UI', 'Noto Sans KR', system-ui, -apple-system, sans-serif, 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji';
  overflow: hidden;
  height: 100vh;
}

/* ===== 진영 선택 화면 ===== */
#faction-select {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
  z-index: 100;
}
#faction-select .fs-title {
  font-size: 22px; color: #ccc; margin-bottom: 6px; font-weight: 600;
}
#faction-select .fs-sub {
  color: #666; font-size: 13px; margin-bottom: 32px; text-align: center; line-height: 1.6;
}
#faction-select .fs-sub b { color: #7fc8ff; }
#faction-select .fs-back {
  position: absolute; top: 24px; left: 24px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  color: #888; font-size: 13px; padding: 8px 16px;
  border-radius: 6px; cursor: pointer; letter-spacing: 1px;
  transition: background 0.15s, color 0.15s;
  z-index: 110;
}
#faction-select .fs-back:hover { background: rgba(255,255,255,0.12); color: #ccc; }
.faction-cards { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; padding: 0 20px; }
.faction-card {
  width: 200px; border-radius: 20px;
  cursor: pointer; transition: all 0.3s ease; text-align: center;
  border: 2px solid rgba(255,255,255,0.08); position: relative; overflow: hidden;
  background: rgba(255,255,255,0.04); padding: 28px 16px 22px;
}
.faction-card:hover { transform: translateY(-8px); }
.faction-card .fc-emoji { font-size: 72px; margin-bottom: 12px; display: block; transition: transform 0.3s; }
.faction-card:hover .fc-emoji { transform: scale(1.15); }
.faction-card .fc-name { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.faction-card .fc-skill { font-size: 12px; color: #888; margin-bottom: 10px; }
.faction-card .fc-desc { font-size: 11px; color: #666; line-height: 1.5; }
.faction-card .fc-btn {
  margin-top: 14px; padding: 8px 0; border-radius: 10px; font-size: 13px; font-weight: 600;
  border: none; cursor: pointer; width: 100%; transition: all 0.2s;
}

.faction-card.scissors:hover { border-color: #ff6b6b; box-shadow: 0 8px 30px rgba(255,107,107,0.2); }
.faction-card.scissors .fc-name { color: #ff6b6b; }
.faction-card.scissors .fc-btn { background: rgba(255,107,107,0.15); color: #ff6b6b; }
.faction-card.scissors .fc-btn:hover { background: rgba(255,107,107,0.3); }

.faction-card.rock:hover { border-color: #74b9ff; box-shadow: 0 8px 30px rgba(116,185,255,0.2); }
.faction-card.rock .fc-name { color: #74b9ff; }
.faction-card.rock .fc-btn { background: rgba(116,185,255,0.15); color: #74b9ff; }
.faction-card.rock .fc-btn:hover { background: rgba(116,185,255,0.3); }

.faction-card.paper:hover { border-color: #55efc4; box-shadow: 0 8px 30px rgba(85,239,196,0.2); }
.faction-card.paper .fc-name { color: #55efc4; }
.faction-card.paper .fc-btn { background: rgba(85,239,196,0.15); color: #55efc4; }
.faction-card.paper .fc-btn:hover { background: rgba(85,239,196,0.3); }

/* ===== 게임 화면 ===== */
#game-container { display: none; width: 100vw; height: 100vh; position: relative; }
canvas { display: block; }

/* HUD */
#hud {
  position: fixed; top: 0; left: 0; right: 0;
  padding: 10px 20px; display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, transparent 100%);
  pointer-events: none; z-index: 10;
}
.hud-left, .hud-right, .hud-center { display: flex; gap: 16px; align-items: center; }
.hud-center {
  position: absolute; left: 50%; top: 10px; transform: translateX(-50%);
}
.hud-item {
  font-size: 14px; padding: 4px 12px; border-radius: 8px;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
}
.hud-item .label { color: #888; font-size: 11px; }
.hud-item .value { font-weight: bold; font-size: 16px; }
.hud-timer .value { font-variant-numeric: tabular-nums; }
.hud-timer.warn .value { color: #ff6666; animation: timerPulse 0.6s ease-in-out infinite; }
/* 시간 알림 배너 */
.time-alert {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.85); border: 2px solid #ff6644; border-radius: 12px;
  padding: 10px 28px; color: #ffcc44; font-size: 22px; font-weight: bold;
  text-align: center; z-index: 300; pointer-events: none;
  animation: alertPop 0.5s ease-out;
  text-shadow: 0 0 10px rgba(255,204,68,0.5);
}
.time-alert.countdown {
  font-size: 44px; padding: 16px 40px; border-color: #ff4444;
  color: #ff4444; text-shadow: 0 0 20px rgba(255,68,68,0.6);
}
@keyframes alertPop {
  0% { opacity:0; transform: translateX(-50%) scale(0.7); }
  100% { opacity:1; transform: translateX(-50%) scale(1); }
}
@keyframes timerPulse {
  0%, 100% { text-shadow: 0 0 0 rgba(255,80,80,0); }
  50% { text-shadow: 0 0 10px rgba(255,80,80,0.9); }
}
.hud-pebble .value { color: #ffe082; }

/* 영역 점유율 바 */
#territory-bar {
  position: fixed; bottom: 0; left: 0; right: 0; height: 6px;
  display: flex; z-index: 10;
}
#territory-bar div { height: 100%; transition: width 0.5s; }

/* 영토 순위 패널 */
#territory-panel {
  position: fixed; bottom: 14px; left: 12px; z-index: 11;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
  padding: 0; border-radius: 10px;
  font-size: 12px; width: 240px; height: 92px;
  border: 1px solid rgba(255,255,255,0.1);
}
.tb-row {
  position: absolute;
  left: 8px; right: 8px; height: 22px;
  display: flex; align-items: center; gap: 6px;
  padding: 0 6px; border-radius: 6px;
  transition: top 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.3s, box-shadow 0.3s;
}
.tb-medal { width: 18px; text-align: center; font-size: 13px; }
.tb-name  { width: 90px; font-weight: bold; white-space: nowrap; }
.tb-pct {
  flex: 1; text-align: right;
  font-variant-numeric: tabular-nums; color: #ddd;
}
.tb-bonus {
  width: 44px; text-align: right;
  color: #ffd54a; font-weight: bold;
  text-shadow: 0 0 6px rgba(255,213,74,0.6);
  font-variant-numeric: tabular-nums;
}
.tb-row.tb-rank-1 {
  background: linear-gradient(90deg, rgba(255,215,0,0.22), rgba(255,165,0,0.18));
  box-shadow: 0 0 10px rgba(255,215,0,0.4);
  animation: rankGlow 2s ease-in-out infinite;
}
.tb-row.tb-rank-2 {
  background: rgba(255,255,255,0.06);
}
@keyframes rankGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(255,215,0,0.35); }
  50%      { box-shadow: 0 0 16px rgba(255,215,0,0.7); }
}

/* 팀별 상위 3인 패널 (슬라이딩 전환) */
#top-players-panel {
  position: fixed; bottom: 118px; left: 12px; z-index: 11;
  width: 240px;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
  padding: 8px 10px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 11px; overflow: hidden;
  pointer-events: none;
}
#top-players-panel .tp-header {
  display: flex; align-items: center; gap: 6px;
  padding-bottom: 6px; margin-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  font-weight: bold; font-size: 12px;
}
#top-players-panel .tp-medal { font-size: 14px; }
#top-players-panel .tp-team  { flex: 1; color: #fff; }
#top-players-panel .tp-label { font-size: 10px; color: #aaa; font-weight: normal; }
#top-players-panel .tp-rows {
  position: relative;
  min-height: 56px;
}
#top-players-panel.tp-anim .tp-rows {
  animation: tpSlide 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
#top-players-panel.tp-anim .tp-header {
  animation: tpSlide 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes tpSlide {
  0%   { opacity: 0; transform: translateY(-14px); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0); }
}
#top-players-panel .tp-row {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 4px; border-radius: 4px;
  margin-bottom: 2px;
}
#top-players-panel .tp-row .tp-rk {
  width: 16px; text-align: center;
  font-weight: bold; color: #ffd54a;
  font-variant-numeric: tabular-nums;
}
#top-players-panel .tp-row .tp-nm {
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: #eee;
}
#top-players-panel .tp-row .tp-sc {
  font-variant-numeric: tabular-nums; color: #ccc;
  font-size: 10px;
}
#top-players-panel .tp-row.tp-me {
  background: rgba(255,215,0,0.15);
  box-shadow: 0 0 6px rgba(255,215,0,0.3);
}
#top-players-panel .tp-row.tp-me .tp-nm { color: #ffd54a; font-weight: bold; }

/* 킬 로그 — __PHASE_XF_A2_BADGE_LEFT__ 우상단 그대로 (XF-A 롤백) */
#kill-log {
  position: fixed; top: 60px; right: 16px; z-index: 10;
  pointer-events: none; display: flex; flex-direction: column; gap: 4px;
}
.kill-entry {
  font-size: 12px; padding: 4px 10px; border-radius: 6px;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  animation: fadeIn 0.3s, fadeOut 0.5s 4s forwards;
  white-space: nowrap;
}
@keyframes fadeIn { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }
@keyframes fadeOut { from { opacity:1; } to { opacity:0; } }

/* 미니맵 */
#minimap-container {
  position: fixed; bottom: 42px; right: 16px; z-index: 10; /* __PHASE_ZD_MINIMAP_UP__ 개인정보처리방침 안 겹치게 살짝 위로 */
  border: 2px solid rgba(255,255,255,0.2); border-radius: 8px; overflow: hidden;
}

/* 스킬 게이지 */
#skill-bar {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 10; text-align: center; pointer-events: none;
}
#skill-gauge-bg {
  width: 200px; height: 10px; background: rgba(255,255,255,0.15);
  border-radius: 5px; overflow: hidden; margin: 0 auto 4px;
}
#skill-gauge-fill { height: 100%; width: 0%; border-radius: 5px; transition: width 0.3s; }
#skill-label { font-size: 11px; color: #aaa; }
#skill-warning {
  font-size: 13px; color: #ff8844; font-weight: bold;
  opacity: 0; transition: opacity 0.2s;
  pointer-events: none; margin-bottom: 4px;
}

/* 부활 화면 */
#respawn-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: none; align-items: center; justify-content: center;
  flex-direction: column; z-index: 50;
}
#respawn-overlay .msg { font-size: 28px; font-weight: bold; margin-bottom: 8px; }
#respawn-overlay .timer { font-size: 18px; color: #aaa; }

/* 일시정지 메뉴 */
#pause-menu {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.8); z-index: 200;
  flex-direction: column; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
}
#pause-menu h2 {
  font-size: 36px; margin-bottom: 12px; color: #fff;
  font-family: 'Georgia', serif; letter-spacing: 2px;
}
#pause-menu .pause-stats {
  color: #888; font-size: 14px; margin-bottom: 32px; text-align: center; line-height: 1.8;
}
#pause-menu .pause-btn {
  width: 220px; padding: 14px; margin: 6px 0; border: none; border-radius: 10px;
  font-size: 16px; font-weight: bold; cursor: pointer; transition: all 0.2s;
  letter-spacing: 1px;
}
#pause-menu .pause-btn:hover { transform: scale(1.05); }
#pause-menu .btn-resume {
  background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.3);
}
#pause-menu .btn-resume:hover { background: rgba(255,255,255,0.25); }
#pause-menu .btn-quit {
  background: rgba(255,60,60,0.2); color: #ff6666; border: 1px solid rgba(255,60,60,0.3);
}
#pause-menu .btn-quit:hover { background: rgba(255,60,60,0.35); }
#pause-menu .pause-hint {
  color: #555; font-size: 12px; margin-top: 20px;
}

/* 라운드 결과 화면 */
#round-result {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.88); z-index: 300;
  flex-direction: column; align-items: center; justify-content: flex-start;
  overflow-y: auto; padding: 30px 0 40px 0;
  backdrop-filter: blur(8px);
  animation: resultFade 0.5s ease-out;
}
@keyframes resultFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
#round-result h2 {
  font-size: 42px; margin: 0 0 6px 0; color: #fff;
  font-family: 'Georgia', serif; letter-spacing: 3px;
}
#round-result .rr-sub {
  color: #888; font-size: 13px; margin-bottom: 24px; letter-spacing: 1px;
}
#round-result .rr-ranks {
  display: flex; gap: 14px; margin-bottom: 24px;
}
#round-result .rr-rank {
  width: 180px; padding: 18px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  text-align: center; transition: transform 0.3s;
}
#round-result .rr-rank.rr-1 {
  background: linear-gradient(180deg, rgba(255,215,0,0.25), rgba(255,165,0,0.1));
  border-color: rgba(255,215,0,0.5);
  box-shadow: 0 0 24px rgba(255,215,0,0.35);
  transform: translateY(-8px);
}
#round-result .rr-rank.rr-2 {
  background: linear-gradient(180deg, rgba(200,200,220,0.18), rgba(160,160,180,0.06));
  border-color: rgba(200,200,220,0.35);
}
#round-result .rr-rank.rr-3 {
  background: linear-gradient(180deg, rgba(200,120,60,0.18), rgba(150,90,40,0.06));
  border-color: rgba(200,120,60,0.3);
}
#round-result .rr-medal { font-size: 32px; margin-bottom: 6px; }
#round-result .rr-faction { font-size: 18px; font-weight: bold; margin-bottom: 4px; }
#round-result .rr-pct { color: #bbb; font-size: 13px; margin-bottom: 8px; }
#round-result .rr-mult { color: #ffe082; font-size: 12px; }

#round-result .rr-player-stats {
  background: rgba(255,255,255,0.04); border-radius: 10px;
  padding: 16px 22px; margin-bottom: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  min-width: 460px;
}
#round-result .rr-player-stats h3 {
  margin: 0 0 10px 0; font-size: 14px; color: #888;
  font-weight: normal; letter-spacing: 1px;
}
#round-result .rr-stat-row {
  display: flex; justify-content: space-between; padding: 4px 0;
  font-size: 14px;
}
#round-result .rr-stat-row .rr-stat-label { color: #999; }
#round-result .rr-stat-row .rr-stat-val { color: #fff; font-weight: bold; }

#round-result .rr-pebble-box {
  background: linear-gradient(135deg, rgba(255,224,130,0.18), rgba(255,180,60,0.08));
  border: 1px solid rgba(255,224,130,0.35);
  border-radius: 12px; padding: 16px 24px; margin-bottom: 22px;
  min-width: 460px; text-align: center;
  box-shadow: 0 0 20px rgba(255,224,130,0.15);
}
#round-result .rr-pebble-earned {
  font-size: 32px; font-weight: bold; color: #ffe082;
  text-shadow: 0 0 12px rgba(255,224,130,0.5);
  margin-bottom: 4px;
}
#round-result .rr-pebble-detail {
  color: #bbb; font-size: 12px; margin-bottom: 6px;
}
#round-result .rr-pebble-total {
  color: #888; font-size: 12px; letter-spacing: 1px;
}
#round-result .rr-pebble-total b { color: #ffe082; font-size: 14px; }

/* 진영별 상위 기여자 */
#round-result .rr-contrib {
  display: flex; gap: 14px; margin-bottom: 18px;
}
#round-result .rr-contrib-col {
  width: 180px; padding: 12px 12px 14px; border-radius: 10px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
}
#round-result .rr-contrib-head {
  font-size: 13px; font-weight: 700; text-align: center;
  padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  letter-spacing: 0.3px;
}
#round-result .rr-contrib-row {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 2px; font-size: 11px; color: #bbb;
  border-bottom: 1px dashed rgba(255,255,255,0.05);
}
#round-result .rr-contrib-row:last-child { border-bottom: none; }
#round-result .rr-contrib-row.me {
  color: #ffe082; font-weight: 700;
  background: rgba(255,224,130,0.08); border-radius: 4px;
  padding-left: 4px; padding-right: 4px;
}
#round-result .rr-contrib-rank {
  display: inline-block; width: 18px; text-align: center;
  color: #888; font-weight: 700;
}
#round-result .rr-contrib-row.me .rr-contrib-rank { color: #ffe082; }
#round-result .rr-contrib-name {
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#round-result .rr-contrib-score {
  color: #fff; font-weight: 700; font-size: 11px;
}
#round-result .rr-contrib-row.me .rr-contrib-score { color: #ffe082; }
#round-result .rr-contrib-empty {
  color: #555; font-size: 11px; text-align: center;
  padding: 6px 0;
}

#round-result .rr-buttons {
  display: flex; gap: 12px; margin-top: 24px; padding-bottom: 20px;
}
#round-result .rr-btn {
  padding: 14px 28px; border: none; border-radius: 10px;
  font-size: 15px; font-weight: bold; cursor: pointer;
  transition: all 0.2s; letter-spacing: 1px;
}
#round-result .rr-btn:hover { transform: scale(1.05); }
#round-result .rr-btn-again {
  background: rgba(100,200,255,0.18); color: #8cf;
  border: 1px solid rgba(100,200,255,0.4);
}
#round-result .rr-btn-again:hover { background: rgba(100,200,255,0.3); }
#round-result .rr-btn-home {
  background: rgba(255,255,255,0.1); color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
}
#round-result .rr-btn-home:hover { background: rgba(255,255,255,0.2); }

/* 조작법 */
#controls-hint {
  position: fixed; bottom: 40px; left: 16px; z-index: 10;
  font-size: 11px; color: #555; pointer-events: none; line-height: 1.8;
}

/* ===== 사전 화면 공통 ===== */
.screen-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: none;
  align-items: safe center; justify-content: safe center;
  flex-direction: column;
  background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a15 100%);
  color: #fff; font-family: inherit;
  padding: 30px 20px;
  overflow-y: auto;
}
.screen-overlay.active { display: flex; }
.screen-overlay::-webkit-scrollbar { width: 10px; }
.screen-overlay::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 5px; }

/* 타이틀 화면 */
#title-screen .title-logo {
  font-size: 88px; font-weight: 900; letter-spacing: 4px;
  background: linear-gradient(135deg, #ff4444, #44aaff, #44cc44);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 60px rgba(255,255,255,0.2);
  margin: 0;
}
#title-screen .title-sub {
  color: #888; font-size: 20px; margin: 12px 0 60px; letter-spacing: 4px;
}
#title-screen .title-btn {
  padding: 18px 56px; font-size: 22px; font-weight: 700;
  background: linear-gradient(135deg, #ff4444, #44aaff);
  color: #fff; border: none; border-radius: 8px; cursor: pointer;
  letter-spacing: 2px; box-shadow: 0 8px 30px rgba(68,170,255,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}
#title-screen .title-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(68,170,255,0.6); }
#title-screen .title-version { position: absolute; bottom: 20px; color: #444; font-size: 11px; }
#title-screen .title-pebble-box {
  position: absolute; top: 24px; right: 28px;
  background: linear-gradient(135deg, rgba(255,224,130,0.18), rgba(255,180,60,0.08));
  border: 1px solid rgba(255,224,130,0.35);
  border-radius: 10px; padding: 10px 18px;
  font-size: 14px; color: #ffe082;
  box-shadow: 0 0 15px rgba(255,224,130,0.15);
}
#title-screen .title-pebble-box b { font-size: 18px; margin-left: 6px; }

/* 진영 소개 */
#faction-intro h2 { font-size: 32px; margin: 0 0 6px; font-weight: 900; }
#faction-intro .intro-sub { color: #888; margin-bottom: 18px; font-size: 14px; }
#faction-intro .intro-cards { display: flex; gap: 18px; max-width: 1100px; flex-wrap: wrap; justify-content: center; }
#faction-intro .intro-card {
  flex: 1; min-width: 240px; max-width: 300px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 18px 20px; text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}
#faction-intro .intro-card:hover { transform: translateY(-4px); }
#faction-intro .intro-card .emoji { font-size: 48px; line-height: 1; }
#faction-intro .intro-card h3 { font-size: 22px; margin: 8px 0 4px; }
#faction-intro .intro-card .role { font-size: 11px; color: #aaa; letter-spacing: 2px; margin-bottom: 10px; }
#faction-intro .intro-card .desc { font-size: 12.5px; color: #ccc; line-height: 1.6; text-align: left; }
#faction-intro .intro-card.scissors { border-color: rgba(255,68,68,0.4); }
#faction-intro .intro-card.scissors h3 { color: #ff6666; }
#faction-intro .intro-card.rock { border-color: rgba(68,170,255,0.4); }
#faction-intro .intro-card.rock h3 { color: #66bbff; }
#faction-intro .intro-card.paper { border-color: rgba(68,204,68,0.4); }
#faction-intro .intro-card.paper h3 { color: #66dd66; }
#faction-intro .intro-rules {
  margin-top: 18px; max-width: 1100px; width: 100%;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 14px 22px; text-align: left;
}
#faction-intro .intro-rules h4 {
  margin: 0 0 10px; font-size: 14px; font-weight: 800;
  color: #ffd44d; letter-spacing: 2px; text-align: center;
}
#faction-intro .intro-rules .rules-grid {
  columns: 2; column-gap: 24px;
}
#faction-intro .intro-rules .rule-row {
  display: flex; gap: 8px; font-size: 12px; color: #ccc; line-height: 1.5;
  break-inside: avoid; margin-bottom: 6px;
}
#faction-intro .intro-rules .rule-row .r-ico {
  flex: 0 0 14px; color: #ffd44d; font-weight: 900;
}
#faction-intro .intro-rules .rule-row .r-txt b { color: #fff; }
@media (max-width: 760px) {
  #faction-intro .intro-rules .rules-grid { columns: 1; }
}
#faction-intro .intro-actions { margin-top: 18px; margin-bottom: 10px; display: flex; gap: 16px; }
#faction-intro .intro-btn {
  padding: 12px 36px; font-size: 15px; font-weight: 700;
  background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px; cursor: pointer; letter-spacing: 1px;
  transition: transform 0.15s;
}
#faction-intro .intro-btn.primary {
  background: linear-gradient(135deg, #ff4444, #44aaff); border: none;
}
#faction-intro .intro-btn:hover { transform: translateY(-1px); }

/* 간소화 튜토리얼 */
#faction-intro .quick-tips { max-width: 600px; width: 100%; margin: 0 auto; }
#faction-intro .quick-tip {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 14px 18px; margin-bottom: 10px;
  font-size: 14px; color: #ddd; line-height: 1.5;
}
#faction-intro .quick-tip .qt-icon {
  flex: 0 0 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  font-size: 28px; background: rgba(255,255,255,0.06); border-radius: 10px;
}
#faction-intro .quick-tip .qt-text b { color: #fff; }
#faction-intro .intro-btn.detail-btn {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15);
  font-size: 13px; padding: 10px 24px; margin-top: 4px;
}
#detail-info-modal {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.88);
  z-index: 700; justify-content: center; align-items: flex-start;
  overflow-y: auto; padding: 40px 16px;
}
#detail-info-modal.active { display: flex; }
#detail-info-modal .dim-box {
  background: #12122a; border: 1px solid #333; border-radius: 16px;
  padding: 28px 28px 20px; max-width: 800px; width: 100%; color: #ccc;
}
#detail-info-modal .dim-box h2 { color: #fff; margin: 0 0 6px; font-size: 22px; }
#detail-info-modal .dim-sub { color: #888; font-size: 13px; margin-bottom: 18px; }
#detail-info-modal .dim-section { margin-bottom: 18px; }
#detail-info-modal .dim-section h3 { color: #ffd44d; font-size: 15px; margin: 0 0 10px; }
#detail-info-modal .dim-row { display: flex; gap: 8px; font-size: 12.5px; color: #ccc; line-height: 1.5; margin-bottom: 6px; }
#detail-info-modal .dim-row .d-ico { flex: 0 0 14px; color: #ffd44d; font-weight: 900; }
#detail-info-modal .dim-row b { color: #fff; }
#detail-info-modal .dim-factions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-bottom: 12px; }
#detail-info-modal .dim-fc {
  flex: 1; min-width: 200px; max-width: 260px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 14px 16px; text-align: center;
}
#detail-info-modal .dim-fc .dfc-emoji { font-size: 36px; }
#detail-info-modal .dim-fc h4 { margin: 6px 0 4px; font-size: 16px; }
#detail-info-modal .dim-fc.scissors h4 { color: #ff6666; }
#detail-info-modal .dim-fc.rock h4 { color: #66bbff; }
#detail-info-modal .dim-fc.paper h4 { color: #66dd66; }
#detail-info-modal .dim-fc .dfc-desc { font-size: 12px; color: #bbb; line-height: 1.6; text-align: left; }
#detail-info-modal .dim-close {
  display: block; margin: 14px auto 0; padding: 10px 36px; font-size: 14px; font-weight: 700;
  background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px; cursor: pointer;
}
@media (max-width: 760px) { #detail-info-modal .dim-factions { flex-direction: column; align-items: center; } }


/* 연습 모드 HUD */
#practice-hud {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 15; display: none;
  background: rgba(0,0,0,0.75); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px; padding: 10px 16px; backdrop-filter: blur(6px);
  gap: 10px; align-items: center;
}
#practice-hud.visible { display: flex; }
#practice-hud .back-btn {
  padding: 6px 12px; font-size: 14px; font-weight: 700;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2);
  color: #bbb; border-radius: 5px; cursor: pointer; margin-right: 4px;
}
#practice-hud .back-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
#practice-hud .practice-label { color: #ffd44d; font-size: 12px; font-weight: 700; letter-spacing: 1px; margin-right: 6px; }
#practice-hud .switch-btn {
  padding: 8px 14px; font-size: 13px; font-weight: 700;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; border-radius: 5px; cursor: pointer;
}
#practice-hud .switch-btn.scissors { border-color: rgba(255,68,68,0.6); color: #ff8888; }
#practice-hud .switch-btn.rock { border-color: rgba(68,170,255,0.6); color: #88bbff; }
#practice-hud .switch-btn.paper { border-color: rgba(68,204,68,0.6); color: #88dd88; }
#practice-hud .switch-btn.active { background: rgba(255,255,255,0.2); box-shadow: 0 0 10px rgba(255,255,255,0.3); }
#practice-hud .exit-btn {
  padding: 8px 18px; font-size: 13px; font-weight: 700;
  background: linear-gradient(135deg, #ff4444, #44aaff);
  border: none; color: #fff; border-radius: 5px; cursor: pointer; margin-left: 8px;
}

/* 연습 모드 팁 패널 — 우측 하단 미니맵 위 */
#practice-tip {
  position: fixed; bottom: 190px; right: 16px;
  z-index: 14; display: none;
  background: rgba(0,0,0,0.82); border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px; padding: 12px 16px; backdrop-filter: blur(6px);
  color: #ddd; font-size: 11px; line-height: 1.7;
  width: 320px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
}
#practice-tip.visible { display: block; }
#practice-tip .tip-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
#practice-tip .tip-title {
  font-size: 13px; font-weight: 700; letter-spacing: 1px;
}
#practice-tip .tip-title.scissors { color: #ff8888; }
#practice-tip .tip-title.rock { color: #88bbff; }
#practice-tip .tip-title.paper { color: #88dd88; }
#practice-tip .tip-close {
  background: none; border: none; color: #888; font-size: 16px;
  cursor: pointer; padding: 0 4px;
}
#practice-tip .tip-close:hover { color: #fff; }
#practice-tip .tip-row {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 4px 0;
}
#practice-tip .tip-row .tip-label {
  color: #ffd44d; font-weight: 700; min-width: 80px; flex-shrink: 0;
}
#practice-tip .tip-row .tip-desc { color: #ccc; }
#practice-tip .tip-reward {
  color: #44dd88; font-weight: 700;
}
#practice-tip .tip-warn {
  color: #ff7777; font-weight: 700;
}
#practice-tip-toggle {
  position: fixed; bottom: 190px; right: 16px;
  z-index: 14; display: none;
  background: rgba(0,0,0,0.7); border: 1px solid rgba(255,255,255,0.2);
  color: #bbb; font-size: 12px; padding: 8px 14px;
  border-radius: 6px; cursor: pointer;
}
#practice-tip-toggle.visible { display: block; }
#practice-tip-toggle:hover { color: #fff; background: rgba(0,0,0,0.85); }

/* 로그인 화면 */
#login-screen h2 { font-size: 36px; margin-bottom: 8px; }
#login-screen .login-sub { color: #888; margin-bottom: 40px; font-size: 14px; }
#login-screen .login-buttons { display: flex; flex-direction: column; gap: 12px; width: 320px; }
#login-screen .login-btn {
  padding: 14px 20px; font-size: 15px; font-weight: 600;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15);
  color: #fff; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: background 0.15s;
}
#login-screen .login-btn:hover { background: rgba(255,255,255,0.12); }
#login-screen .login-btn .logo-ico { font-size: 18px; }
#login-screen .login-btn.guest { color: #aaa; font-size: 13px; border-style: dashed; }
#login-screen .login-back { margin-top: 24px; color: #666; font-size: 12px; background: none; border: none; cursor: pointer; }

/* 서버 선택 */
#server-select h2 { font-size: 36px; margin-bottom: 8px; }
#server-select .server-sub { color: #888; margin-bottom: 40px; font-size: 14px; }
#server-select .server-list { display: flex; flex-direction: column; gap: 10px; width: 440px; max-width: 90vw; }
#server-select .server-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 8px;
  cursor: pointer; transition: background 0.15s, transform 0.15s;
}
#server-select .server-row:hover { background: rgba(255,255,255,0.12); transform: translateX(4px); }
#server-select .server-row .s-name { font-size: 15px; font-weight: 600; }
#server-select .server-row .s-info { font-size: 11px; color: #888; margin-top: 3px; }
#server-select .server-row .s-ping { font-size: 14px; font-weight: 700; }
#server-select .server-row .s-ping.good { color: #44dd44; }
#server-select .server-row .s-ping.ok { color: #ddaa44; }
#server-select .server-row .s-ping.bad { color: #dd4444; }
#server-select .server-back { margin-top: 24px; color: #666; font-size: 12px; background: none; border: none; cursor: pointer; }

/* ===== 로비 화면 ===== */
#lobby-screen {
  justify-content: flex-start; align-items: stretch;
  padding: 0; flex-direction: column;
}
#lobby-screen .lobby-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 40px; border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.3); position: relative;
}
#lobby-screen .lobby-user { display: flex; align-items: center; gap: 14px; }
#lobby-screen .lobby-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,0.1); display: flex;
  align-items: center; justify-content: center; font-size: 28px;
  border: 1px solid rgba(255,255,255,0.2);
}
#lobby-screen .lobby-username { font-size: 18px; font-weight: 700; color: #fff; }
#lobby-screen .lobby-server { font-size: 12px; color: #888; margin-top: 3px; }
#lobby-screen .lobby-pebble {
  background: linear-gradient(135deg, rgba(255,224,130,0.18), rgba(255,180,60,0.08));
  border: 1px solid rgba(255,224,130,0.35);
  border-radius: 10px; padding: 10px 20px;
  color: #ffe082; font-size: 14px;
  box-shadow: 0 0 15px rgba(255,224,130,0.15);
}
#lobby-screen .lobby-pebble b { font-size: 20px; margin-left: 4px; }

#lobby-screen .lobby-main {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 40px; padding: 40px;
}
#lobby-screen .lobby-faction-card {
  width: 280px; padding: 30px 24px; border-radius: 16px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12);
  text-align: center;
}
#lobby-screen .lfc-label { color: #888; font-size: 11px; letter-spacing: 2px; margin-bottom: 8px; }
#lobby-screen .lfc-emoji { font-size: 64px; margin: 10px 0; }
#lobby-screen .lfc-name { font-size: 28px; font-weight: 900; color: #fff; margin-bottom: 4px; }
#lobby-screen .lfc-skill { font-size: 13px; color: #aaa; margin-bottom: 20px; }
#lobby-screen .lobby-change-faction {
  background: rgba(255,255,255,0.08); color: #ccc;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 8px 16px; border-radius: 6px;
  font-size: 12px; cursor: pointer; transition: all 0.2s;
}
#lobby-screen .lobby-change-faction:hover {
  background: rgba(255,255,255,0.15); color: #fff;
}

#lobby-screen .lobby-actions {
  display: flex; flex-direction: column; gap: 14px; min-width: 360px;
}
#lobby-screen .lobby-btn {
  display: flex; align-items: center; gap: 18px;
  padding: 20px 26px; border-radius: 12px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12);
  color: #fff; text-align: left; cursor: pointer;
  transition: all 0.2s; font-family: inherit;
}
#lobby-screen .lobby-btn:hover {
  transform: translateX(6px); background: rgba(255,255,255,0.1);
}
#lobby-screen .lobby-btn .lbi { font-size: 34px; }
#lobby-screen .lobby-btn .lbt { font-size: 18px; font-weight: 700; }
#lobby-screen .lobby-btn .lbs { font-size: 12px; color: #888; margin-top: 3px; }
#lobby-screen .lobby-btn-play {
  background: linear-gradient(135deg, rgba(255,68,68,0.2), rgba(68,170,255,0.15));
  border-color: rgba(255,255,255,0.3);
}
#lobby-screen .lobby-btn-play:hover {
  background: linear-gradient(135deg, rgba(255,68,68,0.3), rgba(68,170,255,0.25));
  box-shadow: 0 6px 24px rgba(68,170,255,0.25);
}
#lobby-screen .lobby-btn-shop:hover {
  background: rgba(255,224,130,0.12);
  border-color: rgba(255,224,130,0.35);
}
#lobby-screen .lobby-btn-shop .lbi { color: #ffe082; }

#lobby-screen .lobby-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 40px; border-top: 1px solid rgba(255,255,255,0.08);
}
#lobby-screen .lobby-side-btn {
  background: none; border: none; color: #666;
  font-size: 12px; cursor: pointer; padding: 6px 10px;
}
#lobby-screen .lobby-side-btn:hover { color: #ccc; }
#lobby-screen .lobby-version { color: #444; font-size: 11px; }

/* ===== 상점 화면 ===== */
#shop-screen {
  justify-content: flex-start; align-items: stretch;
  padding: 30px 40px; flex-direction: column;
}
#shop-screen .shop-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px;
}
#shop-screen .shop-header h2 {
  font-size: 32px; margin: 0; color: #fff;
}
#shop-screen .shop-pebble {
  background: linear-gradient(135deg, rgba(255,224,130,0.18), rgba(255,180,60,0.08));
  border: 1px solid rgba(255,224,130,0.35);
  border-radius: 10px; padding: 10px 20px;
  color: #ffe082; font-size: 14px;
}
#shop-screen .shop-pebble b { font-size: 20px; margin-left: 4px; }
#shop-screen .shop-grid {
  flex: 1; display: grid; gap: 16px; overflow-y: auto;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  padding: 8px 4px;
}
#shop-screen .shop-item {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px; padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
  transition: all 0.2s;
}
#shop-screen .shop-item:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.25);
}
#shop-screen .shop-item.owned {
  opacity: 0.55;
  border-color: rgba(100,255,100,0.3);
}
#shop-screen .si-head {
  display: flex; align-items: center; gap: 10px;
}
#shop-screen .si-icon { font-size: 36px; }
#shop-screen .si-type {
  font-size: 10px; color: #888; letter-spacing: 1px;
  background: rgba(255,255,255,0.08); padding: 2px 8px;
  border-radius: 4px;
}
#shop-screen .si-name { font-size: 16px; font-weight: 700; color: #fff; }
#shop-screen .si-desc { font-size: 12px; color: #999; min-height: 32px; }
#shop-screen .si-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 6px;
}
#shop-screen .si-price { color: #ffe082; font-weight: 700; font-size: 15px; }
#shop-screen .si-buy {
  background: rgba(68,170,255,0.2); color: #8cf;
  border: 1px solid rgba(68,170,255,0.4);
  padding: 6px 14px; border-radius: 6px;
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: all 0.15s;
}
#shop-screen .si-buy:hover { background: rgba(68,170,255,0.35); }
#shop-screen .si-buy:disabled {
  opacity: 0.35; cursor: not-allowed;
}
#shop-screen .si-owned-tag {
  color: #66dd66; font-size: 12px; font-weight: 700;
}
#shop-screen .shop-item.character {
  border-color: rgba(255, 200, 80, 0.35);
  background: linear-gradient(180deg, rgba(255,200,80,0.08), rgba(255,255,255,0.05));
}
#shop-screen .shop-item.character:hover {
  border-color: rgba(255, 200, 80, 0.6);
}
#shop-screen .si-dual {
  display: flex; gap: 6px; width: 100%; justify-content: flex-end;
}
#shop-screen .si-buy.peb {
  background: rgba(255, 224, 130, 0.18); color: #ffe082;
  border-color: rgba(255, 224, 130, 0.4);
}
#shop-screen .si-buy.peb:hover { background: rgba(255, 224, 130, 0.3); }
#shop-screen .si-buy.cash {
  background: rgba(120, 255, 180, 0.18); color: #9effc7;
  border-color: rgba(120, 255, 180, 0.4);
}
#shop-screen .si-buy.cash:hover { background: rgba(120, 255, 180, 0.3); }
#shop-screen .shop-msg {
  margin: 12px 0; min-height: 18px;
  font-size: 13px; text-align: center;
}
#shop-screen .shop-msg.err { color: #ff8888; }
#shop-screen .shop-msg.ok { color: #88dd88; }
#shop-screen .shop-back {
  align-self: flex-start; background: none; border: none;
  color: #888; font-size: 13px; cursor: pointer; padding: 8px 0;
}
#shop-screen .shop-back:hover { color: #fff; }

/* ===== 마이페이지 ===== */
#mypage-screen {
  padding: 0 50px 50px; flex-direction: column; align-items: stretch;
  overflow-y: auto;
  scroll-padding-top: 220px;
}
#mypage-screen .mp-sticky {
  position: sticky; top: 0; z-index: 20;
  background: #0a0a15;
  padding: 30px 0 12px 0;
  box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}
#mypage-screen .mp-header {
  display: flex; align-items: center; gap: 16px; margin-bottom: 10px;
}
#mypage-screen .mp-back {
  background: none; border: none; color: #888;
  font-size: 13px; cursor: pointer; padding: 8px 0;
}
#mypage-screen .mp-back:hover { color: #fff; }
/* // __PHASE_Z2_MP_BALANCE__ */
#mypage-screen .mp-balance {
  display: inline-flex; gap: 12px; align-items: center; margin-left: auto;
  background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 6px 14px; font-size: 14px; font-weight: 700;
}
#mypage-screen .mp-balance .mp-coin { color: #ffe082; }
#mypage-screen .mp-balance .mp-crystal { color: #88ddff; }
#mypage-screen .mp-header { display: flex; align-items: center; gap: 14px; }
#mypage-screen h2 { color: #fff; margin: 0; font-size: 26px; }
#mypage-screen .mp-subtitle {
  color: #888; font-size: 13px; margin-bottom: 18px;
}
#mypage-screen .mp-tabs {
  display: flex; gap: 8px; margin-bottom: 18px; border-bottom: 1px solid #333; padding-bottom: 12px;
}
#mypage-screen .mp-tab {
  background: rgba(255,255,255,0.05); border: 1px solid #333;
  color: #aaa; padding: 10px 22px; border-radius: 6px;
  cursor: pointer; font-size: 14px; font-weight: 600; transition: all 0.2s;
}
#mypage-screen .mp-tab:hover { background: rgba(255,255,255,0.12); color: #fff; }
#mypage-screen .mp-tab.active {
  background: rgba(68,170,255,0.25); border-color: #44aaff; color: #fff;
}
#mypage-screen .mp-section-title {
  color: #ccc; font-size: 15px; font-weight: 600;
  margin-bottom: 12px; padding-bottom: 6px; border-bottom: 1px solid #222;
}
#mypage-screen .mp-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
#mypage-screen .mp-card {
  background: rgba(255,255,255,0.04); border: 2px solid #222;
  border-radius: 10px; padding: 16px; cursor: pointer;
  transition: all 0.2s; text-align: center;
}
#mypage-screen .mp-card:hover { border-color: #555; background: rgba(255,255,255,0.08); }
#mypage-screen .mp-card.active {
  border-color: #ffcc44; background: rgba(255,204,68,0.08);
}
#mypage-screen .mp-card.locked {
  cursor: default; opacity: 0.55;
}
#mypage-screen .mp-card.locked:hover { border-color: #222; background: rgba(255,255,255,0.04); }
#mypage-screen .mp-swatch {
  width: 58px; height: 58px; border-radius: 50%;
  margin: 0 auto 10px; box-shadow: 0 0 20px rgba(255,255,255,0.15);
  border: 3px solid rgba(255,255,255,0.2);
}
#mypage-screen .mp-icon {
  font-size: 42px; margin-bottom: 8px; display: block;
}
#mypage-screen .mp-card-name {
  color: #fff; font-size: 15px; font-weight: 700; margin-bottom: 4px;
}
#mypage-screen .mp-card-desc {
  color: #888; font-size: 11px; min-height: 28px; margin-bottom: 8px;
}
#mypage-screen .mp-equipped-tag {
  display: inline-block; background: #ffcc44; color: #000;
  padding: 4px 10px; border-radius: 4px; font-size: 11px; font-weight: 700;
}
#mypage-screen .mp-badge {
  display: inline-block; background: #66ffcc; color: #002;
  padding: 4px 10px; border-radius: 4px; font-size: 11px; font-weight: 800;
  letter-spacing: 0.3px;
}
#mypage-screen .mp-action {
  display: inline-block; background: rgba(68,170,255,0.25); color: #9cf;
  padding: 4px 10px; border-radius: 4px; font-size: 11px; font-weight: 700;
  border: 1px solid rgba(68,170,255,0.45);
}
#mypage-screen .mp-lock {
  display: inline-block; color: #ff9966; font-size: 11px; font-weight: 700;
}
#mypage-screen .mp-hint {
  color: #888; font-size: 12px; margin: 0 0 14px 0; text-align: center;
}
#mypage-screen .mp-btn-unequip {
  display: inline-block; padding: 4px 10px; border-radius: 6px; border: 1px solid #ff6666;
  background: rgba(255,80,80,0.15); color: #ff8888; font-size: 11px; cursor: pointer;
  margin-top: 4px; transition: all 0.2s;
}
#mypage-screen .mp-btn-unequip:hover { background: rgba(255,80,80,0.35); color: #ff4444; }
#mypage-screen .mp-btn {
  background: rgba(68,170,255,0.2); border: 1px solid #44aaff;
  color: #fff; padding: 6px 14px; border-radius: 4px;
  font-size: 12px; cursor: pointer; font-weight: 600;
}
#mypage-screen .mp-btn:hover { background: rgba(68,170,255,0.4); }
#mypage-screen .mp-empty {
  grid-column: 1 / -1; text-align: center; color: #666;
  padding: 40px 20px; font-size: 13px;
}
#mypage-screen .mp-progress-bar {
  width: 100%; height: 6px; background: #222;
  border-radius: 3px; overflow: hidden; margin: 6px 0 4px;
}
#mypage-screen .mp-progress-fill {
  height: 100%; background: linear-gradient(90deg, #44aaff, #66ffcc);
  transition: width 0.3s;
}
#mypage-screen .mp-progress-text {
  color: #aaa; font-size: 10px; text-align: right;
}
#mypage-screen .mp-section + .mp-section { margin-top: 24px; }

/* ===== 모드 선택 화면 ===== */
#mode-select {
  justify-content: center; align-items: center; flex-direction: column;
  padding: 40px;
}
#mode-select h2 {
  font-size: 38px; color: #fff; margin: 0 0 8px 0;
  letter-spacing: 2px;
}
#mode-select .mode-sub {
  color: #888; font-size: 14px; margin-bottom: 40px;
}
#mode-select .mode-grid {
  display: flex; gap: 28px; margin-bottom: 30px;
  flex-wrap: wrap; justify-content: center;
}
#mode-select .mode-card {
  width: 300px; padding: 34px 26px; border-radius: 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff; text-align: center; cursor: pointer;
  transition: all 0.2s; font-family: inherit;
}
#mode-select .mode-card:hover {
  transform: translateY(-6px);
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.3);
  box-shadow: 0 10px 32px rgba(0,0,0,0.4);
}
#mode-select .mode-card.ranked {
  background: linear-gradient(135deg, rgba(255,68,68,0.15), rgba(68,170,255,0.1));
  border-color: rgba(255,255,255,0.25);
}
#mode-select .mode-card.ranked:hover {
  background: linear-gradient(135deg, rgba(255,68,68,0.25), rgba(68,170,255,0.18));
}
#mode-select .mode-icon { font-size: 56px; margin-bottom: 12px; }
#mode-select .mode-title { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
#mode-select .mode-tag { font-size: 11px; color: #ffe082; letter-spacing: 1px; margin-bottom: 14px; }
#mode-select .mode-desc { font-size: 12px; color: #aaa; line-height: 1.6; }
#mode-select .mode-back {
  background: none; border: none; color: #666;
  font-size: 13px; cursor: pointer; padding: 8px 16px;
}
#mode-select .mode-back:hover { color: #ccc; }

/* __PHASE_YA_ADSENSE_PREP__ 광고 컨테이너 — 광고 안 채워지면 자동 숨김 */
.ad-container {
  text-align: center;
  margin: 14px auto;
  max-width: 728px;
  width: 100%;
}
.ad-mw, .ad-rr { min-height: 0; }
/* AdSense 가 광고 못 받았으면 (승인 전 / 광고차단기 / 인벤토리 없음) 컨테이너 자체 숨김 */
.adsbygoogle:not([data-ad-status="filled"]) {
  display: none !important;
}
/* __PHASE_YA2_AD_DEBUG__ ?ads=debug 모드 시 광고 자리 placeholder */
html.ads-debug .ad-container {
  background: rgba(120,120,120,0.15);
  border: 2px dashed #888;
  color: #aaa;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
  font-size: 14px;
  border-radius: 6px;
}
html.ads-debug .ad-mw::before { content: "[광고 자리: 매칭 대기]"; }
html.ads-debug .ad-rr::before { content: "[광고 자리: 라운드 종료]"; }

/* __PHASE_ZB1_INTERSTITIAL__ 5초 인터스티셜 광고 모달 (비활성화 상태) */
/* noads_lifetime: removes ZB-1 interstitial only. ad-mw / ad-rr banners remain visible. */
#interstitial-modal {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 99999;
  align-items: center; justify-content: center;
  padding: 20px;
}
#interstitial-modal.active { display: flex; }
#interstitial-modal .zb1-card {
  background: #1a1f2e;
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 24px;
  max-width: 520px; width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
#interstitial-modal .zb1-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 18px;
}
#interstitial-modal .zb1-label {
  background: rgba(255,255,255,0.1);
  padding: 4px 10px; border-radius: 6px;
  font-size: 11px; color: #aac;
  letter-spacing: 0.5px;
}
#interstitial-modal .zb1-skip {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  color: #888;
  padding: 6px 14px; border-radius: 6px;
  font-size: 12px; cursor: not-allowed;
  font-family: inherit;
}
#interstitial-modal .zb1-skip.active {
  cursor: pointer; color: #fff;
  border-color: #44aaff;
  background: rgba(68, 170, 255, 0.15);
}
#interstitial-modal .zb1-skip.active:hover { background: rgba(68, 170, 255, 0.3); }
#interstitial-modal .zb1-ad-area {
  background: linear-gradient(135deg, #2a4d8f, #4477bb);
  min-height: 280px;
  border-radius: 10px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: #fff; margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
#interstitial-modal .zb1-ad-fallback { text-align: center; padding: 20px; }
#interstitial-modal .zb1-bottom {
  display: flex; justify-content: space-between;
  align-items: center;
  font-size: 12px; color: #aac;
  flex-wrap: wrap; gap: 8px;
}
#interstitial-modal .zb1-buy-link {
  background: linear-gradient(135deg, #ff8a44, #ffc044);
  color: #1a1a1a; border: none;
  padding: 8px 14px; border-radius: 6px;
  font-size: 12px; font-weight: 700; cursor: pointer;
  font-family: inherit;
}
#interstitial-modal .zb1-buy-link:hover { filter: brightness(1.1); }
@media (max-width: 540px) {
  #interstitial-modal .zb1-card { padding: 16px; }
  #interstitial-modal .zb1-ad-area { min-height: 220px; }
  #interstitial-modal .zb1-bottom { justify-content: center; }
}

/* __PHASE_YB1_COOKIE_BANNER__ 쿠키 동의 배너 */
#cookie-consent {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: rgba(15,15,20,0.96); color: #ddd;
  padding: 14px 20px; font-size: 13px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  justify-content: center;
  border-top: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.4);
}
#cookie-consent .cc-text { flex: 1; min-width: 220px; max-width: 600px; line-height: 1.5; }
#cookie-consent .cc-link { color: #88ccff; text-decoration: underline; }
#cookie-consent .cc-link:hover { color: #aaddff; }
#cookie-consent .cc-accept {
  background: #4a90e2; color: white; border: none;
  padding: 8px 18px; border-radius: 6px; font-size: 13px; font-weight: 600;
  cursor: pointer; flex-shrink: 0;
}
#cookie-consent .cc-accept:hover { background: #5aa0f2; }
#cookie-consent.cc-hidden { display: none; }
@media (max-width: 480px) {
  #cookie-consent { padding: 10px 12px; font-size: 12px; }
  #cookie-consent .cc-accept { padding: 7px 14px; font-size: 12px; }
}
/* ===== 매칭 대기방 ===== */
#match-waiting {
  justify-content: center; align-items: center; flex-direction: column;
  padding: 40px;
}
#match-waiting .mw-dots {
  /* __PHASE_XF_B_15_SLOTS__ 15개 점 들어가게 크기/간격 축소 */
  display: flex; gap: 3px; justify-content: center; margin-top: 8px;
  flex-wrap: wrap;
}
#match-waiting .mw-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
#match-waiting .mw-dot.ready {
  background: #6de36d;
  box-shadow: 0 0 8px rgba(109, 227, 109, 0.7);
}
#match-waiting .mw-condition {
  font-size: 12px; color: #999; margin-top: 14px; text-align: center;
  padding: 8px 14px; border-radius: 8px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
}
/* Phase 2y : 준비 상태 펄스 */
@keyframes mwReadyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(109,227,109,0.55); }
  50%      { box-shadow: 0 0 0 6px rgba(109,227,109,0); }
}
#match-waiting .mw-ready-active {
  background: linear-gradient(135deg, #3e8e5e, #55b07e) !important;
  color: #fff !important;
  animation: mwReadyPulse 1.4s ease-out infinite;
}
#match-waiting h2 {
  font-size: 34px; color: #fff; margin: 0 0 6px 0;
  letter-spacing: 2px;
}
.mw-factions {
  display: flex; gap: 24px; margin: 30px 0 24px 0;
  flex-wrap: wrap; justify-content: center;
}
.mw-fc {
  width: 160px; padding: 24px 18px; border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  text-align: center; transition: all 0.2s;
}
.mw-fc.scissors { border-color: rgba(255,68,68,0.4); }
.mw-fc.rock { border-color: rgba(68,170,255,0.4); }
.mw-fc.paper { border-color: rgba(68,255,68,0.4); }
.mw-emoji { font-size: 48px; margin-bottom: 8px; }
.mw-name { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.mw-count { font-size: 22px; font-weight: 800; color: #ffe082; }
.mw-status {
  font-size: 16px; color: #ccc; margin-bottom: 10px;
  min-height: 24px; text-align: center;
}
.mw-ready-info {
  font-size: 14px; color: #888; margin-bottom: 20px;
}
.mw-actions {
  display: flex; gap: 14px; justify-content: center;
}
.mw-btn {
  padding: 12px 36px; border-radius: 10px; border: none;
  font-size: 16px; font-weight: 700; cursor: pointer;
  background: #335; color: #fff; transition: all 0.15s;
  font-family: inherit;
}
.mw-btn:hover { background: #446; transform: translateY(-2px); }
.mw-btn.mw-ready-active {
  background: #44aa44 !important; color: #fff;
}
.mw-btn.mw-cancel {
  background: rgba(255,60,60,0.2); color: #ff6666;
}
.mw-btn.mw-cancel:hover { background: rgba(255,60,60,0.35); }
/* [카운트다운 보호] 5초 카운트 중에는 버튼 비활성화 */
.mw-btn.mw-countdown-lock {
  pointer-events: none;
  opacity: 0.45;
  filter: grayscale(60%);
  cursor: not-allowed;
}

/* ===== 무한모드 방 목록 ===== */
#infinite-rooms, #private-rooms {
  justify-content: flex-start; align-items: stretch;
  padding: 30px 40px; flex-direction: column;
}
#infinite-rooms .ir-header, #private-rooms .ir-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
}
#infinite-rooms .ir-header h2, #private-rooms .ir-header h2 {
  font-size: 28px; color: #fff; margin: 0;
}
#infinite-rooms .ir-header .ir-pebble, #private-rooms .ir-header .ir-pebble {
  background: linear-gradient(135deg, rgba(255,224,130,0.18), rgba(255,180,60,0.08));
  border: 1px solid rgba(255,224,130,0.35);
  border-radius: 10px; padding: 10px 20px;
  color: #ffe082; font-size: 14px;
}
#infinite-rooms .ir-header .ir-pebble b,
#private-rooms .ir-header .ir-pebble b { font-size: 20px; margin-left: 4px; }

#infinite-rooms .ir-desc, #private-rooms .ir-desc {
  font-size: 13px; color: #888; margin-bottom: 16px; line-height: 1.6;
}
#infinite-rooms .ir-actions, #private-rooms .ir-actions {
  display: flex; gap: 12px; margin-bottom: 16px;
}
#infinite-rooms .ir-quick-btn, #private-rooms .ir-create-btn {
  flex: 1; padding: 14px 18px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(68,170,255,0.2), rgba(68,170,255,0.1));
  border: 1px solid rgba(68,170,255,0.4);
  color: #8cf; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.2s; font-family: inherit;
}
#infinite-rooms .ir-quick-btn:hover, #private-rooms .ir-create-btn:hover {
  background: linear-gradient(135deg, rgba(68,170,255,0.3), rgba(68,170,255,0.18));
  border-color: rgba(68,170,255,0.6);
}
#infinite-rooms .ir-refresh, #private-rooms .ir-refresh {
  padding: 14px 18px; border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  color: #ccc; font-size: 13px; cursor: pointer; font-family: inherit;
}
#infinite-rooms .ir-refresh:hover, #private-rooms .ir-refresh:hover {
  background: rgba(255,255,255,0.1);
}
#infinite-rooms .ir-list, #private-rooms .ir-list {
  flex: 1; overflow-y: auto; display: flex;
  flex-direction: column; gap: 10px; padding: 4px;
}
#infinite-rooms .ir-row, #private-rooms .ir-row {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px; border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.2s;
}
#infinite-rooms .ir-row:hover, #private-rooms .ir-row:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
}
#infinite-rooms .ir-row .ir-name, #private-rooms .ir-row .ir-name {
  flex: 1; font-size: 15px; font-weight: 700; color: #fff;
}
#infinite-rooms .ir-row .ir-meta, #private-rooms .ir-row .ir-meta {
  font-size: 11px; color: #888; margin-top: 3px;
}
#infinite-rooms .ir-row .ir-count, #private-rooms .ir-row .ir-count {
  font-size: 14px; color: #ccc; font-weight: 700;
  min-width: 80px; text-align: center;
}
#infinite-rooms .ir-row .ir-count.full {
  color: #ff6666;
}
#infinite-rooms .ir-row .ir-count.low {
  color: #66dd66;
}
#infinite-rooms .ir-row .ir-join, #private-rooms .ir-row .ir-join {
  background: rgba(68,170,255,0.2); color: #8cf;
  border: 1px solid rgba(68,170,255,0.4);
  padding: 8px 22px; border-radius: 6px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all 0.15s; font-family: inherit;
}
#infinite-rooms .ir-row .ir-join:hover, #private-rooms .ir-row .ir-join:hover {
  background: rgba(68,170,255,0.35);
}
#infinite-rooms .ir-row .ir-join:disabled, #private-rooms .ir-row .ir-join:disabled {
  opacity: 0.3; cursor: not-allowed;
}
#infinite-rooms .ir-back, #private-rooms .ir-back {
  align-self: flex-start; margin-top: 14px;
  background: none; border: none; color: #888;
  font-size: 13px; cursor: pointer; padding: 8px 0;
}
#infinite-rooms .ir-back:hover, #private-rooms .ir-back:hover { color: #fff; }

/* ===== 사설방 개설 모달 ===== */
#private-create-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  display: none; justify-content: center; align-items: center;
  z-index: 2000;
}
#private-create-modal.active { display: flex; }
#private-create-modal .pcm-box {
  width: 460px; background: #1a1a25;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 14px; padding: 30px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
#private-create-modal h3 {
  font-size: 22px; color: #fff; margin: 0 0 20px 0;
}
#private-create-modal .pcm-row {
  margin-bottom: 18px;
}
#private-create-modal .pcm-password-input {
  width: 100%;
  padding: 10px 12px;
  background: #1a1f2e;
  color: #e0e0e0;
  border: 1px solid #3a4458;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  outline: none;
}
.pcm-password-input:focus { border-color: #6a8fcc; }
.pcm-label {
  font-size: 12px; color: #888; letter-spacing: 1px;
  margin-bottom: 8px; display: block;
}
#private-create-modal .pcm-opts {
  display: flex; gap: 8px; flex-wrap: wrap;
}
#private-create-modal .pcm-opt {
  padding: 8px 14px; border-radius: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  color: #ccc; font-size: 13px; cursor: pointer;
  transition: all 0.15s; font-family: inherit;
}
#private-create-modal .pcm-opt:hover {
  background: rgba(255,255,255,0.1);
}
#private-create-modal .pcm-opt.selected {
  background: rgba(68,170,255,0.25);
  border-color: rgba(68,170,255,0.6);
  color: #fff;
}
#private-create-modal .pcm-footer {
  display: flex; justify-content: space-between;
  align-items: center; margin-top: 24px;
  padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.1);
}
#private-create-modal .pcm-cost {
  color: #ffe082; font-size: 14px; font-weight: 700;
}
#private-create-modal .pcm-buttons {
  display: flex; gap: 10px;
}
#private-create-modal .pcm-cancel {
  background: rgba(255,255,255,0.05); color: #888;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 10px 20px; border-radius: 6px;
  cursor: pointer; font-family: inherit; font-size: 13px;
}
#private-create-modal .pcm-confirm {
  background: rgba(68,170,255,0.25); color: #8cf;
  border: 1px solid rgba(68,170,255,0.5);
  padding: 10px 22px; border-radius: 6px;
  cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 700;
}
#private-create-modal .pcm-confirm:hover {
  background: rgba(68,170,255,0.4);
}
#private-create-modal .pcm-confirm:disabled {
  opacity: 0.35; cursor: not-allowed;
}
#private-create-modal .pcm-msg {
  font-size: 12px; min-height: 16px; margin-top: 6px;
}
#private-create-modal .pcm-msg.err { color: #ff8888; }
/* ===== 게스트 확인 모달 (Phase 2g) ===== */
#guest-warn-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  display: none; justify-content: center; align-items: center;
  z-index: 2100;
}
#guest-warn-modal.active { display: flex; }
#guest-warn-modal .gwm-box {
  width: 440px; max-width: 92vw;
  background: #1a1a25;
  border: 1px solid rgba(255,170,70,0.4);
  border-radius: 14px; padding: 28px 30px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  text-align: center;
}
#guest-warn-modal .gwm-icon {
  font-size: 44px; margin-bottom: 10px;
}
#guest-warn-modal h3 {
  font-size: 20px; color: #ffd44d; margin: 0 0 14px 0;
  font-weight: 700;
}
#guest-warn-modal .gwm-body {
  font-size: 14px; color: #ddd; line-height: 1.7;
  margin-bottom: 22px;
  text-align: left;
  background: rgba(255,170,70,0.06);
  border: 1px solid rgba(255,170,70,0.18);
  border-radius: 8px;
  padding: 14px 16px;
}
#guest-warn-modal .gwm-buttons {
  display: flex; gap: 10px; justify-content: center;
}
#guest-warn-modal .gwm-cancel {
  background: rgba(255,255,255,0.05); color: #aaa;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 11px 22px; border-radius: 8px;
  cursor: pointer; font-family: inherit; font-size: 14px;
  transition: background .15s;
}
#guest-warn-modal .gwm-cancel:hover { background: rgba(255,255,255,0.12); color: #fff; }
#guest-warn-modal .gwm-confirm {
  background: rgba(255,170,70,0.22); color: #ffd44d;
  border: 1px solid rgba(255,170,70,0.55);
  padding: 11px 26px; border-radius: 8px;
  cursor: pointer; font-family: inherit; font-size: 14px;
  font-weight: 700;
  transition: background .15s;
}
#guest-warn-modal .gwm-confirm:hover {
  background: rgba(255,170,70,0.36); color: #fff;
}
@media (max-width: 540px) {
  #guest-warn-modal .gwm-box { padding: 22px 20px; }
  #guest-warn-modal h3 { font-size: 17px; }
  #guest-warn-modal .gwm-body { font-size: 13px; }
}


/* ===== 친구 패널 (오른쪽 하단 플로팅) ===== */
#friend-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 280px;
  background: rgba(20, 25, 40, 0.94);
  border: 1px solid rgba(120, 160, 220, 0.35);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.55);
  z-index: 520;
  font-family: inherit;
  display: none;
  backdrop-filter: blur(8px);
}
#friend-panel.visible { display: block; }
#friend-panel .fp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(120,160,220,0.18);
  user-select: none;
}
#friend-panel .fp-title { font-size: 13px; font-weight: 700; color: #e0ecff; }
#friend-panel .fp-title b { color: #7fc8ff; margin: 0 3px; }
#friend-panel .fp-toggle { font-size: 12px; color: #7fc8ff; }
#friend-panel .fp-body {
  max-height: 380px;
  overflow-y: auto;
  padding: 6px 0;
}
#friend-panel.collapsed .fp-body { display: none; }
#friend-panel.collapsed .fp-hint { display: none; }
#friend-panel .fp-body::-webkit-scrollbar { width: 6px; }
#friend-panel .fp-body::-webkit-scrollbar-thumb { background: rgba(120,160,220,0.3); border-radius: 3px; }
#friend-panel .fp-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
#friend-panel .fp-row:last-child { border-bottom: none; }
#friend-panel .fp-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(120,160,220,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  position: relative;
  flex-shrink: 0;
}
#friend-panel .fp-dot {
  position: absolute; right: -1px; bottom: -1px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #555; border: 2px solid #141928;
}
#friend-panel .fp-dot.online  { background: #55dd77; }
#friend-panel .fp-dot.ingame  { background: #ffc044; }
#friend-panel .fp-info { flex: 1; min-width: 0; }
#friend-panel .fp-name {
  font-size: 13px; color: #fff; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#friend-panel .fp-status { font-size: 10px; color: #888; margin-top: 1px; }
#friend-panel .fp-status.online  { color: #88dd88; }
#friend-panel .fp-status.ingame  { color: #ffc044; }
#friend-panel .fp-invite {
  background: rgba(100, 200, 140, 0.2);
  border: 1px solid rgba(100, 200, 140, 0.5);
  color: #9af0b4;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
#friend-panel .fp-invite:hover { background: rgba(100, 200, 140, 0.35); }
#friend-panel .fp-invite:disabled {
  opacity: 0.35; cursor: not-allowed;
  background: rgba(120,120,120,0.15);
  border-color: rgba(120,120,120,0.3);
  color: #888;
}
#friend-panel .fp-invited {
  font-size: 10px; color: #7fc8ff; font-weight: 700;
}
#friend-panel .fp-empty {
  padding: 30px 14px;
  text-align: center;
  color: #666;
  font-size: 12px;
}
#friend-panel .fp-hint {
  padding: 8px 14px;
  font-size: 10px;
  color: #7a8aa0;
  border-top: 1px solid rgba(120,160,220,0.18);
  text-align: center;
  background: rgba(40,55,90,0.3);
  border-radius: 0 0 14px 14px;
}

/* ===== 사설방 대기실 ===== */
#private-waiting .pw-header h2 {
  font-size: 22px; font-weight: 900; color: #fff; margin: 0;
}
#private-waiting .pw-sub {
  font-size: 12px; color: #888; margin-top: 4px;
}
#private-waiting .pw-cols {
  display: flex; gap: 14px;
  width: 90%; max-width: 900px;
  margin: 24px auto 20px;
  justify-content: center;
}
#private-waiting .pw-col {
  flex: 1;
  background: rgba(30, 40, 60, 0.6);
  border: 1px solid rgba(120,160,220,0.25);
  border-radius: 12px;
  padding: 14px 10px;
  min-height: 260px;
}
#private-waiting .pw-col.scissors { border-color: rgba(255, 80, 120, 0.45); }
#private-waiting .pw-col.rock     { border-color: rgba(255, 170, 60, 0.45); }
#private-waiting .pw-col.paper    { border-color: rgba(80, 200, 255, 0.45); }
#private-waiting .pw-col-head {
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 12px;
}
#private-waiting .pw-col.scissors .pw-col-head { color: #ff5078; }
#private-waiting .pw-col.rock     .pw-col-head { color: #ffaa3c; }
#private-waiting .pw-col.paper    .pw-col-head { color: #50c8ff; }
#private-waiting .pw-col-emoji { font-size: 28px; display: block; margin-bottom: 4px; }
#private-waiting .pw-slots {
  display: flex; flex-direction: column; gap: 6px;
}
#private-waiting .pw-slot {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  background: rgba(0,0,0,0.3);
  border-radius: 7px;
  font-size: 12px;
  color: #fff;
  border: 1px dashed rgba(120,160,220,0.2);
}
#private-waiting .pw-slot.filled { border-style: solid; border-color: rgba(120,160,220,0.4); }
#private-waiting .pw-slot.host   { border-color: rgba(255,224,130,0.6); background: rgba(80,65,20,0.35); }
#private-waiting .pw-slot.ai     { opacity: 0.6; color: #9aa; font-style: italic; }
#private-waiting .pw-slot .pw-slot-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(120,160,220,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
#private-waiting .pw-slot .pw-slot-name {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#private-waiting .pw-slot .pw-slot-tag {
  font-size: 9px; color: #ffe082; font-weight: 700;
}
#private-waiting .pw-slot .pw-slot-kick {
  background: none; border: none; color: #ff8888;
  cursor: pointer; font-size: 14px; padding: 0 2px;
}
#private-waiting .pw-slot .pw-slot-kick:hover { color: #ff4444; }
#private-waiting .pw-footer {
  display: flex; justify-content: center; gap: 14px; margin-top: 10px;
}
#private-waiting .pw-start {
  background: linear-gradient(135deg, #55dd77 0%, #2e9d50 100%);
  color: #fff;
  padding: 14px 36px;
  border-radius: 10px;
  font-size: 18px; font-weight: 900;
  border: none; cursor: pointer;
  box-shadow: 0 4px 14px rgba(46, 157, 80, 0.4);
  font-family: inherit;
}
#private-waiting .pw-start:hover { filter: brightness(1.1); }
#private-waiting .pw-leave {
  background: rgba(255,100,100,0.15);
  border: 1px solid rgba(255,100,100,0.4);
  color: #ff9090;
  padding: 14px 22px;
  border-radius: 10px;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
#private-waiting .pw-leave:hover { background: rgba(255,100,100,0.25); }
#private-waiting .pw-info {
  font-size: 11px; color: #9aa; text-align: center; margin-top: 10px;
}


/* ===== 대기실 추가 (준비 버튼 / 기어 패널) ===== */
#private-waiting .pw-ready-box {
  display: flex; align-items: center; gap: 12px;
  justify-content: center;
  margin: 8px auto 0;
}
#private-waiting .pw-ready-btn {
  background: linear-gradient(135deg, #ffc044 0%, #e89020 100%);
  color: #2b1e00;
  border: none;
  padding: 10px 26px;
  border-radius: 8px;
  font-size: 14px; font-weight: 900;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 3px 10px rgba(255,192,68,0.3);
}
#private-waiting .pw-ready-btn:hover { filter: brightness(1.1); }
#private-waiting .pw-ready-btn.ready {
  background: linear-gradient(135deg, #55dd77 0%, #2e9d50 100%);
  color: #fff;
}
#private-waiting .pw-ready-timer-label {
  font-size: 12px; color: #ffc044;
}
#private-waiting .pw-ready-timer-label span { font-weight: 700; color: #fff; }
#private-waiting .pw-start:disabled {
  background: rgba(90,110,130,0.4);
  box-shadow: none;
  cursor: not-allowed;
  color: #aaa;
}
#private-waiting .pw-slot-ready {
  font-size: 10px;
  color: #55dd77;
  font-weight: 800;
  margin-right: 4px;
}
#private-waiting .pw-slot.ready {
  background: rgba(85, 221, 119, 0.12);
  border-color: rgba(85, 221, 119, 0.4);
}

/* 기어 패널 (스킨/아이콘 빠른 교체) */
#private-waiting .pw-gear {
  width: 90%; max-width: 900px;
  margin: 14px auto 0;
  background: rgba(20,30,50,0.6);
  border: 1px solid rgba(120,160,220,0.25);
  border-radius: 10px;
  padding: 12px 14px;
}
#private-waiting .pw-gear.locked { opacity: 0.55; }
#private-waiting .pw-gear-title {
  font-size: 12px; font-weight: 700; color: #7fc8ff;
  margin-bottom: 6px; margin-top: 4px;
}
#private-waiting .pw-gear-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 8px;
}
#private-waiting .pw-gear-card {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 9px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(120,160,220,0.25);
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  min-width: 90px;
}
#private-waiting .pw-gear-card:hover:not(:disabled) {
  border-color: #7fc8ff;
  background: rgba(40,60,90,0.5);
}
#private-waiting .pw-gear-card.active {
  border-color: #55dd77;
  background: rgba(46,157,80,0.2);
}
#private-waiting .pw-gear-card:disabled { cursor: not-allowed; }
#private-waiting .pw-gear-card .pw-gear-sw {
  width: 26px; height: 26px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
#private-waiting .pw-gear-card .pw-gear-nm {
  font-size: 11px;
}
#private-waiting .pw-gear-lock {
  margin-top: 6px;
  padding: 6px 10px;
  font-size: 11px;
  color: #ffb366;
  text-align: center;
  background: rgba(80,50,10,0.3);
  border-radius: 6px;
}

/* 꾸미기 모달 열기 버튼 (사설방 대기실 하단) */
#private-waiting .pw-customize-btn {
  display: block;
  margin: 10px auto;
  padding: 10px 22px;
  font-size: 14px; font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, rgba(120,170,255,0.35), rgba(90,130,220,0.25));
  border: 1px solid rgba(140,190,255,0.6);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 0 14px rgba(120,170,255,0.25);
  transition: transform 0.12s, box-shadow 0.2s, background 0.2s;
}
#private-waiting .pw-customize-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(120,170,255,0.55);
  background: linear-gradient(135deg, rgba(140,190,255,0.45), rgba(110,150,230,0.35));
}
#private-waiting .pw-customize-btn:disabled {
  opacity: 0.45; cursor: not-allowed; transform: none;
  box-shadow: none;
}
#private-waiting .pw-customize-locknote {
  margin-top: 4px;
  text-align: center; font-size: 11px; color: #ffb366;
}

/* ===== 꾸미기 모달 (사설방 대기실에서 열림) ===== */
#pw-customize-modal {
  position: fixed; inset: 0; z-index: 200;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(5, 10, 20, 0.72);
  backdrop-filter: blur(4px);
  padding: 20px;
  overflow-y: auto;
}
#pw-customize-modal.open { display: flex; }
#pw-customize-modal .pwm-panel {
  width: 100%; max-width: 820px;
  max-height: 90vh;
  background: linear-gradient(180deg, #1a1f33 0%, #0f1424 100%);
  border: 1px solid rgba(120,160,220,0.35);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  display: flex; flex-direction: column;
  overflow: hidden;
}
#pw-customize-modal .pwm-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(120,160,220,0.25);
  background: rgba(15, 20, 36, 0.7);
}
#pw-customize-modal .pwm-header h3 {
  margin: 0; font-size: 17px; font-weight: 800; color: #fff;
  flex: 1;
}
#pw-customize-modal .pwm-faction-label {
  font-size: 12px; color: #aaa;
}
#pw-customize-modal .pwm-close {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  width: 32px; height: 32px; border-radius: 8px;
  cursor: pointer; font-size: 16px; font-family: inherit;
  transition: background 0.15s;
}
#pw-customize-modal .pwm-close:hover {
  background: rgba(255,100,100,0.2);
  border-color: rgba(255,100,100,0.5);
}
#pw-customize-modal .pwm-tabs {
  display: flex; gap: 4px; padding: 10px 14px 0;
  background: rgba(15, 20, 36, 0.5);
  border-bottom: 1px solid rgba(120,160,220,0.2);
  flex-wrap: wrap;
}
#pw-customize-modal .pwm-tab {
  padding: 8px 14px;
  font-size: 12px; font-weight: 700;
  color: #aaa;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
#pw-customize-modal .pwm-tab:hover {
  color: #fff; background: rgba(120,170,255,0.1);
}
#pw-customize-modal .pwm-tab.active {
  color: #fff;
  background: rgba(120,170,255,0.18);
  border-color: rgba(140,190,255,0.5);
  box-shadow: 0 -2px 8px rgba(120,170,255,0.2);
}
#pw-customize-modal .pwm-content {
  flex: 1;
  padding: 18px 22px;
  overflow-y: auto;
}
#pw-customize-modal .pwm-locknote {
  margin: 12px 22px 18px;
  padding: 10px 14px;
  background: rgba(80,50,10,0.35);
  border: 1px solid rgba(255,180,100,0.35);
  color: #ffb366;
  border-radius: 8px;
  font-size: 12px; text-align: center;
}

/* 친구창 나 자신 행 강조 */
#friend-panel .fp-row.fp-me {
  background: rgba(127, 200, 255, 0.08);
  border-bottom: 2px solid rgba(127, 200, 255, 0.3);
}
#friend-panel .fp-row.fp-me .fp-name { color: #7fc8ff; }


/* ===== 상점 탭 ===== */
#shop-screen .shop-tabs {
  display: flex; gap: 6px; justify-content: center;
  margin: 10px auto 14px;
  flex-wrap: wrap;
}
#shop-screen .shop-tab {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(120,160,220,0.2);
  color: #aaa;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
#shop-screen .shop-tab:hover { background: rgba(255,255,255,0.12); color: #fff; }
#shop-screen .shop-tab.active {
  background: rgba(68,170,255,0.25);
  border-color: #44aaff;
  color: #fff;
}
#shop-screen .shop-recharge {
  background: linear-gradient(135deg, #55dd77 0%, #2e9d50 100%);
  border: none;
  color: #fff;
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  margin-left: 10px;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(46,157,80,0.4);
}
#shop-screen .shop-recharge:hover { filter: brightness(1.1); }

/* __PHASE_ZB2_USD_NOADS_CARD__ 광고제거 평생권 카드 (상점 상단) */
/* noads_lifetime: removes ZB-1 interstitial only. ad-mw / ad-rr banners remain visible. */
#shop-screen .shop-noads-hero {
  margin: 14px auto 18px;
  max-width: 728px; width: 100%;
  background: linear-gradient(135deg, rgba(255,138,68,0.18) 0%, rgba(255,192,68,0.12) 100%);
  border: 1.5px solid rgba(255,192,68,0.5);
  border-radius: 14px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  box-shadow: 0 4px 18px rgba(255,138,68,0.15);
}
#shop-screen .shop-noads-left {
  display: flex; align-items: center; gap: 16px;
  flex: 1; min-width: 240px;
}
#shop-screen .shop-noads-icon {
  font-size: 44px; flex-shrink: 0; line-height: 1;
}
#shop-screen .shop-noads-info h3 {
  font-size: 17px; color: #fff; margin-bottom: 4px; font-weight: 700;
}
#shop-screen .shop-noads-info .snh-period {
  color: #ffc044; font-size: 12px; margin-bottom: 6px; font-weight: 600;
}
#shop-screen .shop-noads-info .snh-feat {
  font-size: 12px; color: #ddd; line-height: 1.6;
}
#shop-screen .shop-noads-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  flex-shrink: 0;
}
#shop-screen .shop-noads-price {
  font-size: 26px; font-weight: 800; color: #ffc044;
  line-height: 1;
}
#shop-screen .shop-noads-price small {
  font-size: 11px; color: #aac; font-weight: 400;
  display: block; margin-top: 4px;
}
#shop-screen .shop-noads-buy {
  background: linear-gradient(135deg, #ff8a44, #ffc044);
  color: #1a1a1a; border: none;
  padding: 9px 18px; border-radius: 7px;
  font-size: 13px; font-weight: 800; cursor: pointer;
  font-family: inherit;
  transition: filter 0.15s, transform 0.15s;
}
#shop-screen .shop-noads-buy:hover { filter: brightness(1.1); transform: translateY(-1px); }
@media (max-width: 540px) {
  #shop-screen .shop-noads-hero { padding: 14px 16px; }
  #shop-screen .shop-noads-icon { font-size: 36px; }
  #shop-screen .shop-noads-info h3 { font-size: 15px; }
  #shop-screen .shop-noads-right { width: 100%; align-items: stretch; }
  #shop-screen .shop-noads-buy { width: 100%; text-align: center; }
}


/* ===== 충전 모달 ===== */
#recharge-modal {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 700;
  align-items: center; justify-content: center;
}
#recharge-modal.active { display: flex; }
#recharge-modal .rc-box {
  background: #1a2030;
  border: 1px solid rgba(120,160,220,0.35);
  border-radius: 14px;
  padding: 28px 34px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 10px 50px rgba(0,0,0,0.7);
}
#recharge-modal h3 {
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  margin: 0 0 6px;
  text-align: center;
}
#recharge-modal .rc-sub {
  color: #888;
  font-size: 12px;
  text-align: center;
  margin-bottom: 18px;
}
#recharge-modal .rc-pkgs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
#recharge-modal .rc-pkg {
  background: rgba(30,45,70,0.7);
  border: 1px solid rgba(120,160,220,0.3);
  border-radius: 10px;
  padding: 14px 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  font-family: inherit;
  color: #fff;
}
#recharge-modal .rc-pkg:hover {
  border-color: #55dd77;
  background: rgba(46,157,80,0.25);
}
#recharge-modal .rc-pkg.best { border-color: #ffc044; }
#recharge-modal .rc-popular {
  font-size: 10px; color: #ffc044;
  display: block; margin-bottom: 3px;
}
#recharge-modal .rc-amount {
  font-size: 20px; font-weight: 900; color: #ffc044;
  margin-bottom: 4px;
}
#recharge-modal .rc-bonus {
  font-size: 10px; color: #55dd77; margin-bottom: 6px;
  min-height: 12px;
}
#recharge-modal .rc-price {
  font-size: 14px; font-weight: 700; color: #fff;
}
#recharge-modal .rc-notice {
  background: rgba(80,60,20,0.35);
  border: 1px solid rgba(255,192,68,0.3);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 11px;
  color: #ffcc88;
  text-align: center;
  line-height: 1.5;
  margin-bottom: 14px;
}
#recharge-modal .rc-footer { text-align: center; }
#recharge-modal .rc-cancel {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #ddd;
  padding: 10px 28px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
#recharge-modal .rc-cancel:hover { background: rgba(255,255,255,0.15); }

/* ===== 친구 채팅창 ===== */
#friend-chat {
  position: fixed;
  right: 310px;
  bottom: 18px;
  width: 320px;
  height: 440px;
  background: rgba(20, 25, 40, 0.97);
  border: 1px solid rgba(120, 160, 220, 0.4);
  border-radius: 14px;
  box-shadow: 0 12px 50px rgba(0,0,0,0.65);
  z-index: 530;
  display: none;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(8px);
}
#friend-chat.visible { display: flex; }
#friend-chat .fc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(40,55,90,0.5);
  border-bottom: 1px solid rgba(120,160,220,0.25);
}
#friend-chat .fc-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
#friend-chat .fc-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(120,160,220,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
#friend-chat .fc-name { font-size: 13px; font-weight: 700; color: #fff; }
#friend-chat .fc-status {
  font-size: 10px; color: #55dd77; margin-left: 6px;
}
#friend-chat .fc-close {
  background: none; border: none;
  color: #888;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  font-family: inherit;
}
#friend-chat .fc-close:hover { color: #fff; }
#friend-chat .fc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
#friend-chat .fc-messages::-webkit-scrollbar { width: 6px; }
#friend-chat .fc-messages::-webkit-scrollbar-thumb { background: rgba(120,160,220,0.3); border-radius: 3px; }
#friend-chat .fc-msg {
  max-width: 80%;
  padding: 7px 11px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.35;
  word-wrap: break-word;
}
#friend-chat .fc-msg.me {
  align-self: flex-end;
  background: rgba(68,170,255,0.35);
  color: #fff;
  border-bottom-right-radius: 3px;
}
#friend-chat .fc-msg.them {
  align-self: flex-start;
  background: rgba(255,255,255,0.08);
  color: #ddd;
  border-bottom-left-radius: 3px;
}
#friend-chat .fc-msg.system {
  align-self: center;
  background: rgba(255,192,68,0.15);
  color: #ffc044;
  font-size: 10px;
  font-style: italic;
  padding: 4px 10px;
}
#friend-chat .fc-input-row {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(40,55,90,0.3);
  border-top: 1px solid rgba(120,160,220,0.2);
}
#friend-chat .fc-input {
  flex: 1;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(120,160,220,0.3);
  border-radius: 7px;
  padding: 8px 10px;
  color: #fff;
  font-size: 12px;
  font-family: inherit;
  outline: none;
}
#friend-chat .fc-input:focus { border-color: #7fc8ff; }
#friend-chat .fc-send {
  background: rgba(68,170,255,0.3);
  border: 1px solid rgba(68,170,255,0.5);
  color: #fff;
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
#friend-chat .fc-send:hover { background: rgba(68,170,255,0.5); }

/* 친구 패널: 채팅 버튼 추가 */
#friend-panel .fp-chat {
  background: rgba(68,170,255,0.2);
  border: 1px solid rgba(68,170,255,0.5);
  color: #9ad3ff;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  margin-left: 4px;
}
#friend-panel .fp-chat:hover { background: rgba(68,170,255,0.35); }
#friend-panel .fp-chat:disabled {
  opacity: 0.35; cursor: not-allowed;
  background: rgba(120,120,120,0.15);
  border-color: rgba(120,120,120,0.3);
  color: #888;
}


/* ===== 닉네임 설정 화면 ===== */
/* display 는 .screen-overlay / .screen-overlay.active 규칙에 맡긴다 */
#nickname-setup h2 { font-size: 34px; margin-bottom: 6px; color: #fff; }
#nickname-setup .ns-sub { color: #888; margin-bottom: 28px; font-size: 13px; text-align: center; max-width: 420px; line-height: 1.6; }
#nickname-setup .ns-box {
  width: 440px; max-width: 90vw;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px; padding: 28px 26px;
}
#nickname-setup .ns-label { font-size: 12px; color: #aaa; margin-bottom: 8px; font-weight: 600; }
#nickname-setup .ns-input {
  width: 100%; background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.18); border-radius: 8px;
  color: #fff; font-size: 18px; padding: 12px 14px;
  outline: none; box-sizing: border-box;
  font-family: inherit;
}
#nickname-setup .ns-input:focus { border-color: #7fc8ff; background: rgba(20,40,80,0.4); }
#nickname-setup .ns-preview {
  margin-top: 14px; padding: 12px 14px;
  background: rgba(100,200,255,0.08);
  border: 1px dashed rgba(127,200,255,0.4);
  border-radius: 8px;
  color: #7fc8ff; font-size: 15px; text-align: center;
  min-height: 22px;
}
#nickname-setup .ns-preview b { color: #fff; font-weight: 700; }
#nickname-setup .ns-example { color: #666; font-size: 11px; margin-top: 10px; line-height: 1.5; }
#nickname-setup .ns-rules { color: #777; font-size: 11px; margin-top: 8px; line-height: 1.5; }
#nickname-setup .ns-err { color: #ff6677; font-size: 12px; margin-top: 8px; min-height: 16px; }
#nickname-setup .ns-buttons { display: flex; gap: 10px; margin-top: 18px; }
#nickname-setup .ns-btn {
  flex: 1; padding: 13px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06); color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: inherit;
}
#nickname-setup .ns-btn:hover { background: rgba(255,255,255,0.12); }
#nickname-setup .ns-btn.primary {
  background: linear-gradient(135deg, #4a7fff, #6a9fff);
  border-color: #6a9fff;
}
#nickname-setup .ns-btn.primary:hover { background: linear-gradient(135deg, #5a8fff, #7aafff); }
#nickname-setup .ns-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== 친구추가 모달 ===== */
#addfriend-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); z-index: 2600;
  align-items: center; justify-content: center;
}
#addfriend-modal.active { display: flex; }
#addfriend-modal .af-card {
  width: 420px; max-width: 92vw;
  background: linear-gradient(160deg, #18243a 0%, #0e1622 100%);
  border: 1px solid rgba(127,200,255,0.25);
  border-radius: 14px; padding: 22px 22px 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  color: #fff;
}
#addfriend-modal .af-title { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
#addfriend-modal .af-sub { color: #888; font-size: 11px; margin-bottom: 16px; }
#addfriend-modal .af-label { font-size: 11px; color: #aaa; margin-bottom: 6px; font-weight: 600; }
#addfriend-modal .af-input {
  width: 100%; background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.18); border-radius: 8px;
  color: #fff; font-size: 14px; padding: 10px 12px;
  outline: none; box-sizing: border-box; font-family: inherit;
}
#addfriend-modal .af-input:focus { border-color: #7fc8ff; }
#addfriend-modal .af-hint { color: #666; font-size: 10px; margin-top: 6px; }
#addfriend-modal .af-err { color: #ff6677; font-size: 11px; margin-top: 6px; min-height: 14px; }
#addfriend-modal .af-btns { display: flex; gap: 8px; margin-top: 14px; }
#addfriend-modal .af-btn {
  flex: 1; padding: 10px; border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.05); color: #fff;
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: inherit;
}
#addfriend-modal .af-btn.primary {
  background: linear-gradient(135deg, #3e8e5e, #55b07e);
  border-color: #55b07e;
}
#addfriend-modal .af-btn:hover { filter: brightness(1.15); }

/* ===== 친구창 — 친구추가 버튼 / 요청 섹션 ===== */
#friend-panel .fp-header-row {
  display: flex; align-items: center; gap: 6px; width: 100%;
}
#friend-panel .fp-addbtn {
  background: rgba(100,200,140,0.22);
  border: 1px solid rgba(100,200,140,0.45);
  color: #c8ffd8;
  padding: 3px 8px; border-radius: 5px;
  font-size: 10px; cursor: pointer; font-weight: 600;
  font-family: inherit;
}
#friend-panel .fp-addbtn:hover { background: rgba(100,200,140,0.35); }
#friend-panel .fp-reqsec {
  border-top: 1px dashed rgba(255,255,255,0.1);
  border-bottom: 1px dashed rgba(255,255,255,0.1);
  padding: 6px 2px; margin-bottom: 4px;
}
#friend-panel .fp-reqtitle {
  font-size: 10px; color: #ffcc66;
  font-weight: 700; margin: 2px 4px 4px;
}
#friend-panel .fp-req {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 4px; font-size: 11px;
}
#friend-panel .fp-req .fp-avatar { width: 24px; height: 24px; font-size: 14px; }
#friend-panel .fp-req .fp-req-name {
  flex: 1; min-width: 0; color: #e0e0e0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#friend-panel .fp-req-accept, #friend-panel .fp-req-reject {
  padding: 3px 7px; border-radius: 5px;
  font-size: 10px; cursor: pointer; font-weight: 600;
  border: 1px solid; font-family: inherit;
}
#friend-panel .fp-req-accept {
  background: rgba(100,200,140,0.25); border-color: rgba(100,200,140,0.5); color: #c8ffd8;
}
#friend-panel .fp-req-reject {
  background: rgba(220,80,100,0.2); border-color: rgba(220,80,100,0.45); color: #ffc8c8;
}

/* ===== 닉네임 변경 모달 ===== */
#namechange-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.75); z-index: 2700;
  align-items: center; justify-content: center;
}
#namechange-modal.active { display: flex; }
#namechange-modal .nc-card {
  width: 440px; max-width: 92vw;
  background: linear-gradient(160deg, #2a1f3a 0%, #15101f 100%);
  border: 1px solid rgba(200,160,255,0.3);
  border-radius: 14px; padding: 24px; color: #fff;
}
#namechange-modal .nc-title { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
#namechange-modal .nc-sub { color: #a090b0; font-size: 11px; margin-bottom: 14px; }
#namechange-modal .nc-current {
  padding: 8px 12px; background: rgba(0,0,0,0.3);
  border-radius: 6px; font-size: 12px; color: #ccc;
  margin-bottom: 14px;
}
#namechange-modal .nc-current b { color: #d0b0ff; }
/* Phase 2p : 닉네임 변경 모달 버튼 — 모던 스타일 */
#namechange-modal .af-err { color: #ff7788; font-size: 12px; margin-top: 10px; min-height: 16px; }
#namechange-modal .af-btns { display: flex; gap: 10px; margin-top: 18px; }
#namechange-modal .af-btn {
  flex: 1;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #ddd;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.3px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
#namechange-modal .af-btn:hover {
  background: rgba(255,255,255,0.11);
  border-color: rgba(255,255,255,0.28);
  color: #fff;
  transform: translateY(-1px);
}
#namechange-modal .af-btn.primary {
  background: linear-gradient(135deg, #9a6af0 0%, #6d3cd3 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(138, 92, 246, 0.35);
}
#namechange-modal .af-btn.primary:hover {
  background: linear-gradient(135deg, #a97bff 0%, #7b4ae0 100%);
  box-shadow: 0 6px 20px rgba(138, 92, 246, 0.5);
  transform: translateY(-1px);
}
#namechange-modal .af-btn:active { transform: translateY(0); box-shadow: none; }
#namechange-modal .af-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

/* ===== 친구 요청 모달 ===== */
#friendreq-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.72); z-index: 2650;
  align-items: center; justify-content: center;
}
#friendreq-modal.active { display: flex; }
#friendreq-modal .fr-card {
  width: 420px; max-width: 92vw; max-height: 70vh;
  background: linear-gradient(160deg, #18243a 0%, #0e1622 100%);
  border: 1px solid rgba(127,200,255,0.25);
  border-radius: 14px; padding: 18px 18px 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  color: #fff; display: flex; flex-direction: column;
}
#friendreq-modal .fr-title {
  font-size: 16px; font-weight: 700; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between;
}
#friendreq-modal .fr-close {
  background: none; border: none; color: #888;
  font-size: 20px; cursor: pointer; padding: 0 4px;
  font-family: inherit;
}
#friendreq-modal .fr-close:hover { color: #fff; }
#friendreq-modal .fr-list {
  overflow-y: auto; flex: 1;
  padding: 4px 2px;
}
#friendreq-modal .fr-empty {
  text-align: center; color: #666; padding: 30px 10px; font-size: 12px;
}
#friendreq-modal .fr-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
#friendreq-modal .fr-row:last-child { border-bottom: none; }
#friendreq-modal .fr-av {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.1); display: flex;
  align-items: center; justify-content: center; font-size: 16px;
}
#friendreq-modal .fr-info { flex: 1; min-width: 0; }
#friendreq-modal .fr-name {
  font-size: 13px; color: #fff; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#friendreq-modal .fr-name .fr-tag { color: #666; font-size: 10px; font-weight: 400; }
#friendreq-modal .fr-sub { font-size: 10px; color: #888; margin-top: 2px; }
#friendreq-modal .fr-accept, #friendreq-modal .fr-reject {
  padding: 5px 10px; border-radius: 5px;
  font-size: 11px; cursor: pointer; font-weight: 600;
  border: 1px solid; font-family: inherit;
}
#friendreq-modal .fr-accept {
  background: rgba(100,200,140,0.25); border-color: rgba(100,200,140,0.5); color: #c8ffd8;
}
#friendreq-modal .fr-accept:hover { background: rgba(100,200,140,0.4); }
#friendreq-modal .fr-reject {
  background: rgba(220,80,100,0.2); border-color: rgba(220,80,100,0.45); color: #ffc8c8;
}
#friendreq-modal .fr-reject:hover { background: rgba(220,80,100,0.35); }

/* 친구창 헤더 요청 버튼 */
#friend-panel .fp-reqbtn {
  position: relative;
  background: rgba(255,200,100,0.2);
  border: 1px solid rgba(255,200,100,0.45);
  color: #ffd88a;
  padding: 3px 8px; border-radius: 5px;
  font-size: 10px; cursor: pointer; font-weight: 600;
  font-family: inherit;
}
#friend-panel .fp-reqbtn:hover { background: rgba(255,200,100,0.32); }
#friend-panel .fp-reqbtn .fp-reqbadge {
  display: inline-block; min-width: 14px; height: 14px;
  border-radius: 7px; background: #ff4444; color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 0 4px; margin-left: 3px; line-height: 14px;
}

/* 마이페이지 이펙트 카드 */
#mypage-screen .mp-effect-anim {
  display: inline-block;
  animation: mpEffectPulse 1.6s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(127,200,255,0.7));
}
@keyframes mpEffectPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.12); opacity: 1; }
}

/* 마이페이지 ON/OFF 토글 행 */
#mypage-screen .mp-toggle-row {
  display: flex; align-items: center; gap: 14px;
  margin: 10px 0 16px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  flex-wrap: wrap;
}
#mypage-screen .mp-toggle-label {
  font-size: 13px; font-weight: 700; color: #eee;
}
#mypage-screen .mp-toggle {
  position: relative;
  width: 62px; height: 28px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.35);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  display: flex; align-items: center; padding: 0;
}
#mypage-screen .mp-toggle .mp-toggle-knob {
  position: absolute; left: 3px; top: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #888;
  transition: left 0.2s, background 0.2s;
}
#mypage-screen .mp-toggle .mp-toggle-text {
  position: absolute; right: 8px;
  font-size: 10px; font-weight: 900; color: #888; letter-spacing: 0.5px;
  transition: color 0.2s, left 0.2s, right 0.2s;
}
#mypage-screen .mp-toggle.on {
  background: linear-gradient(135deg, rgba(68,204,68,0.35), rgba(68,170,68,0.2));
  border-color: rgba(68,204,68,0.55);
}
#mypage-screen .mp-toggle.on .mp-toggle-knob {
  left: 39px; background: #44cc44;
  box-shadow: 0 0 10px rgba(68,204,68,0.6);
}
#mypage-screen .mp-toggle.on .mp-toggle-text {
  color: #44cc44; right: auto; left: 8px;
}
#mypage-screen .mp-toggle-hint {
  font-size: 11.5px; color: #888;
  flex: 1; min-width: 200px;
}

/* 업적 칭호 구분 */
#mypage-screen .mp-achtitle-section {
  margin-top: 26px; padding-top: 18px;
  border-top: 2px dashed rgba(255,200,100,0.3);
}

/* ===== 언어 선택기 (i18n) ===== */
#lang-switcher {
  position: fixed; top: 14px; right: 14px; z-index: 9999;
  font-family: 'Segoe UI', sans-serif;
}
#lang-switcher-btn {
  background: rgba(0,0,0,0.55); color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px; padding: 6px 10px;
  font-size: 13px; cursor: pointer; user-select: none;
  backdrop-filter: blur(6px);
  transition: background 0.15s, border-color 0.15s;
  display: flex; align-items: center; gap: 6px;
}
#lang-switcher-btn:hover {
  background: rgba(40,40,70,0.75);
  border-color: rgba(120,180,255,0.5);
}
#lang-switcher-btn .ls-globe { font-size: 14px; }
#lang-switcher-btn .ls-current { opacity: 0.85; font-size: 12px; }
#lang-switcher-menu {
  position: absolute; top: 100%; right: 0; margin-top: 6px;
  background: #161a24; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px; min-width: 150px; padding: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  display: none;
}
#lang-switcher.open #lang-switcher-menu { display: block; }
#lang-switcher-menu .ls-item {
  display: block; width: 100%; text-align: left;
  background: transparent; color: #ddd;
  border: none; padding: 8px 12px; border-radius: 6px;
  font-size: 13px; cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
#lang-switcher-menu .ls-item:hover { background: rgba(80,130,220,0.18); color: #fff; }
#lang-switcher-menu .ls-item.active { color: #7fc8ff; background: rgba(80,130,220,0.12); }
#lang-switcher-menu .ls-item.active::before { content: '✓ '; }

/* 게임 중엔 숨김 */
body.in-game #lang-switcher { display: none; }

/* ===== 타이틀 언어 버튼 (Phase 2b) ===== */
#title-lang-switcher {
  position: relative;
  margin-top: 18px;
  display: inline-block;
}
#title-lang-switcher .title-lang-btn {
  padding: 18px 56px; font-size: 22px; font-weight: 700;
  background: rgba(30, 40, 60, 0.55);
  color: #fff; border: 2px solid rgba(120, 180, 255, 0.35);
  border-radius: 8px; cursor: pointer;
  letter-spacing: 2px;
  display: inline-flex; align-items: center; gap: 10px;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
#title-lang-switcher .title-lang-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(120, 180, 255, 0.7);
  background: rgba(40, 60, 90, 0.75);
}
#title-lang-switcher .tls-globe { font-size: 22px; }
#title-lang-switcher .tls-caret { font-size: 14px; opacity: 0.7; margin-left: 4px; }
#title-lang-switcher .title-lang-menu {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: #161a24; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px; min-width: 220px; padding: 6px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.55);
  display: none; z-index: 100;
}
#title-lang-switcher.open .title-lang-menu { display: block; }
#title-lang-switcher .tls-item {
  display: block; width: 100%; text-align: center;
  background: transparent; color: #ddd;
  border: none; padding: 10px 14px; border-radius: 6px;
  font-size: 15px; cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
#title-lang-switcher .tls-item:hover { background: rgba(80,130,220,0.22); color: #fff; }
#title-lang-switcher .tls-item.active { color: #7fc8ff; background: rgba(80,130,220,0.16); }
#title-lang-switcher .tls-item.active::before { content: '\2713  '; }

/* 타이틀 화면에선 우상단 🌐 스위처 숨김 */
body:has(#title-screen.active) #lang-switcher { display: none; }
/* __PHASE_ZD_TITLE_LINKS_VISIBILITY__ About/HowToPlay/FAQ 링크 = 타이틀+진영인트로 화면에서만 표시, 게임 플레이 중 숨김 */
#zdTitleLinks { display: none !important; }
body:has(#title-screen.active) #zdTitleLinks,
body:has(#faction-intro.active) #zdTitleLinks { display: flex !important; }

/* __PHASE_OO_TITLES_TEXT_ONLY__ */
.mp-title-card .mp-title-text {
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  padding: 18px 8px 10px;
  letter-spacing: 0.5px;
  line-height: 1.2;
  word-break: keep-all;
}
.mp-title-card .mp-title-shop { color: #ffffff; }
.mp-title-card .mp-title-none { color: #888; font-weight: 600; }
.mp-title-card .mp-title-achievement {
  color: #FFD700;
  text-shadow: 0 0 6px rgba(255, 215, 0, 0.35), 0 1px 0 rgba(0,0,0,0.5);
}
.mp-title-card .mp-title-achievement.locked-text { color: #555; text-shadow: none; }
.si-icon.si-title-text {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  word-break: keep-all;
  line-height: 1.2;
}

/* __PHASE_PP2_CHALLENGER_TONE__ — 챌린저 카드 톤 */
.mp-title-card {
  background: linear-gradient(160deg, #1a2238 0%, #0f1521 55%, #08090e 100%) !important;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}
.mp-title-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,200,200,0.4), transparent);
  pointer-events: none;
}
.mp-title-card.mp-title-card-ach::before {
  background: linear-gradient(90deg, transparent, rgba(255,215,0,0.7), transparent);
}
.mp-title-card.active {
  border-color: rgba(255,215,0,0.45);
  box-shadow: 0 0 14px rgba(255,215,0,0.18);
}
.mp-title-card .mp-title-text {
  font-size: 24px !important;
  font-weight: 900 !important;
  letter-spacing: 1px !important;
  padding: 22px 8px 12px !important;
}
.mp-title-card .mp-title-shop {
  background: linear-gradient(180deg, #ffffff 0%, #d8d8d8 55%, #a0a0a0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.18));
}
.mp-title-card .mp-title-none {
  color: #6c6c6c !important;
  font-weight: 700 !important;
}
.mp-title-card .mp-title-achievement {
  background: linear-gradient(180deg, #fff8c2 0%, #ffd700 45%, #d49c00 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 6px rgba(255,215,0,0.45));
  text-shadow: none !important;
}
.mp-title-card .mp-title-achievement.locked-text {
  background: linear-gradient(180deg, #5a5a5a, #333);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: none;
}
/* 상점 카드 칭호 — si-title-text 메탈릭 + 카드 챌린저 톤 */
.shop-item:has(.si-title-text) {
  background: linear-gradient(160deg, #1a2238 0%, #0f1521 55%, #08090e 100%);
  position: relative;
  overflow: hidden;
}
.shop-item:has(.si-title-text)::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,200,200,0.4), transparent);
  pointer-events: none;
}
.si-icon.si-title-text {
  font-size: 22px !important;
  font-weight: 900 !important;
  letter-spacing: 0.8px !important;
  min-height: 56px !important;
  background: linear-gradient(180deg, #ffffff 0%, #d8d8d8 60%, #9a9a9a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.18));
}

/* __PHASE_20C_PROFILE_IMG__ 프로필 이미지 아바타 (이모지 자리 대체) */
.av-img{width:100%;height:100%;border-radius:50%;object-fit:cover;display:block;}
#mypage-screen .mp-icon .av-img{width:48px;height:48px;margin:0 auto;}
#shop-screen .si-icon .av-img{width:56px;height:56px;}
