/* 글씨체: IBM Plex Sans KR (각지고 읽기 쉬운 한글) · IBM Plex Mono (숫자 · 시간) — @import는 파일 맨 앞에 있어야 해요 */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=IBM+Plex+Sans+KR:wght@400;500;700&display=swap");

/* ===========================================
   style.css — 모든 페이지가 같이 쓰는 "옷"
   색은 전부 아래 변수(--이름)로만 씁니다.
   테마는 세 가지 색(--theme-bg · --theme-panel · --theme-accent)뿐이고,
   theme.js가 거기서 글자 · 테두리 · 버튼 글자 색까지 계산해 html에 칠해요 (계정마다 저장).
   아래 값은 theme.js가 아직 안 돌았을 때의 기본값 = 공식 테마 미드나잇 블루
   =========================================== */
:root {
  --theme-bg: #030C24;    /* 배경 */
  --theme-panel: #071A43; /* 카드 · 패널 */
  --theme-accent: #123C80;/* 강조 (버튼 · 선택 · 게이지) */
  --bg:      var(--theme-bg);
  --surface: var(--theme-panel);
  --border:  #1E3466;   /* 테두리 */
  --text:    #F2F5FB;   /* 글자 */
  --muted:   #A9B6D3;   /* 흐린 글자 */
  --accent:  var(--theme-accent);
  --on-accent: #F2F5FB; /* 강조색 위의 글자 */
  --accent-text: #7FA3E6; /* 강조색으로 쓰는 글자 (배경 위에서 4.5:1 이상) */
  --accent-edge: var(--theme-accent);
  --panel-shadow: none;
  --page-text: #F2F5FB; --page-muted: #A9B6D3; --page-accent-text: #7FA3E6; --page-danger: #FF6B6B;
  --panel-text: #F2F5FB; --panel-muted: #A9B6D3; --panel-accent-text: #7FA3E6; --panel-danger: #FF6B6B;
  --danger:  #FF6B6B;   /* 오류 메시지 */
  --font: "IBM Plex Sans KR", system-ui, "Malgun Gothic", sans-serif;          /* 사이트 전체 글씨체 */
  --font-mono: "IBM Plex Mono", "IBM Plex Sans KR", ui-monospace, Consolas, monospace; /* 숫자 · 시간 (고정폭) */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  transition: background 0.2s, color 0.2s;
}

/* 위쪽 메뉴 막대 */
.topbar {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar .logo {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--accent-text);
  text-shadow: 0 0 10px var(--accent);
  white-space: nowrap;
  text-decoration: none;
}
/* 위쪽 메뉴: 글자 링크 */
.topbar nav { display: flex; gap: 24px; flex: 1; flex-wrap: wrap; }
/* 코어(화폐) 동전 아이콘: 금색 동전 안에 육각형 코어 */
.coin {
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.18em;
  margin-right: 4px;
  flex-shrink: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='11.5' fill='%23B8860B'/%3E%3Ccircle cx='12' cy='12' r='9.5' fill='%23F5C542'/%3E%3Ccircle cx='12' cy='12' r='7.6' fill='none' stroke='%23E0A82E' stroke-width='1'/%3E%3Cpath d='M12 6.6l4.6 2.7v5.4L12 17.4l-4.6-2.7V9.3z' fill='%23FFE48A' stroke='%23B8860B' stroke-width='1.4' stroke-linejoin='round'/%3E%3Ccircle cx='12' cy='12' r='1.7' fill='%23B8860B'/%3E%3C/svg%3E") center / contain no-repeat;
}
.core-line { display: flex; align-items: center; gap: 2px; }
.left-status .core-line { margin: 12px 0 0; }
.topbar nav a { color: var(--muted); text-decoration: none; }
.topbar nav a:hover, .topbar nav a.active { color: var(--text); }

main { max-width: 720px; margin: 32px auto; padding: 0 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 20px;
  margin-bottom: 16px;
}

h1 { margin-top: 0; }
.muted { color: var(--muted); }

button, .button {
  display: inline-block;
  border: none;
  border-radius: 3px;
  padding: 10px 18px;
  font-size: 1rem;
  cursor: pointer;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
}
button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

input[type="text"], input[type="password"], input[type="email"], input[type="number"], textarea {
  width: 100%;
  padding: 10px;
  font-size: 1rem;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  margin-bottom: 12px;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); }

[hidden] { display: none !important; } /* hidden이 붙은 건 무조건 숨기기 */

/* ---------- 맨 위 KR 시간 막대 ---------- */
.statusbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 4px 16px;
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.statusbar .kr { color: var(--accent-text); font-weight: 700; }

/* ---------- 메인 화면 도시 그림 ---------- */
.scene {
  position: relative;
  height: clamp(210px, 46vw, 340px); /* 세로로 넉넉하게: 고층 건물까지 */
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.scene svg, .scene canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.scene .flash {           /* 번개 번쩍 */
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.scene .flash.on { opacity: 0.5; }

.scene .star    { animation: twinkle 3s ease-in-out infinite; }
.scene .flicker { animation: flicker 4s steps(1) infinite; }
.scene .cloud   { animation: drift 90s linear infinite; }
.scene .flyer   { animation: fly 22s linear infinite; }
.scene .blink   { animation: blink 1s steps(1) infinite; }
.scene .fog     { animation: fog 9s ease-in-out infinite alternate; }

@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }
@keyframes flicker { 0% { opacity: 1; } 90% { opacity: 0.15; } 93% { opacity: 1; } 96% { opacity: 0.3; } 98% { opacity: 1; } }
@keyframes drift   { from { transform: translateX(-120px); } to { transform: translateX(920px); } }
@keyframes fly     { from { transform: translate(-60px, 0); } to { transform: translate(860px, -18px); } }
@keyframes blink   { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes fog     { from { transform: translateX(-40px); } to { transform: translateX(40px); } }

@media (prefers-reduced-motion: reduce) {
  .scene * { animation: none !important; }
}

/* 큰 제목 NULL-POINT */
.title {
  font-size: clamp(2.2rem, 9vw, 3.5rem);
  letter-spacing: 0.12em;
  text-align: center;
  color: var(--accent-text);
  text-shadow: 0 0 18px var(--accent);  /* 은은하게 빛나는 효과 */
  margin: 8px 0 4px;
  animation: neonFlicker 7s infinite;   /* 네온사인처럼 가끔 깜빡 */
}

/* 버튼을 누르면 "톡" 하고 살짝 밝아졌다 돌아와요 (ui.js가 neon-press를 잠깐 붙여요) */
.neon-press { animation: press 0.18s ease-out; }
@keyframes press {
  0%   { filter: brightness(1.3); transform: scale(0.97); }
  100% { filter: none; transform: none; }
}
nav a.neon-press { animation: pressText 0.18s ease-out; }
@keyframes pressText {
  0%   { opacity: 0.5; }
  100% { opacity: 1; }
}
html[data-motion="reduce"] .neon-press { animation: none; }
@media (prefers-reduced-motion: reduce) { .neon-press { animation: none; } }

/* 네온사인 깜빡임: 대부분 켜져 있다가, 가끔 "지직" 하고 꺼졌다 켜져요 */
@keyframes neonFlicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% {
    opacity: 1;
    text-shadow: 0 0 6px var(--accent), 0 0 18px var(--accent), 0 0 36px var(--accent);
  }
  20%, 24%, 55% {
    opacity: 0.35;
    text-shadow: none;
  }
}
/* 한 글자만 따로 고장 난 것처럼 더 자주 깜빡여요 */
.title .flicker-letter { animation: letterFlicker 3.3s infinite; }
@keyframes letterFlicker {
  0%, 40%, 44%, 47%, 49%, 100% { opacity: 1; }
  42%, 45.5%, 48% { opacity: 0.15; }
}
html[data-motion="reduce"] .title,
html[data-motion="reduce"] .title .flicker-letter { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .title, .title .flicker-letter { animation: none; }
}

/* 제목 아래 "정보국에 접속중..." */
.subtitle { text-align: center; color: var(--muted); margin: 0 0 24px; }

/* ---------- 메인 화면: AEGIS 정보국 보안 접속 연출 (index.html · 약 3초 · 이 탭에서 한 번만) ----------
   색은 모두 테마 변수 (기본 미드나잇 블루 · 커스텀 테마 그대로). opacity · transform만 움직이고, 반복하지 않아요 */
.intro-status { min-height: 1.5em; font-size: 0.9rem; letter-spacing: 0.04em; color: var(--accent-text); }
.intro-cursor { display: inline-block; width: 0.45em; height: 1em; margin-left: 3px; vertical-align: -2px; background: currentColor; opacity: 0; animation: introCursor 0.5s steps(1) 4; }
@keyframes introCursor { 0% { opacity: 0.7; } 50% { opacity: 0; } }
/* 0~0.4초: 부팅 — 화면이 살짝 밝아지고 얇은 스캔 선이 한 번 지나가요 */
main.intro-run { animation: introBoot 0.4s ease-out backwards; }
@keyframes introBoot { from { opacity: 0.55; } }
main.intro-run::before {
  content: ""; position: fixed; left: 0; right: 0; top: 0; height: 2px; z-index: 5; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--accent-text), transparent);
  opacity: 0; animation: introScan 0.45s ease-in;
}
@keyframes introScan { from { transform: translateY(0); opacity: 0.8; } to { transform: translateY(100vh); opacity: 0; } }
/* 0.4~1.1초: 도시가 나타나고 일부 창문이 차례로 켜져요 (지연은 화면 스크립트가 시간표에 맞춰 넣어요) */
#cityScene svg.intro-scene { animation: introFade 0.7s ease-out backwards; }
#cityScene rect.intro-win { animation: introFade 0.45s ease-out backwards; }
@keyframes introFade { from { opacity: 0; } }
/* 1.1~1.6초: 로고가 은은한 푸른빛으로 켜진 뒤 그대로 (그 뒤에는 원래 네온 효과) */
main.intro-run .title { animation: introLogo 0.5s ease-out 1.1s backwards; }
main.intro-run .title .flicker-letter { animation: none; }
@keyframes introLogo {
  from { opacity: 0; text-shadow: none; }
  60% { opacity: 1; text-shadow: 0 0 10px var(--accent), 0 0 28px var(--accent), 0 0 48px var(--accent); }
}
/* 로그인 · 계정 카드: 처음부터 누를 수 있고, 살짝 늦게 떠올라요 */
main.intro-run .card { animation: introCard 0.4s ease-out 0.3s backwards; }
@keyframes introCard { from { opacity: 0; transform: translateY(6px); } }
html[data-motion="reduce"] main.intro-run, html[data-motion="reduce"] main.intro-run *, html[data-motion="reduce"] main.intro-run::before,
html[data-motion="reduce"] .intro-cursor { animation: none !important; }
@media (prefers-reduced-motion: reduce) { main.intro-run, main.intro-run *, main.intro-run::before, .intro-cursor { animation: none !important; } }

/* 점이 . → .. → ... 순서로 바뀌는 애니메이션 */
.dots { display: inline-block; width: 1.5em; text-align: left; } /* 점 개수가 바뀌어도 글자가 흔들리지 않게 */
.dots::after {
  content: "...";
  animation: dots 1.2s steps(1) infinite;
}
@keyframes dots {
  0%   { content: "."; }
  33%  { content: ".."; }
  66%  { content: "..."; }
}
/* 움직임을 줄이도록 설정한 사람에게는 점을 멈춰서 보여줘요 */
@media (prefers-reduced-motion: reduce) {
  .dots::after { animation: none; }
}

/* 입력칸 이름표 */
label { display: block; font-size: 0.95rem; }
label input { margin-top: 6px; }

/* 로그인/회원가입 탭 */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs button { flex: 1; }

.error { color: var(--danger); min-height: 1.2em; margin-bottom: 0; }

/* 가로로 나란히 */
.row { display: flex; gap: 8px; align-items: flex-start; }
.row input { width: 90px; }

/* 표가 화면보다 넓으면 표만 옆으로 스크롤 */
.table-wrap { overflow-x: auto; margin-top: 12px; }
td { white-space: nowrap; }

button.small { padding: 4px 10px; font-size: 0.85rem; margin-right: 4px; }

/* ---------- 요원 본부 ---------- */
.small { font-size: 0.85rem; }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 3px;
  font-size: 0.8rem;
  background: var(--accent);
  color: var(--on-accent);
}
.ghost-badge { background: transparent; color: var(--text); border: 1px solid var(--border); }

.agent-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.agent-head h1 { margin: 0; font-size: 1.5rem; }

/* 체력·경험치·보스 막대 */
.bar-label { display: flex; justify-content: space-between; font-size: 0.85rem; margin-top: 10px; }
.bar { height: 10px; border-radius: 3px; background: var(--border); overflow: hidden; margin-top: 4px; }
.bar > div { height: 100%; transition: width 0.4s; }
.bar.hp > div   { background: #3DD68C; }
.bar.exp > div  { background: var(--accent-text); }
.bar.boss > div { background: #E5484D; }

.stat-table td { padding: 4px 8px; }
details summary { cursor: pointer; margin-top: 8px; }

/* 요원 등록: 고르는 카드 */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.pick-grid.two { grid-template-columns: 1fr 1fr; }
.pick {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--border);
}
.pick span { font-size: 0.85rem; color: var(--muted); }
.pick.selected { border-color: var(--accent-text); }
/* 등록 화면: 고른 역할 버튼 색 (에스퍼는 파랑, 가이드는 밝은 회백색) */
.pick.selected[data-role="esper"] { background: var(--accent); border-color: var(--accent-edge); color: var(--on-accent); }
.pick.selected[data-role="esper"] span { color: rgba(255, 255, 255, 0.85); }
.pick.selected[data-role="guide"] { background: var(--text); border-color: var(--text); color: var(--bg); } /* 가이드는 글자색 · 배경색을 뒤집어 에스퍼와 구분 */
.pick.selected[data-role="guide"] span { color: var(--bg); opacity: 0.8; }

/* 임무 */
.mission-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.map { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 12px 0; }
.room {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 58px;
  padding: 6px 4px;
  border-radius: 3px;
  border: 1px solid var(--border);
  opacity: 0.5;
}
.room.done { opacity: 0.8; }
.room.now  { opacity: 1; border-color: var(--accent-text); box-shadow: 0 0 10px var(--accent); }
.room-icon { font-size: 1.1rem; }
.room.room-ic { min-width: 0; width: 40px; height: 40px; padding: 0; justify-content: center; color: var(--muted); }
.room.room-ic.now { color: var(--accent-text); }
.room-name { font-size: 0.7rem; color: var(--muted); white-space: nowrap; }
.room-link { color: var(--border); }

/* 분기형 던전 지도 */
.bmap-scroll { width: 100%; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.bmap { position: relative; margin: 0 auto; }
.bmap svg { position: absolute; inset: 0; }
.bmap line { stroke: var(--border); stroke-width: 1.5; }
.bmap line.walked { stroke: var(--accent-text); opacity: 0.7; }
.bmap line.open { stroke: var(--accent-text); stroke-dasharray: 3 3; }
.bmap line.locked { opacity: 0.25; }
.bnode { position: absolute; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 3px; background: var(--panel, var(--bg)); color: var(--muted); }
.bnode svg { width: 18px; height: 18px; }
.bnode.visited { opacity: 0.75; }
.bnode.current { color: var(--accent-text); border-color: var(--accent-text); box-shadow: 0 0 8px var(--accent); }
.bnode.available { color: var(--text); border-color: var(--accent-text); border-style: dashed; }
.bnode.unknown { opacity: 0.55; }
.bnode.locked { opacity: 0.2; }
.bnode.anomaly::after { content: ""; position: absolute; top: -3px; right: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--danger, #e55); }
.bnode.bonus::before { content: "+"; position: absolute; bottom: -9px; right: -4px; font-size: 0.7rem; color: var(--accent-text); }
.bchoice { width: 100%; box-sizing: border-box; margin-top: 8px; padding: 8px; border: 1px solid var(--accent-text); border-radius: 3px; }
.bchoice-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.bchoice-row { display: flex; flex-wrap: wrap; gap: 6px; }
.bchoice-opt { display: inline-flex; align-items: center; gap: 4px; }
.bchoice-opt svg { width: 16px; height: 16px; }
.bchoice-opt em { font-style: normal; }
#missionSummary { white-space: pre-line; }
/* 가방 칸: 좁은 화면에서는 줄바꿈 */
.bag-tabs { flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.bag-tabs button { flex: 0 1 auto; margin: 0; }
/* 지역 고유 기믹: 상태 수치 · 지도 징후 표시 · 선택 설명 */
.gim-meter { width: 100%; display: grid; grid-template-columns: auto 1fr; gap: 2px 6px; align-items: center; margin-bottom: 6px; color: var(--muted); }
.gim-meter .bar { grid-column: 1 / -1; height: 4px; }
.bar.gim > div { background: var(--tone-2); }
.gim-ic { color: var(--accent-text); }
.bnode-gim { position: absolute; top: -7px; left: -5px; min-width: 12px; height: 12px; border-radius: 2px; font-size: 9px; line-height: 12px; text-align: center; font-weight: 700; background: var(--surface); color: var(--accent-text); border: 1px solid var(--accent-text); }
.bchoice-text { margin: 0 0 8px; line-height: 1.6; }

.log {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  max-height: 340px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
}
.log li { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.log time { color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }

.grade-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 12px; }
.grade-card { border: 1px solid var(--border); border-radius: 3px; padding: 12px; }
.grade-card p { white-space: pre-line; margin: 8px 0; }
.grade-head { display: flex; align-items: center; gap: 8px; }
.grade {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 3px;
  font-weight: 800;
  color: #fff;
}
.grade-E { background: #6B7280; }
.grade-D { background: #2F9E6A; }
.grade-C { background: #2F6FDE; }
.grade-B { background: #7A4FE0; }
.grade-A { background: #D9822B; }
.grade-S { background: #D93F5B; }

.item-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.item-row > :nth-child(2) { grid-column: 1; }
.item-row > button { grid-column: 2; grid-row: 1 / 3; }

#promoText, #awakenText { white-space: pre-line; }
.tabs.wrap { flex-wrap: wrap; }
.tabs.wrap button { flex: 1 1 auto; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #FF6B6B; vertical-align: middle; }
.stat-value { font-family: ui-monospace, Consolas, monospace; white-space: nowrap; }
.title-row { padding: 4px 0; font-size: 0.9rem; }
.title-row.locked { color: var(--muted); }
.ghost-button { background: transparent; color: var(--text); border: 1px solid var(--border); cursor: pointer; }
select {
  width: 100%;
  padding: 8px;
  margin: 6px 0 12px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}
/* 색조·채도·명도 막대 */
.color-row { display: block; margin: 12px 0; }
.color-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 14px;
  margin-top: 6px;
  border-radius: 3px;
  border: 1px solid var(--border);
  cursor: pointer;
}
.color-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #222;
}
.color-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid #222; }

.theme-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0 8px;
  padding: 14px;
  border-radius: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.preview-accent { color: var(--accent-text); font-weight: 700; }

.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 12px 0; }
.setting-row input[type="range"] { width: 50%; }

/* ---------- 프로필 사진 ---------- */
.avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  flex-shrink: 0;
}
.avatar.big { width: 96px; height: 96px; font-size: 2.2rem; }
.avatar img, .avatar span img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar span { width: 100%; height: 100%; display: grid; place-items: center; }
.avatar.clickable { cursor: pointer; }
.photo-row { display: flex; align-items: center; gap: 16px; }

/* ---------- 프로필 카드 ---------- */
/* 요원 카드는 어디서 보든 같은 크기 (왼쪽 칸 · 미리보기 · 정보 창 · 입어보기) — 스티커 자리도 똑같이 보여요 */
.profile-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 330px;
  max-width: 100%;
  min-height: 140px;
  box-sizing: border-box;
  padding: 18px;
  margin-bottom: 16px;
  border-radius: 3px;
  background: var(--surface);
  border: 2px solid var(--border);
  overflow: hidden;
}
.pc-info { min-width: 0; }
.pc-title { color: var(--accent-text); font-size: 0.85rem; min-height: 1.1em; }
.pc-name { font-size: 1.5rem; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pc-sub { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.pc-rank { font-size: 0.8rem; letter-spacing: 0.06em; margin-top: 6px; font-family: ui-monospace, Consolas, monospace; }

/* 카드 테두리 (상점) */
.profile-card.frame-neon { border-color: #3EF2F2; box-shadow: 0 0 14px rgba(62, 242, 242, 0.45); }
.profile-card.frame-holo {
  border: 2px solid transparent;
  background-image: linear-gradient(var(--surface), var(--surface)), linear-gradient(120deg, #3EF2F2, #8AB4FF, #C39BFF, #3EF2F2);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}
.profile-card.frame-gold { border-color: #E3B341; box-shadow: 0 0 0 1px #E3B341 inset; }

/* 카드 배경 (상점). 테두리와 함께 쓸 수 있게 ::before에 그려요 */
.profile-card[class*="bg-"]::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.profile-card > * { position: relative; z-index: 1; }
.profile-card.bg-grid::before {
  background-image: linear-gradient(rgba(91, 130, 232, 0.18) 1px, transparent 1px), linear-gradient(90deg, rgba(91, 130, 232, 0.18) 1px, transparent 1px);
  background-size: 18px 18px;
}
.profile-card.bg-city::before {
  background:
    linear-gradient(to top, rgba(18, 24, 56, 0.9) 0 18%, transparent 18%),
    linear-gradient(90deg, transparent 0 8%, rgba(26, 34, 73, 0.85) 8% 16%, transparent 16% 22%, rgba(26, 34, 73, 0.85) 22% 27%, transparent 27% 60%, rgba(26, 34, 73, 0.85) 60% 70%, transparent 70% 80%, rgba(26, 34, 73, 0.85) 80% 88%, transparent 88%) bottom / 100% 55% no-repeat,
    linear-gradient(#141A3A, #1C2350);
  opacity: 0.85;
}
.profile-card.bg-aurora::before {
  background: linear-gradient(115deg, rgba(62, 242, 242, 0.25), rgba(91, 130, 232, 0.25), rgba(195, 155, 255, 0.25), rgba(62, 242, 242, 0.25));
  background-size: 300% 300%;
  animation: aurora 12s ease-in-out infinite alternate;
}
@keyframes aurora { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
.profile-card.bg-city .pc-sub, .profile-card.bg-city .pc-name, .profile-card.bg-city .pc-rank { color: #ECECEC; }

/* ---------- 등급 판정 연출 ---------- */
.gacha {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(5, 8, 20, 0.85);
  padding: 16px;
}
.gacha-box { text-align: center; color: #ECECEC; width: min(360px, 90vw); }
/* 판정 후 [입장] 버튼은 팝업 폭만큼 넓게 */
#enterBtn { display: block; width: 100%; box-sizing: border-box; text-align: center; margin-top: 12px; }
#enterBtn[hidden] { display: none; }
.gacha-letter { font-size: 7rem; font-weight: 900; line-height: 1.1; font-family: ui-monospace, Consolas, monospace; }
.gacha-letter.landed { animation: land 0.6s ease-out; }
@keyframes land { 0% { transform: scale(2.2); opacity: 0; } 60% { transform: scale(0.9); opacity: 1; } 100% { transform: scale(1); } }
.grade-text-E { color: #9CA3AF; }
.grade-text-D { color: #3DD68C; }
.grade-text-C { color: #5B9BFF; }
.grade-text-B { color: #A98BFF; }
.grade-text-A { color: #FFB454; text-shadow: 0 0 20px #FFB454; }
.grade-text-S { color: #FF6B8B; text-shadow: 0 0 30px #FF6B8B, 0 0 60px #FF6B8B; }

/* ---------- BGM 바 ---------- */
body.has-bgm { padding-bottom: 64px; }
.bgm-bar {
  position: fixed;
  right: 16px;
  bottom: 12px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.bgm-video { width: 200px; height: 200px; border-radius: 3px; overflow: hidden; border: 1px solid var(--border); }
.bgm-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.bgm-title { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.bgm-volume { width: 80px; }
/* 맨 위 상태 막대(시간·날씨) 오른편에 붙은 BGM + 이퀄라이저 */
.statusbar { align-items: center; }
.bgm-bar.in-status { position: static; flex-direction: row; align-items: center; margin-left: auto; gap: 0; }
.bgm-bar.in-status .bgm-controls { padding: 0; border: none; background: none; box-shadow: none; gap: 8px; }
.bgm-bar.in-status .bgm-title { font-size: 0.75rem; }
/* 재생/멈춤 · 다음 곡 · 볼륨 아이콘 버튼 */
.bgm-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.bgm-icon:hover, .bgm-icon:focus-visible { color: var(--text); background: var(--surface); }
.bgm-icon svg { width: 16px; height: 16px; fill: currentColor; }
.bgm-icon svg .wave { stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.bgm-bar.playing .bgm-play { color: var(--accent-text); }
.bgm-vol-wrap { position: relative; display: inline-flex; }
.bgm-vol-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 90;
  padding: 8px 10px;
  border-radius: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.bgm-vol-pop[hidden] { display: none; }
.bgm-vol-pop .bgm-volume { width: 110px; margin: 0; }
.bgm-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.bgm-eq i { width: 3px; height: 3px; border-radius: 1px; background: var(--muted); }
.bgm-bar.playing .bgm-eq i { background: var(--accent-text); animation: eq 0.9s ease-in-out infinite; }
.bgm-bar.playing .bgm-eq i:nth-child(2) { animation-delay: -0.3s; animation-duration: 0.7s; }
.bgm-bar.playing .bgm-eq i:nth-child(3) { animation-delay: -0.6s; animation-duration: 1.1s; }
.bgm-bar.playing .bgm-eq i:nth-child(4) { animation-delay: -0.15s; animation-duration: 0.8s; }
.bgm-bar.playing .bgm-eq i:nth-child(5) { animation-delay: -0.45s; animation-duration: 1s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }
html[data-motion="reduce"] .bgm-bar.playing .bgm-eq i { animation: none; height: 8px; }
@media (max-width: 520px) { .bgm-bar.in-status .bgm-title { display: none; } }

/* 장소 설명: 이름 앞 등급 표시 아래 던전 한 줄 */
.station-dungeon { margin: 6px 0 2px; }

/* 임무 진행 창 (떠 있는 창) */
/* 뒤 화면은 흐리게 (누르면 닫혀요) */
.mission-backdrop {
  position: fixed;
  inset: 0;
  z-index: 54;
  background: rgba(5, 8, 20, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.mission-backdrop[hidden], .mission-pop[hidden] { display: none; }
.mission-pop {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 55;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  box-sizing: border-box;
  background: var(--surface);
  border: 1px solid var(--accent-text);
  border-radius: 3px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.mission-pop .mission-head { gap: 8px; }
.mission-pop .log { flex: 1; min-height: 120px; max-height: none; overflow-y: auto; margin: 0; }
.mission-pop .log li { border-bottom: none; padding: 4px 0; } /* 기록 사이 가로선 없이 */
.mission-hp { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 10px 12px; border-radius: 3px; background: var(--bg); border: 1px solid var(--border); }
.mission-hp .bar-label span:first-child { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mission-hp .bar { margin-bottom: 0; }
.mission-reopen { width: 100%; text-align: left; cursor: pointer; font-weight: 700; color: var(--text); }
.shop-buttons.station-actions { justify-content: flex-start; margin-top: 8px; }
@media (max-width: 700px) {
  .mission-pop { width: calc(100vw - 16px); max-height: 82vh; padding: 12px; }
  .mission-backdrop { z-index: 54; }
  .mission-hp { grid-template-columns: 1fr; gap: 8px; }
}

/* 휴대폰: 화면 아래에 떠 있는 내 요원 카드 (mobileDock). 넓은 화면에선 안 보여요 */
.mobile-dock, .dock-open { display: none; }
@media (max-width: 700px) {
  .mobile-dock:not([hidden]) {
    display: block;
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 45;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45));
  }
  .dock-body { cursor: pointer; outline: none; }
  .dock-body .profile-card { width: 100%; min-height: 0; margin: 0; padding: 10px 64px 10px 14px; gap: 12px; }
  .dock-body .avatar.big { width: 56px; height: 56px; font-size: 1.4rem; }
  .dock-body .pc-profile { display: none; }
  .dock-stats {
    min-height: 96px;
    padding: 10px 64px 10px 14px;
    box-sizing: border-box;
    border-radius: 3px;
    background: var(--surface);
    border: 2px solid var(--border);
  }
  .dock-stats .bar { margin-bottom: 4px; }
  .dock-fold {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    margin: 0;
    padding: 6px 10px;
    font-size: 0.75rem;
  }
  .dock-open:not([hidden]) {
    display: block;
    position: fixed;
    right: 8px;
    bottom: 8px;
    z-index: 45;
    margin: 0;
    padding: 8px 14px;
    font-size: 0.8rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  }
  body:has(.mobile-dock:not([hidden])) { padding-bottom: 104px; }
  .toast-box { bottom: 112px; }
  .panel-left .left-status { width: 100%; }
}

/* 설정에서 "애니메이션 줄이기"를 켰을 때 */
html[data-motion="reduce"] .scene *,
html[data-motion="reduce"] .dots::after,
html[data-motion="reduce"] .profile-card::before,
html[data-motion="reduce"] .gacha-letter { animation: none !important; }

/* ---------- 요원 본부: 3분할 화면 ---------- */
.game-layout {
  display: grid;
  /* 왼쪽 칸 = 요원 카드 폭(330px) + 스크롤 막대(6px) → 가운데와의 간격이 오른쪽과 같아요 */
  grid-template-columns: 336px minmax(0, 1fr) 380px; /* 오른쪽 칸은 동료 · 소식 글자가 넉넉히 들어가게 */
  gap: 16px;
  max-width: 1560px;
  margin: 16px auto;
  padding: 0 16px;
  align-items: start;
}
.game-layout main.panel-center { max-width: none; margin: 0; padding: 0; }
.panel-left, .panel-right { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.panel-center .scene { margin-bottom: 12px; }
.panel-left .card, .panel-right .card { padding: 14px; }
details.card summary { margin-top: 0; }
hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
#promoText, #awakenText { white-space: pre-line; }

/* 화면이 좁으면 위아래로: 가운데 → 왼쪽 → 오른쪽 */
@media (max-width: 1100px) {
  .game-layout { grid-template-columns: minmax(0, 1fr); }
  .panel-center { order: 1; }
  .panel-left { order: 2; }
  .panel-right { order: 3; }
  .panel-left, .panel-right { position: static; max-height: none; overflow: visible; }
}

/* ---------- 지하철 노선도 ---------- */
.metro-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.metro { width: 100%; height: auto; display: block; margin: 8px 0; }
.metro-line { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.9; }
.metro-station { cursor: pointer; outline: none; }
.metro-station .dot { fill: var(--surface); stroke: var(--text); stroke-width: 0.8; }
.metro-station .dot-transfer { fill: var(--surface); stroke: var(--text); stroke-width: 1.2; }
.metro-station:hover .dot, .metro-station:hover .dot-transfer,
.metro-station:focus-visible .dot, .metro-station:focus-visible .dot-transfer { fill: var(--accent-text); }
.metro-station.selected .dot, .metro-station.selected .dot-transfer { fill: var(--accent-text); stroke-width: 1.4; }
.metro-label { font-size: 3px; fill: var(--text); paint-order: stroke; stroke: var(--surface); stroke-width: 0.8px; }
.metro-station.selected .metro-label { font-weight: 700; fill: var(--accent-text); }
.metro-pin { font-size: 4px; }
.here-ring { fill: none; stroke: var(--accent-text); stroke-width: 0.8; animation: pulse 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.dest-ring { fill: none; stroke: var(--accent-text); stroke-width: 0.6; stroke-dasharray: 1.2 1; }
.break-ring { fill: rgba(255, 70, 90, 0.25); stroke: #FF4D6A; stroke-width: 0.8; animation: breakBlink 1s steps(2) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(1.25); } }
@keyframes breakBlink { 50% { opacity: 0.25; } }
.metro-legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.line-chip {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 3px;
  font-size: 0.75rem;
  color: #fff;
  background: var(--line);
}
.station-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.station-head strong { font-size: 1.15rem; margin-right: 4px; }
.break-note { color: #FF6B7F; font-size: 0.85rem; font-weight: 700; }
#stationBox button { margin-top: 6px; }
.travel-card { border-color: var(--accent-text); }

/* ---------- 지역 지도 (납작한 그림 지도) ---------- */
.region-tabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; margin: 10px 0 6px; }
.region-tab {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  padding: 6px 8px;
  text-align: left;
  font-size: 0.85rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}
.region-tab.active { border-color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-text) inset; }
.region-break { font-size: 0.7rem; color: #FF6B7F; font-weight: 700; }
.region-map { width: 100%; height: auto; display: block; margin: 6px 0; border-radius: 3px; overflow: hidden; }

/* 지역마다 다른 색 (땅 · 블록 · 공원 · 강 · 도로) */
.region-map { --land: #2A2F3A; --block: #343A48; --block2: #3B4252; --park: #2F4A3C; --water: #3A6EA5; --road: #4A5163; --bridge: #59617A; }
.region-map[data-region="E"] { --land: #2C2F36; --block: #383C45; --block2: #40444E; --park: #34503F; --water: #3E6F9E; --road: #4C515D; }
.region-map[data-region="D"] { --land: #2A2238; --block: #3A2E4F; --block2: #46345E; --park: #2E4A45; --water: #4B4FA8; --road: #5A4A70; }
.region-map[data-region="C"] { --land: #2B2E2E; --block: #3D3A34; --block2: #4A4238; --park: #364536; --water: #2F6E7A; --road: #57524A; }
.region-map[data-region="B"] { --land: #1E2420; --block: #2A322C; --block2: #323A30; --park: #2B3F2E; --water: #2F5A55; --road: #3E4840; }
.region-map[data-region="A"] { --land: #26364A; --block: #31465F; --block2: #3B5470; --park: #2E5A54; --water: #4A8CC7; --road: #4E6A88; }
.region-map[data-region="S"] { --land: #1E1528; --block: #2C1E3B; --block2: #37244A; --park: #3A2246; --water: #5B2A6E; --road: #4A3460; }
.map-land { fill: var(--land); }
.map-block { fill: var(--block); }
.map-block.alt { fill: var(--block2); }
.map-park { fill: var(--park); }
.map-river { fill: none; stroke: var(--water); stroke-width: 7; stroke-linecap: round; }
.map-road { fill: none; stroke: var(--road); stroke-width: 1.4; }
.map-bridge { fill: var(--bridge, #59617A); }
.map-island { fill: var(--park); stroke: var(--road); stroke-width: 0.6; }
.map-crack { fill: none; stroke: #FF4FA3; stroke-width: 0.6; opacity: 0.7; }

/* 장소 표시: 모두 회색 점 (아주 가는 흰 테두리), 내 위치만 하얀 점 + 푸른 동심원 */
.map-spot { cursor: pointer; outline: none; }
.map-pin { fill: #8A8F9C; stroke: rgba(255, 255, 255, 0.7); stroke-width: 0.2; }
.map-pin.me { fill: #FFFFFF; stroke: #6FB8FF; stroke-width: 0.3; }
/* 버튼 안의 장소 아이콘 (선 그림) */
.map-icon { fill: none; stroke: #1E222C; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.map-spot.me-spot .map-icon { stroke: #1F5FA8; }
.place-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.map-spot:hover .map-pin, .map-spot:focus-visible .map-pin { fill: #B5BAC6; }
.map-spot.selected .map-pin:not(.me) { fill: #D6DAE3; }
/* 푸른 동심원: 바깥으로 퍼지면서 흐려져요 */
.radar-ring {
  fill: none;
  stroke: #4FA8FF;
  stroke-width: 0.45;
  transform-box: fill-box;
  transform-origin: center;
  animation: radar 2.4s ease-out infinite;
}
@keyframes radar {
  0%   { transform: scale(0.8); opacity: 0.9; }
  100% { transform: scale(3.4); opacity: 0; }
}
html[data-motion="reduce"] .radar-ring { animation: none; transform: scale(1.8); opacity: 0.6; }
/* 이름: 체력·경험치 글자만큼 작고 가늘게 */
.map-label { font-size: 1.75px; fill: #D6DAE3; paint-order: stroke; stroke: rgba(0, 0, 0, 0.6); stroke-width: 0.35px; pointer-events: none; }
.map-label.me { fill: #FFFFFF; }
.map-spot.selected .map-label { fill: #FFFFFF; font-weight: 700; }
.map-break-tag { font-size: 1.5px; font-weight: 700; fill: #FF4D6A; letter-spacing: 0.08px; paint-order: stroke; stroke: rgba(0, 0, 0, 0.7); stroke-width: 0.3px; animation: breakBlink 1s steps(2) infinite; }
html[data-motion="reduce"] .map-break-tag { animation: none; }
.region-map .break-ring { stroke-width: 0.4; }
.region-map .dest-ring { stroke: #4FA8FF; stroke-width: 0.35; }
.region-tab.locked { opacity: 0.45; }
.here-chip { font-size: 0.75rem; padding: 1px 8px; border-radius: 3px; background: rgba(79, 168, 255, 0.18); color: #6FB8FF; border: 1px solid #4FA8FF; }

/* ---------- 오른쪽: 던전 브레이크 전광판 ---------- */
.board {
  background: #07080D;
  border: 2px solid #2A1218;
  border-radius: 3px;
  padding: 12px;
  margin-bottom: 16px;
  font-family: inherit; /* 사이트 전체와 같은 글씨체 */
  font-size: 0.85rem;   /* 체력·경험치 글자와 같은 크기 */
  color: #FF5470;
  box-shadow: inset 0 0 18px rgba(255, 40, 70, 0.15);
}
.board-title { font-weight: 800; letter-spacing: 0.15em; text-shadow: 0 0 8px #FF2D55; animation: breakBlink 1.6s steps(2) infinite; }
.ticker { overflow: hidden; white-space: nowrap; margin: 8px 0; border-top: 1px dashed #3A1A22; border-bottom: 1px dashed #3A1A22; padding: 4px 0; }
.ticker-text { display: inline-block; padding-left: 100%; animation: ticker 22s linear infinite; color: #FFB347; text-shadow: 0 0 6px rgba(255, 179, 71, 0.7); }
@keyframes ticker { to { transform: translateX(-100%); } }
.board-list { list-style: none; padding: 0; margin: 0; }
.board-list li { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 5px 0; cursor: pointer; border-bottom: 1px solid #1A0C10; }
.board-list li:hover { color: #FF8FA3; }
.board-grade { display: inline-grid; place-items: center; height: 18px; border-radius: 3px; background: #FF2D55; color: #07080D; font-weight: 800; font-size: 0.75rem; }
.board-time { color: #8A5560; font-size: 0.75rem; }
.board-empty { color: #5A3A40; justify-content: center; cursor: default !important; display: block !important; text-align: center; }
.board-note { color: #8A5560; font-size: 0.75rem; margin: 8px 0 0; }

/* 요원 소식 */
.news-list { list-style: none; padding: 0; margin: 8px 0 0; max-height: 260px; overflow-y: auto; }
.news-list li { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.news-list time, .chat-list time { color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; font-size: 0.75rem; }

/* 채팅 */
.chat-list { list-style: none; padding: 0; margin: 4px 0 8px; height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 3px; padding: 6px 8px; background: var(--bg); }
.chat-list li { padding: 4px 0; font-size: 0.88rem; word-break: break-word; }
.chat-list li b { color: var(--accent-text); margin-right: 6px; }
.chat-list li.mine b { color: #3DD68C; }
.chat-list li time { margin-left: 6px; }
.chat-form { display: flex; gap: 6px; }
.chat-form input { margin: 0; flex: 1; min-width: 0; }
/* 버튼 글자가 두 줄로 밀리지 않게 */
.chat-form button { flex-shrink: 0; white-space: nowrap; margin: 0; padding-left: 14px; padding-right: 14px; }
button, .button { word-break: keep-all; }

html[data-motion="reduce"] .here-ring,
html[data-motion="reduce"] .break-ring,
html[data-motion="reduce"] .board-title,
html[data-motion="reduce"] .ticker-text { animation: none !important; }
html[data-motion="reduce"] .ticker-text { padding-left: 0; white-space: normal; }

/* ---------- 폭주 · 가이딩 게이지 ---------- */
.bar.berserk > div { background: linear-gradient(90deg, #FFB347, #FF4D6A); }
.bar.guide > div   { background: linear-gradient(90deg, #5B9BFF, #3EF2F2); }
.bar.danger { box-shadow: 0 0 0 1px #FF4D6A, 0 0 10px rgba(255, 77, 106, 0.5); animation: breakBlink 1.2s steps(2) infinite; }
html[data-motion="reduce"] .bar.danger { animation: none; }
#goHomeBtn { width: 100%; }

/* ---------- 요원 목록 줄 (명부 · 같은 지역 · 신청) ---------- */
.agent-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px;
  border-radius: 3px;
  cursor: pointer;
}
.agent-row:hover { background: var(--bg); }
.agent-row .avatar { width: 38px; height: 38px; font-size: 1rem; }
.agent-row.big .avatar { width: 64px; height: 64px; font-size: 1.6rem; }
.agent-row.small-row { padding: 5px; }
.agent-row.small-row .avatar { width: 30px; height: 30px; font-size: 0.85rem; }
.agent-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.agent-name { display: flex; align-items: center; gap: 6px; }
.grade.mini { width: 20px; height: 20px; font-size: 0.7rem; border-radius: 3px; }
.agent-list, .nearby-list { margin-top: 6px; max-height: 360px; overflow-y: auto; }
.nearby-list { max-height: 220px; }
.rel-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.75rem;
  border: 1px solid var(--rel);
  color: var(--rel);
}
.clickable-name { cursor: pointer; text-decoration: underline dotted; }

/* ---------- 관계도 ---------- */
.relation-map { width: 100%; height: auto; display: block; margin: 8px 0; }
/* 관계도의 동그라미: 캐릭터 이미지 + 아래에 작은 이름 */
.rel-node { cursor: pointer; }
.rel-node text { pointer-events: none; }
.rel-face { fill: var(--surface); }
.rel-ring { fill: none; stroke: var(--border); stroke-width: 2; }
.rel-node:hover .rel-ring, .rel-node:focus-visible .rel-ring { stroke-width: 3; }
.rel-node.me .rel-face { fill: var(--accent); }
.rel-node.me .rel-ring { stroke: var(--accent-text); stroke-width: 2.5; }
.rel-initial { fill: var(--text); font-weight: 700; }
.rel-node.me .rel-initial { fill: var(--on-accent); }
.rel-name { font-size: 8px; fill: var(--muted); paint-order: stroke; stroke: var(--surface); stroke-width: 2.5px; }
.rel-node.me .rel-name { fill: var(--text); font-weight: 700; }
.rel-label { font-size: 9px; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.rel-empty { font-size: 11px; fill: var(--muted); }

/* ---------- 요원 정보 창 ---------- */
.agent-dialog {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  color: var(--text);
  padding: 18px;
}
.agent-dialog::backdrop { background: rgba(5, 8, 20, 0.6); }
.dialog-section { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 14px; }
.dialog-section > strong { display: block; margin-bottom: 8px; }
.dialog-section select, .dialog-section input { margin: 6px 0; }
.dialog-section button { margin: 2px 4px 2px 0; }
.dialog-close { margin-top: 14px; width: 100%; }
/* 상점: 내 카드에 입어보기 */
.try-on { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 16px; align-items: center; margin: 10px 0 14px; padding: 12px; border: 1px dashed var(--border); border-radius: 3px; }
@media (max-width: 640px) { .try-on { grid-template-columns: 1fr; } }
.try-on-side p { margin: 4px 0 8px; }
.cosmetic-tile .shop-buttons { justify-content: center; }
/* 왼쪽 칸: 체력·게이지 상자도 요원 카드와 같은 폭으로 */
.panel-left .left-status { width: 330px; max-width: 100%; box-sizing: border-box; }

/* ---------- 위쪽 오른편 아이콘 (알림 · 우편 · 설정) ---------- */
.top-icons { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border-radius: 3px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
}
.icon-btn:hover, .icon-btn.open { color: var(--text); border-color: var(--border); background: var(--bg); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-badge {
  position: absolute;
  top: 2px;
  right: 1px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  box-sizing: border-box;
  border-radius: 3px;
  background: #FF4D6A;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
/* 알림함 · 우편함 펼침 상자 */
.top-panel {
  position: fixed;
  top: 92px;
  right: 16px;
  z-index: 70;
  width: min(380px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 120px));
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  padding: 12px 14px;
}
.top-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.top-panel-head button { margin: 0; }
.noti-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 8px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 0.88rem; }
.noti-item.unread .noti-text { font-weight: 700; }
.noti-tag { font-size: 0.72rem; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--border); color: var(--muted); align-self: start; white-space: nowrap; }
.noti-tag.k-admin, .noti-tag.k-mail { color: #FFD36B; border-color: #FFD36B; }
.noti-tag.k-gift, .noti-tag.k-relation, .noti-tag.k-home { color: #FF8FC7; border-color: #FF8FC7; }
.noti-tag.k-mission, .noti-tag.k-growth, .noti-tag.k-train { color: var(--accent-text); border-color: var(--accent-text); }
.noti-tag.k-recover { color: #3DD68C; border-color: #3DD68C; }
.noti-time { grid-column: 2; font-size: 0.75rem; color: var(--muted); }
.mail-item { border-top: 1px solid var(--border); padding: 8px 0; }
.mail-head { display: flex; justify-content: space-between; gap: 8px; cursor: pointer; }
.mail-item.unread .mail-title { font-weight: 800; }
.mail-body { white-space: pre-line; font-size: 0.88rem; margin: 6px 0; }
.mail-attach { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.85rem; }
.mail-attach button { margin: 0; }
/* 메인 메뉴 바로 위: 최근 알림 한 줄 */
.notice-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0 0 10px;
  padding: 8px 12px;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
}
.notice-strip .noti-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-strip .noti-time { font-size: 0.75rem; }
.notice-strip.fresh { border-color: var(--accent-text); animation: stripIn 0.6s ease-out; }
@keyframes stripIn { from { box-shadow: 0 0 0 2px var(--accent-text); } to { box-shadow: none; } }
html[data-motion="reduce"] .notice-strip.fresh { animation: none; }

/* 스크롤 막대: 화면 안의 모든 스크롤(요원 소식·채팅·임무 기록·알림함·창 등)을 가늘고 테마 색으로 (화살표 없음) */
/*  크롬·엣지는 아래 ::-webkit-scrollbar 모양을 쓰고, 파이어폭스만 thin 막대를 써요 */
@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--accent-text) 55%, transparent) transparent;
  }
}
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track, *::-webkit-scrollbar-corner { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent-text) 55%, transparent);
  border-radius: 3px;
}
*::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--accent-text) 80%, transparent); }
*::-webkit-scrollbar-button { display: none; }

/* 관계도: 상대 얼굴에 마우스를 올리면 뜨는 말풍선 */
.rel-tip {
  position: fixed;
  z-index: 80;
  transform: translate(-50%, -100%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  font-size: 0.8rem;
  white-space: nowrap;
  pointer-events: none;
}
.rel-tip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 10px;
  height: 10px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transform: translateX(-50%) rotate(45deg);
}
.rel-tip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.rel-node { cursor: pointer; }

/* 임무 기록: 내가 입은 피해는 빨강, 몬스터에게 준 피해는 내 테마 색 (정하지 않았으면 포인트 색) */
.dmg-taken { color: #FF4D6A; font-weight: 700; }
.dmg-dealt { color: var(--accent-text); font-weight: 800; }
.shield-text { color: #5CD6FF; font-weight: 700; }

/* 파트너 상성 막대 · 버프 칩 · 파티 */
.bar.compat > div { background: linear-gradient(90deg, #FF8FC7, #C39BFF); }
.partner-line { margin: 8px 0 4px; }
.partner-line .clickable-name { cursor: pointer; }
.buff-list { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.buff-chip { font-size: 0.72rem; padding: 2px 8px; border-radius: 3px; border: 1px solid #3DD68C; color: #3DD68C; white-space: nowrap; }
.compat-meter { margin: 4px 0 6px; }
.party-status.warn { color: #FF8F6A; }
.mp-party { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px 12px; padding: 8px 12px; border-radius: 3px; border: 1px dashed var(--border); }
.mp-party .bar { margin-bottom: 0; height: 6px; }
.mp-party .bar-label { font-size: 0.78rem; }
.mp-mate.out { opacity: 0.5; }

/* 메신저 (왼쪽 아래) */
.messenger { width: 330px; max-width: 100%; box-sizing: border-box; margin-top: 12px; }
@media (max-width: 700px) { .messenger { width: 100%; } }
.dm-badge { margin-left: 4px; }
.dm-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 4px; margin: 0; border: none; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.dm-row:hover { background: var(--bg); }
.dm-row .avatar { width: 32px; height: 32px; font-size: 0.9rem; flex-shrink: 0; }
.dm-row-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dm-row-top { display: flex; justify-content: space-between; gap: 6px; }
.dm-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-row.unread .dm-preview { color: var(--text); font-weight: 700; }
.dm-peer { font-weight: 700; margin: 4px 0 6px; }
.dm-thread { list-style: none; margin: 0 0 8px; padding: 0; max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.dm-thread li { display: flex; flex-direction: column; align-items: flex-start; max-width: 85%; }
.dm-thread li.mine { align-self: flex-end; align-items: flex-end; }
.dm-bubble { padding: 6px 10px; border-radius: 3px; background: var(--bg); border: 1px solid var(--border); font-size: 0.88rem; word-break: break-word; white-space: pre-wrap; }
.dm-thread li.mine .dm-bubble { background: var(--accent); border-color: var(--accent); color: #fff; }
.dm-thread time { font-size: 0.7rem; color: var(--muted); margin-top: 2px; }
.dm-thread::-webkit-scrollbar { width: 6px; }
.dm-thread::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--accent-text) 55%, transparent); border-radius: 3px; }
/* 채팅 탭이 5개라 좁은 칸에서도 한 줄 또는 두 줄로 깔끔하게 */
.chat-card .tabs { flex-wrap: wrap; gap: 4px; }
.chat-card .tabs button { flex: 1 1 auto; padding: 6px 8px; font-size: 0.82rem; white-space: nowrap; }

/* 장비 · 강화 */
.gear-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 8px; }
.gear-card { padding: 12px; border: 1px solid var(--border); border-radius: 3px; background: var(--bg); display: flex; flex-direction: column; gap: 4px; }
.gear-card p { margin: 0; }
.gear-card button { align-self: flex-start; margin-top: 6px; }
.gear-head { display: flex; flex-direction: column; }
.relic-row.equipped { border-color: var(--accent-text); }
.relic-rare { color: #FFD36B; }
/* 장기 임무 · 원정 메뉴 */
.long-missions { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); display: grid; gap: 12px; }
.long-row p { margin: 2px 0 6px; }
.shop-buttons.long-buttons { justify-content: flex-start; }
.long-progress { width: 100%; }
.long-progress p { margin: 6px 0 0; }

/* 상점: 이름 옆 가격 */
.shop-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.shop-price { display: inline-flex; align-items: center; font-size: 0.85rem; font-weight: 700; color: #F5C542; }
html[data-theme="light"] .shop-price { color: #B8860B; }

/* 관제실: 요원 관리 */
.admin-section { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 12px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 12px; margin: 8px 0; }
.admin-grid label { font-size: 0.85rem; color: var(--muted); }
.admin-grid input, .admin-grid select { margin-top: 2px; width: 100%; box-sizing: border-box; }
button.danger { color: #FF5470; border-color: #FF5470; }
/* 길드 · 창고 */
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.inline-form input { flex: 1; min-width: 120px; margin: 0; }
.inline-form button { margin: 0; }
.guild-notice { padding: 8px 12px; border-left: 3px solid var(--accent-text); background: var(--bg); border-radius: 3px; margin: 8px 0; white-space: pre-line; }
.role-chip { font-size: 0.75rem; padding: 1px 8px; border-radius: 3px; border: 1px solid var(--border); color: var(--muted); align-self: center; }
.role-chip.role-master { color: #FFD36B; border-color: #FFD36B; }
.role-chip.role-officer { color: var(--accent-text); border-color: var(--accent-text); }
.storage { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
@media (max-width: 640px) { .storage { grid-template-columns: 1fr; } }
.storage-col { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: 3px; background: var(--bg); }
.storage-row { display: grid; grid-template-columns: minmax(0, 1fr) 56px auto; gap: 6px; align-items: center; }
.storage-row input { margin: 0; padding: 4px 6px; }
.storage-row button { margin: 0; }
/* 선물하기 · 확인 창 */
.shop-buttons { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.shop-buttons button { margin: 0; }
.gift-to { font-weight: 700; margin: 4px 0; }
#giftBody input[type="search"] { width: 100%; box-sizing: border-box; }
.gift-results { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.gift-qty { display: flex; align-items: center; gap: 8px; }
.gift-qty input { width: 80px; }
.gift-send { width: 100%; margin-top: 12px; }
.confirm-dialog { max-width: 480px; }
.confirm-dialog p { white-space: pre-line; margin: 0 0 14px; line-height: 1.5; }
.confirm-buttons { display: flex; gap: 8px; justify-content: flex-end; }
.confirm-buttons button { margin: 0; }

/* ---------- 거처 ---------- */
.home-card { border-color: #9B7BFF; }
.home-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.home-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.home-act {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

/* ---------- 성장 · 요원 카드 탭 ---------- */
.grow-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 16px; }
#myCard .profile-card { cursor: pointer; }
#cardPreview .profile-card { margin: 10px 0; }
.card-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.sticker-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 8px; align-items: center; margin: 6px 0; }
.sticker-row select { margin: 0; }
.sticker-size-row { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin: 0; }
.sticker-size-row input { flex: 1; margin: 0; padding: 0; }
.sticker-thumb { width: 48px; height: 48px; object-fit: contain; border: 1px solid var(--border); border-radius: 3px; background: var(--bg); }

/* 카드에 붙인 스티커 이미지 (네 모서리) */
.card-sticker {
  position: absolute;
  z-index: 2;
  width: 38px;
  height: 38px;
  object-fit: contain;
  transform: rotate(-12deg);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
  pointer-events: none;
}
/* 요원 카드 탭의 미리보기 카드에서는 스티커를 끌 수 있어요 */
.sticker-editable .card-sticker { pointer-events: auto; cursor: grab; touch-action: none; user-select: none; }
.sticker-editable .card-sticker:hover { filter: drop-shadow(0 0 4px #4FA8FF) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5)); }
.sticker-editable .card-sticker.dragging { cursor: grabbing; filter: drop-shadow(0 0 6px #4FA8FF); }
/* 미리보기 카드의 스티커 떼기 [×] 버튼 */
.sticker-x {
  position: absolute;
  z-index: 3;
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: #FF4D6A;
  color: #fff;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.sticker-x:hover { background: #ff2a4d; }
.card-sticker.slot-tr { top: 6px; right: 8px; }
.card-sticker.slot-br { bottom: 6px; right: 8px; transform: rotate(10deg); }
.card-sticker.slot-tl { top: 6px; left: 8px; }
.card-sticker.slot-bl { bottom: 6px; left: 8px; transform: rotate(8deg); }

/* 상점: 꾸미기 미리보기 타일 */
.shop-filter { margin: 10px 0; }
.cosmetic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.cosmetic-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
}
.cosmetic-tile.owned { opacity: 0.75; }
.cosmetic-tile button { margin-top: auto; }
.mini-card {
  position: relative;
  height: 64px;
  border-radius: 3px;
  border: 2px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  display: grid;
  place-items: center;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--muted);
}
.mini-card > span { position: relative; z-index: 1; }
.mini-sticker { height: 64px; display: grid; place-items: center; font-size: 2rem; filter: drop-shadow(0 0 6px rgba(62, 242, 242, 0.8)); }
.mini-title { height: 64px; display: grid; place-items: center; color: var(--accent-text); font-size: 0.9rem; text-align: center; }

/* ---------- 네온 테두리 (요원 카드 · 미리보기 공통) ---------- */
.profile-card.frame-neon, .mini-card.frame-neon { border-color: #3EF2F2; box-shadow: 0 0 14px rgba(62, 242, 242, 0.45); }
.profile-card.frame-pink, .mini-card.frame-pink { border-color: #FF4FA3; box-shadow: 0 0 14px rgba(255, 79, 163, 0.5), inset 0 0 8px rgba(255, 79, 163, 0.25); }
.profile-card.frame-pulse, .mini-card.frame-pulse { border-color: #2CD5E6; animation: framePulse 1.4s ease-in-out infinite; }
@keyframes framePulse { 0%, 100% { box-shadow: 0 0 4px rgba(44, 213, 230, 0.3); } 50% { box-shadow: 0 0 18px rgba(44, 213, 230, 0.9); } }
.profile-card.frame-circuit, .mini-card.frame-circuit {
  border: 2px solid transparent;
  background-image: linear-gradient(var(--surface), var(--surface)),
    repeating-linear-gradient(90deg, #3E7BFA 0 10px, transparent 10px 14px, #2CD5E6 14px 18px, transparent 18px 26px);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}
.profile-card.frame-glitch, .mini-card.frame-glitch {
  border-color: #9B7BFF;
  box-shadow: 2px 0 0 #FF4FA3, -2px 0 0 #3EF2F2;
  animation: glitch 3s steps(1) infinite;
}
@keyframes glitch {
  0%, 92%, 100% { box-shadow: 2px 0 0 #FF4FA3, -2px 0 0 #3EF2F2; transform: none; }
  94% { box-shadow: -3px 0 0 #FF4FA3, 3px 0 0 #3EF2F2; transform: translateX(1px); }
  96% { box-shadow: 4px 1px 0 #FF4FA3, -4px -1px 0 #3EF2F2; transform: translateX(-1px); }
}
.mini-card.frame-holo {
  border: 2px solid transparent;
  background-image: linear-gradient(var(--surface), var(--surface)), linear-gradient(120deg, #3EF2F2, #8AB4FF, #C39BFF, #3EF2F2);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}
.mini-card.frame-gold { border-color: #E3B341; box-shadow: 0 0 0 1px #E3B341 inset; }

/* ---------- 네온 배경 (요원 카드 · 미리보기 공통, ::before에 그려요) ---------- */
.mini-card[class*="bg-"]::before { content: ""; position: absolute; inset: 0; pointer-events: none; }
.mini-card.bg-grid::before, .profile-card.bg-grid::before {
  background-image: linear-gradient(rgba(91, 130, 232, 0.18) 1px, transparent 1px), linear-gradient(90deg, rgba(91, 130, 232, 0.18) 1px, transparent 1px);
  background-size: 18px 18px;
}
.mini-card.bg-city::before { background: linear-gradient(#141A3A, #1C2350); }
.mini-card.bg-aurora::before { background: linear-gradient(115deg, rgba(62, 242, 242, 0.3), rgba(91, 130, 232, 0.3), rgba(195, 155, 255, 0.3)); }
.profile-card.bg-neonrain::before, .mini-card.bg-neonrain::before {
  background:
    repeating-linear-gradient(105deg, transparent 0 14px, rgba(62, 242, 242, 0.35) 14px 15px, transparent 15px 30px),
    linear-gradient(#0E1330, #1A1440);
  background-size: 100% 200%, 100% 100%;
  animation: rain 1.6s linear infinite;
}
@keyframes rain { from { background-position: 0 0, 0 0; } to { background-position: -20px 100%, 0 0; } }
.profile-card.bg-synth::before, .mini-card.bg-synth::before {
  background:
    radial-gradient(circle at 50% 70%, #FF8A3D 0 14%, transparent 15%),
    linear-gradient(to top, transparent 0 30%, transparent 30%),
    repeating-linear-gradient(to top, rgba(255, 79, 163, 0.5) 0 1px, transparent 1px 10px) bottom / 100% 32% no-repeat,
    linear-gradient(#2A1050, #7A2A80 70%, #1A0A30 70%);
}
.profile-card.bg-datastream::before, .mini-card.bg-datastream::before {
  background:
    repeating-linear-gradient(90deg, rgba(61, 214, 140, 0.35) 0 2px, transparent 2px 22px),
    linear-gradient(#06120D, #0B1F18);
  background-size: 22px 100%, 100% 100%;
  animation: stream 4s linear infinite;
}
@keyframes stream { from { background-position: 0 0, 0 0; } to { background-position: 0 120px, 0 0; } }
.profile-card.bg-alley::before, .mini-card.bg-alley::before {
  background:
    radial-gradient(circle at 15% 30%, rgba(255, 79, 163, 0.45), transparent 30%),
    radial-gradient(circle at 85% 60%, rgba(62, 242, 242, 0.4), transparent 32%),
    linear-gradient(#0B0D18, #161A2C);
}
/* 어두운 배경 위 글자는 밝게 */
.profile-card[class*="bg-neonrain"] .pc-name, .profile-card[class*="bg-synth"] .pc-name,
.profile-card[class*="bg-datastream"] .pc-name, .profile-card[class*="bg-alley"] .pc-name,
.profile-card[class*="bg-neonrain"] .pc-sub, .profile-card[class*="bg-synth"] .pc-sub,
.profile-card[class*="bg-datastream"] .pc-sub, .profile-card[class*="bg-alley"] .pc-sub,
.profile-card[class*="bg-neonrain"] .pc-rank, .profile-card[class*="bg-synth"] .pc-rank,
.profile-card[class*="bg-datastream"] .pc-rank, .profile-card[class*="bg-alley"] .pc-rank { color: #ECECEC; }
.mini-card[class*="bg-"] > span { color: #ECECEC; }
html[data-motion="reduce"] .profile-card::before, html[data-motion="reduce"] .mini-card::before,
html[data-motion="reduce"] .profile-card, html[data-motion="reduce"] .mini-card { animation: none !important; }

/* ---------- 칭호 (이름 앞) · 프로필 · 칭호 도감 ---------- */
.pc-name .pc-title, .agent-name .pc-title {
  font-size: 0.8em;
  font-weight: 700;
  color: var(--accent-text);
  text-shadow: 0 0 8px var(--accent);
  min-height: 0;
}
.pc-profile { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

/* 요원 카드: 칭호 · 이름 · 등급은 레벨·프로필 글자(0.9rem)보다 2pt만 크게 */
.profile-card .pc-name { font-size: calc(0.9rem + 2pt); gap: 6px; }
.profile-card .pc-name .pc-title { font-size: 1em; }
.profile-card .pc-name .grade { width: 1.45em; height: 1.45em; font-size: 1em; border-radius: 3px; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 12px; margin: 8px 0; }
.profile-grid select, .profile-grid input { margin: 6px 0 4px; }
/* 칭호 도감: 좁은 카드를 여러 줄로 (데스크톱 190~220px · 휴대폰 1~2열) */
.title-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 220px)); gap: 8px; margin-top: 8px; justify-content: start; }
.title-tile { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 10px 11px; border: 1px solid var(--border); border-radius: 4px; opacity: 0.62; cursor: pointer; }
.title-tile.owned { opacity: 1; border-color: color-mix(in srgb, var(--accent-text) 55%, var(--border)); }
.title-tile.secret { border-style: dashed; }
.title-tile.on-display, .title-tile.on-equip { border-color: var(--accent-text); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.title-tile:focus-visible { outline: 1px solid var(--accent-text); outline-offset: 1px; }
.title-name { font-size: 0.92rem; line-height: 1.3; overflow-wrap: anywhere; }
.title-fx { font-size: 0.75rem; color: var(--accent-text); line-height: 1.35; }
.title-cond { font-size: 0.75rem; color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.title-btns { display: flex; gap: 5px; margin-top: auto; padding-top: 4px; flex-wrap: wrap; }
.title-btn { min-height: 28px; height: 28px; padding: 0 9px; margin: 0; font-size: 0.78rem; border-radius: 3px; background: transparent; border: 1px solid var(--border); color: var(--text); position: relative; }
.title-btn::after { content: ""; position: absolute; inset: -8px -3px; } /* 보이는 크기는 작게, 누르는 영역은 넉넉하게 */
.title-btn:hover:not([disabled]) { border-color: var(--accent-text); }
.title-btn.on { border-color: var(--accent-text); color: var(--accent-text); background: color-mix(in srgb, var(--accent) 22%, transparent); }
.title-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.title-now { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 8px 11px; margin: 8px 0 4px; border: 1px solid var(--border); border-radius: 4px; font-size: 0.85rem; }
.title-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.title-filter select, .title-filter input { width: auto; flex: 0 1 auto; min-width: 0; margin: 0; font-size: 0.82rem; }
.title-filter input { flex: 1 1 140px; }
@media (max-width: 480px) { .title-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } .title-tile { padding: 9px 10px; } }
@media (max-width: 340px) { .title-grid { grid-template-columns: 1fr; } }
/* 요원 간 대련 */
.duel-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }
.duel-fighter { margin: 6px 0; }
.duel-actions { margin: 8px 0 6px; padding: 0; border: 0; }
.duel-forfeit { margin-top: 2px; }
.duel-log { max-height: 180px; overflow-y: auto; margin-top: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; }
.duel-log p { margin: 2px 0; line-height: 1.45; }
.duel-result { margin: 8px 0; padding: 8px 11px; border: 1px solid var(--accent-text); border-radius: 4px; }
.duel-result p { margin: 4px 0 0; }
.duel-history { margin-top: 8px; }
.duel-history p { margin: 2px 0; }

/* ---------- 캐릭터 테마 색 고르기 (HSV) ---------- */
.color-picker { display: grid; grid-template-columns: 100px minmax(0, 280px) 24px; justify-content: start; gap: 14px; margin: 10px 0 12px; align-items: start; }
@media (max-width: 520px) { .color-picker { grid-template-columns: minmax(0, 1fr) 24px; } .cp-side { grid-column: 1 / -1; } }
.cp-side { display: flex; flex-direction: column; gap: 8px; }
.cp-swatch { width: 90px; height: 90px; border: 1px solid var(--border); border-radius: 2px; overflow: hidden; display: grid; grid-template-rows: 1fr 1fr; }
.cp-dropper { align-self: flex-start; padding: 4px 6px; margin: 0; line-height: 0; }
.cp-dropper svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cp-hex { font-size: 0.8rem; color: var(--muted); }
.cp-hex input { font-family: ui-monospace, Consolas, monospace; text-transform: uppercase; margin-top: 2px; width: 100%; box-sizing: border-box; }
.cp-name { margin: 0; font-weight: 800; font-size: 1rem; word-break: break-all; }
.cp-sv {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  border: 1px solid var(--border);
  cursor: crosshair;
  touch-action: none;
}
.cp-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.cp-hue {
  position: relative;
  border: 1px solid var(--border);
  align-self: stretch;
  background: linear-gradient(to bottom, #F00 0%, #F0F 16.66%, #00F 33.33%, #0FF 50%, #0F0 66.66%, #FF0 83.33%, #F00 100%);
  cursor: ns-resize;
  touch-action: none;
}
.cp-arrow {
  position: absolute;
  left: -9px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid var(--text);
  transform: translateY(-50%);
  pointer-events: none;
}

/* 탭을 바꿀 때 위쪽 그림이 살짝 밝아지며 바뀌어요 */
#cityScene.scene-swap svg { animation: sceneIn 0.45s ease-out; }
@keyframes sceneIn { from { opacity: 0.2; } to { opacity: 1; } }
html[data-motion="reduce"] #cityScene.scene-swap svg { animation: none; }

/* ---------- 화면 아래 알림 팝업 ---------- */
.toast-box {
  position: fixed;
  left: 50%;
  bottom: 72px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(440px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  cursor: pointer;
  padding: 12px 16px;
  border-radius: 3px;
  border: 1px solid var(--accent-text);
  background: var(--surface, var(--bg));
  color: var(--text);
  font-size: 0.9rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  animation: toastIn 0.3s ease-out;
  transition: opacity 0.3s, transform 0.3s;
}
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
html[data-motion="reduce"] .toast { animation: none; transition: none; }

/* ---------- 요원 탭 안의 작은 탭 ---------- */
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 14px; padding-left: 4px; }
.subtabs button { padding: 6px 12px; font-size: 0.85rem; }

/* ---------- 맨 위 안내판 ---------- */
.brief-card { padding: 12px 16px; margin: 0 0 12px; }
.brief-card p { margin: 0; }
.brief-weather { font-size: 0.9rem; }
.brief-place { font-weight: 700; margin: 4px 0 2px !important; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.brief-place #briefRegion { color: var(--accent-text); }
.brief-sub::before { content: "›"; margin-right: 8px; color: var(--muted); font-weight: 400; }

/* ---------- 성장: 스탯 방사형 그래프 · 가로 배치 ---------- */
.stat-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: center; margin-top: 8px; }
@media (max-width: 640px) { .stat-layout { grid-template-columns: 1fr; } }
.stat-sheet { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.stat-sheet-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 4px; }
.stat-sheet-head { display: block; }
.stat-ability { margin: 2px 0 6px; color: var(--accent-text); }
/* 현재 스탯 한 줄 = 펼치는 상자 (요약: 이름 · 값 · 어디서 오는지 / 펼치면 계산 내역) */
details.stat-sheet-row { padding: 0; border-bottom: 1px dashed var(--border); }
details.stat-sheet-row:last-of-type { border-bottom: 0; }
details.stat-sheet-row > summary { display: grid; grid-template-columns: 110px 110px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 5px 2px; cursor: pointer; list-style: none; }
details.stat-sheet-row > summary::-webkit-details-marker { display: none; }
details.stat-sheet-row > summary:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
details.stat-sheet-row[open] > summary { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.stat-parts { list-style: none; margin: 0 0 4px; padding: 4px 8px 6px 14px; border-left: 2px solid var(--accent-text); }
.stat-parts li { display: flex; justify-content: space-between; gap: 10px; font-size: 0.82rem; padding: 1px 0; }
.stat-parts li span { color: var(--muted); }
.stat-parts li.stat-final { border-top: 1px solid var(--border); margin-top: 3px; padding-top: 3px; }
.stat-parts li.stat-final span { color: var(--text); }
.stat-note { margin: 0 0 6px 14px; }
.stat-cond { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.stat-cond p { margin: 4px 0; line-height: 1.5; }
.stat-when { color: var(--accent-text); }
details.stat-sheet-row > summary > :first-child { word-break: keep-all; }
@media (max-width: 640px) { details.stat-sheet-row > summary { grid-template-columns: max-content 1fr; } details.stat-sheet-row > summary > :last-child { grid-column: 1 / -1; } }
.stat-radar { width: 100%; max-width: 240px; height: auto; display: block; }
.radar-grid { fill: none; stroke: var(--border); stroke-width: 1; }
.radar-axis { stroke: var(--border); stroke-width: 1; }
.radar-shape { fill: var(--accent); fill-opacity: 0.35; stroke: var(--accent-text); stroke-width: 2; stroke-linejoin: round; }
.radar-dot { fill: var(--accent-text); }
.radar-label { font-size: 10px; fill: var(--text); }
.radar-note { font-size: 8px; fill: var(--muted); }
.stat-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.stat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
}
.stat-tile .stat-value { font-size: 1.1rem; }
.stat-tile button { padding: 2px 8px; margin: 2px 0 0; }
.trait-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-top: 8px; }
.trait-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
}
.trait-tile.has { border-color: var(--accent-text); }
.trait-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.trait-lv { font-size: 0.8rem; color: var(--accent-text); font-weight: 700; }
.trait-tile button { align-self: flex-start; padding: 2px 8px; margin-top: 4px; }

/* ---------- 요원 등록 페이지 ---------- */
.create-page main { max-width: 860px; }

/* 게임 점수 크게 */
.score { font-size: 4rem; font-weight: 700; color: var(--accent-text); text-align: center; margin: 16px 0; }

/* ---------- 테마 설정 창 ---------- */
.theme-panel {
  position: fixed;
  top: 60px;
  right: 16px;
  width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  display: none;
  z-index: 10;
}
.theme-panel.open { display: block; }

/* 동그란 색상환: conic-gradient가 원을 빙 둘러 무지개를 그려줘요 */
.wheel {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 12px auto;
  border-radius: 50%;
  background: conic-gradient(
    hsl(0 80% 55%), hsl(60 80% 55%), hsl(120 80% 55%),
    hsl(180 80% 55%), hsl(240 80% 55%), hsl(300 80% 55%), hsl(360 80% 55%)
  );
  cursor: pointer;
  touch-action: none;
}
/* 가운데 구멍 (도넛 모양) */
.wheel::after {
  content: "";
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  background: var(--surface);
}
/* 지금 고른 색을 가리키는 작은 동그라미 */
.wheel-marker {
  position: absolute;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4);
  z-index: 1;
  pointer-events: none;
}
.swatch {
  width: 100%;
  height: 32px;
  border-radius: 3px;
  background: var(--accent);
}

@media (max-width: 500px) {
  .topbar { flex-wrap: wrap; }
}

/* 능력 무기 태그 */
.ability-tag { display: inline-block; padding: 1px 7px; border-radius: 3px; font-size: 11px; font-weight: 700; background: color-mix(in srgb, var(--accent, #7cf) 22%, transparent); color: var(--accent-text, #4A5D94); border: 1px solid color-mix(in srgb, var(--accent, #7cf) 50%, transparent); }

/* 임무 진행 창 맨 아래: 남은 시간 (기록 시각처럼 흐릿하게) */
.mp-left { margin: 8px 2px 0; text-align: right; font-size: 12px; color: var(--muted); opacity: 0.8; font-variant-numeric: tabular-nums; }

/* 이름 아래: 지금 하는 일 (임무 중 · 휴식 중 · 이동 중 · 대기 중) */
.agent-activity { display: inline-flex; align-items: center; gap: 5px; font-size: 0.75rem; color: var(--muted); }
.agent-activity::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.agent-activity.act-mission { color: #ff5c7a; }
.agent-activity.act-rest { color: #5cc8ff; }
.agent-activity.act-move { color: #f0b84a; }
.partner-line .agent-activity { margin: -2px 0 4px; }

/* 유물 효과 (기능) 한 줄 */
.relic-effect { color: var(--accent-text); font-weight: 600; margin-bottom: 2px; }

/* 등급 업 시험 창 */
.exam-dialog { width: min(520px, calc(100vw - 32px)); }
.exam-log { max-height: 46vh; overflow-y: auto; margin: 10px 0; }
.exam-log li { animation: examIn 0.3s ease; }
@keyframes examIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.exam-result { font-weight: 800; font-size: 1.1rem; text-align: center; margin: 8px 0; }
.exam-result.pass { color: var(--accent-text); }
.exam-result.fail { color: #ff5c7a; }
.exam-result .exam-sub { display: block; margin-top: 6px; font-weight: 400; font-size: .85rem; line-height: 1.6; color: var(--muted); white-space: pre-line; }
/* 등급 업 시험 카드: 응시료 · 합격률 표 (서버 값 그대로) */
.awk-route { font-weight: 700; margin: 4px 0 2px; }
.awk-rows { display: grid; gap: 2px; margin: 8px 0 4px; }
.awk-row { display: flex; justify-content: space-between; gap: 8px; }
.awk-row span { color: var(--muted); }
.awk-row.total { border-top: 1px solid var(--border); padding-top: 4px; margin-top: 2px; }
.awk-row.total b { color: var(--accent-text); }
.awk-row.short b { color: #ff5c7a; }
#awakenText { white-space: normal; }

/* 히든 어빌리티 */
.hidden-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 8px; }
.hidden-row { padding: 8px 10px; border-radius: 3px; border: 1px solid var(--border); background: var(--bg); border-left: 3px solid var(--muted); }
.hidden-row.hidden-pos { border-left-color: #5cc8ff; }
.hidden-row.hidden-neu { border-left-color: #f0b84a; }
.hidden-row.hidden-neg { border-left-color: #ff5c7a; }
.hidden-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.hidden-tag { font-size: 0.7rem; font-weight: 700; padding: 1px 6px; border-radius: 3px; border: 1px solid currentColor; }
.hidden-tag-pos { color: #5cc8ff; } .hidden-tag-neu { color: #f0b84a; } .hidden-tag-neg { color: #ff5c7a; }
.hidden-effect { font-weight: 600; color: var(--accent-text); }
.hidden-left { grid-column: 1 / -1; letter-spacing: 0.02em; }
/* 다른 요원 정보 창: 카드 아래 스탯 그래프 */
.agent-radar { display: block; width: 100%; max-width: 260px; margin: -6px auto 8px; }

/* 야시장 */
.market-card { border-color: #f0b84a; background: linear-gradient(135deg, rgba(240, 184, 74, 0.12), transparent 60%), var(--surface); margin-bottom: 12px; }
.market-head strong { color: #f0b84a; letter-spacing: 0.08em; }

/* 채팅 버튼 맨 앞: 새 메시지 표시 */
.chat-new { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #ff5c7a; margin-right: 5px; vertical-align: middle; box-shadow: 0 0 6px #ff5c7a; }
/* AEGIS 무전 (서버가 남긴 말) */
.chat-list li.system b { color: #f0b84a; }
.chat-list li.system span { color: #f0b84a; font-style: italic; }

.market-kind { font-size: 0.7rem; font-weight: 700; color: #f0b84a; border: 1px solid rgba(240, 184, 74, 0.6); border-radius: 3px; padding: 1px 6px; }
.market-sub { font-weight: 700; margin: 10px 0 2px; color: #f0b84a; }
.market-over { color: #ff5c7a; }

/* 능력 재선택권: 능력 고르기 */
.pick-ability { text-align: left; display: block; height: auto; padding: 8px 10px; white-space: normal; }
.pick-ability.current { opacity: 0.55; }

/* 태워서 이동 */
.ride-card { border-color: var(--accent-text); margin-bottom: 12px; }
.ride-choices { display: grid; gap: 8px; margin-top: 10px; }
.ride-choice { width: 100%; padding: 12px; font-size: 0.95rem; }
.ride-seats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; margin: 8px 0; }
.ride-seat { padding: 6px 8px; border-radius: 3px; border: 1px dashed var(--border); font-size: 0.8rem; text-align: center; }
.ride-seat.taken { border-style: solid; border-color: var(--accent-text); color: var(--accent-text); }
.ride-seat-btn.taken { opacity: 0.5; }

/* 장기 임무 · 장기 파견: 출동 버튼처럼 큰 시간 버튼 (기대 보상 요약 포함) */
.long-row p { white-space: pre-line; }
.shop-buttons.long-buttons { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.long-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; text-align: left; height: auto; white-space: normal; }
.long-btn strong { font-size: 1.05rem; }
.long-btn span { opacity: 0.85; }

/* 성장 탭: 스탯 설명 */
.stat-guide { display: grid; gap: 4px; margin: 10px 0 4px; padding: 10px 12px; border-radius: 3px; background: var(--bg); border: 1px solid var(--border); }
.stat-guide-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.stat-guide-row strong { color: var(--accent-text); font-size: 0.85rem; }
.stat-guide-row span { color: var(--muted); }

/* 거처: 요리 */
.cook-filter { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.cook-filter input { width: auto; margin: 0; }
.cook-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 8px; max-height: 520px; overflow-y: auto; }
.cook-row { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 3px; border: 1px solid var(--border); background: var(--bg); }
.cook-row.ready { border-color: var(--accent-text); }
.cook-head { display: flex; flex-direction: column; gap: 2px; }
.cook-effect { color: var(--accent-text); }
.cook-needs { display: flex; flex-wrap: wrap; gap: 4px; }
.cook-need { font-size: 0.72rem; padding: 1px 7px; border-radius: 3px; border: 1px solid var(--border); color: var(--muted); }
.cook-need.ok { border-color: #3DD68C; color: #3DD68C; }
.cook-row button { align-self: flex-end; }

/* 관제실: 본부 채팅 */
.admin-chat { max-height: 320px; overflow-y: auto; margin: 8px 0; }

.sell-all-row { justify-content: flex-end; margin-bottom: 4px; }

/* 상점 오른쪽 위 작은 [판매] */
.shop-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.shop-sell-btn { padding: 3px 12px; font-size: 0.78rem; }
.shop-sell-btn.active { border-color: var(--accent-text); color: var(--accent-text); }

/* 설정 · 관제실 오버레이 (요원 본부 위에 띄워 BGM이 끊기지 않게) */
.page-overlay { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; background: var(--bg); }
.page-overlay[hidden] { display: none; }
.page-overlay-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.page-overlay iframe { flex: 1; width: 100%; border: 0; background: var(--bg); }
body.overlay-open { overflow: hidden; }
/* 유튜브 BGM 미니 플레이어 (재생 중일 때만, 왼쪽 아래 — 오른쪽 채팅을 가리지 않게) */
.yt-mini { position: fixed; left: 12px; bottom: 12px; z-index: 60; width: 200px; border-radius: 3px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
.yt-mini[hidden] { display: none; }
.yt-mini-head { padding: 5px 8px; font-size: 0.7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yt-mini iframe { display: block; width: 200px; height: 200px; }
@media (max-width: 760px) { .yt-mini { bottom: 112px; } }

/* ---------- 지역 지도: 선으로 그린 안내 지도 일러스트 ---------- */
/*  --paper 바깥 바탕 · --base 동네 안 · --ink 선 · --water 강 · --pin 핀 색 */
.region-map { --paper: #DDE3EA; --base: #F4F6F8; --ink: #2E3A4E; --water: #BFD7EE; --pin: #3D4B63; background: var(--paper); border-radius: 3px; }
.region-map[data-region="E"] { --paper: #DCE1E6; --base: #F3F5F7; --ink: #2F3846; --water: #C3D6E8; --pin: #4A5568; }
.region-map[data-region="D"] { --paper: #E3DBEF; --base: #F7F2FC; --ink: #3E2A63; --water: #CFC8F0; --pin: #6A4FA0; }
.region-map[data-region="C"] { --paper: #E9E2D4; --base: #FAF6EE; --ink: #4E3D29; --water: #BFDCE0; --pin: #9C6A2E; }
.region-map[data-region="B"] { --paper: #D7E3DA; --base: #F1F7F2; --ink: #23392B; --water: #B8D6CF; --pin: #2F6B4A; }
.region-map[data-region="A"] { --paper: #D6E3F1; --base: #F2F7FC; --ink: #213A5C; --water: #B4D2F0; --pin: #2D63A8; }
.region-map[data-region="S"] { --paper: #E4D7EA; --base: #F8F1FA; --ink: #3E1F4E; --water: #D9C2E6; --pin: #8A3AA8; }
.map-paper { fill: var(--paper); }
.map-dot { fill: var(--ink); opacity: 0.35; }
.map-hatch-line { stroke: var(--ink); stroke-width: 0.25; opacity: 0.55; }
.map-blob { fill: var(--base); stroke: var(--ink); stroke-width: 0.45; }
.map-blob-shadow { fill: var(--ink); }
.map-park-hatch { stroke: var(--ink); stroke-width: 0.3; }
.map-alley { fill: none; stroke: var(--ink); stroke-width: 0.25; opacity: 0.55; }
.map-street-edge { fill: none; stroke: var(--ink); stroke-linecap: butt; }
.map-street { fill: none; stroke: var(--base); stroke-linecap: butt; }
.map-river-edge { fill: none; stroke: var(--ink); stroke-width: 7.6; }
.map-river { fill: none; stroke: var(--water); stroke-width: 6.8; }
.map-river-wave { fill: none; stroke: var(--ink); stroke-width: 0.25; stroke-dasharray: 1.2 2.2; opacity: 0.6; }
.region-map .map-island { fill: var(--base); stroke: var(--ink); stroke-width: 0.45; }
.map-tree { fill: var(--base); stroke: var(--ink); stroke-width: 0.3; }
.map-tree-trunk { stroke: var(--ink); stroke-width: 0.3; }
.map-street-tag { fill: var(--base); stroke: var(--ink); stroke-width: 0.25; }
.map-street-name { font-size: 1.15px; fill: var(--ink); font-weight: 700; letter-spacing: 0.05px; }
.map-badge { fill: var(--base); stroke: var(--ink); stroke-width: 0.4; }
.map-compass-arrow { fill: var(--ink); }
.map-compass-n { font-size: 1.5px; font-weight: 800; fill: var(--ink); }
.map-title { fill: var(--ink); }
.map-title-shadow { fill: none; stroke: var(--ink); stroke-width: 0.35; }
.map-title-text { font-size: 2.4px; font-weight: 800; fill: var(--base); letter-spacing: 0.15px; }
.region-map .map-crack { stroke: #E0368C; stroke-width: 0.5; opacity: 0.8; }
/* 위치 핀 (물방울 모양) */
.region-map .map-pin { fill: var(--pin); stroke: var(--ink); stroke-width: 0.25; transition: transform 0.15s; }
.region-map .map-pin.me { fill: var(--accent); }
.region-map .map-pin.break { fill: #E8344F; }
.map-pin-face { fill: var(--base); pointer-events: none; }
.region-map .map-icon { stroke: var(--ink); stroke-width: 2.2; }
.region-map .map-spot.me-spot .map-icon { stroke: var(--accent); }
.map-pin-shadow { fill: var(--ink); opacity: 0.25; }
.map-label-box { fill: var(--base); stroke: var(--ink); stroke-width: 0.22; }
.map-label-box.me { fill: var(--accent); stroke: var(--accent); }
.region-map .map-label { font-size: 1.5px; font-weight: 700; fill: var(--ink); stroke: none; }
.region-map .map-label.me { fill: var(--on-accent, #fff); }
.region-map .map-spot:hover .map-pin, .region-map .map-spot:focus-visible .map-pin { fill: var(--ink); }
.region-map .map-spot.selected .map-pin:not(.me):not(.break) { fill: var(--ink); }
.region-map .map-spot.selected .map-label-box:not(.me) { fill: var(--ink); }
.region-map .map-spot.selected .map-label:not(.me) { fill: var(--base); }
.region-map .radar-ring { fill: none; stroke: var(--accent); stroke-width: 0.35; transform-box: fill-box; transform-origin: center; }
.region-map .dest-ring { stroke: var(--accent); stroke-width: 0.35; }
.region-map .map-break-tag { font-size: 1.5px; fill: #E8344F; stroke: var(--base); stroke-width: 0.35px; }

/* ---------- 지역 지도: 어두운 면으로만 그린 도시 지도 (바깥으로 갈수록 흐려져요 · 카드 가로 꽉 차게) ---------- */
.map-card { overflow: hidden; }
.map-card .region-map { width: calc(100% + 40px); margin: 8px -20px; border-radius: 0; background: none; }
.region-map { --land: #161A22; --block: #1E232D; --block2: #222835; --park: #1A2A22; --sea: #101826; --river: #13202F; --road: #2B3240; --alley: #222833; --route: #4F6FA8; --pin: #5A6B8A; --ink: #C9D2E3; --fade: var(--surface); }
.region-map[data-region="E"] { --land: #17191E; --block: #1F2229; --block2: #24282F; --park: #1B2820; --sea: #111A26; --river: #142130; --road: #2D323C; --route: #6A86B8; --pin: #6B7A94; }
.region-map[data-region="D"] { --land: #18141F; --block: #211B2B; --block2: #271F33; --park: #1A2623; --sea: #15132A; --river: #1B1A35; --road: #33294A; --route: #8A6CC8; --pin: #7D62B0; }
.region-map[data-region="C"] { --land: #1A1815; --block: #23201B; --block2: #29251F; --park: #1D251C; --sea: #0F1D22; --river: #132429; --road: #3A342A; --route: #C08A4A; --pin: #A07840; }
.region-map[data-region="B"] { --land: #121714; --block: #19201B; --block2: #1D2620; --park: #182A1E; --sea: #0E1B1A; --river: #11221F; --road: #26332B; --route: #4FA078; --pin: #4A8A68; }
.region-map[data-region="A"] { --land: #131922; --block: #1A222E; --block2: #1E2836; --park: #172A27; --sea: #0E1A2A; --river: #112236; --road: #263449; --route: #4F8CD6; --pin: #4C7CB8; }
.region-map[data-region="S"] { --land: #17111C; --block: #201727; --block2: #261B2E; --park: #24162A; --sea: #170E22; --river: #1F1230; --road: #33223F; --route: #B04FD0; --pin: #9248B0; }
.region-map .map-land { fill: var(--land); }
.map-sea { fill: var(--sea); }
.region-map .map-park { fill: var(--park); }
.region-map .map-block { fill: var(--block); }
.region-map .map-block.alt { fill: var(--block2); }
.region-map .map-river { fill: none; stroke: var(--river); stroke-width: 7; stroke-linecap: round; }
.region-map .map-island { fill: var(--park); stroke: none; }
.map-alley { fill: none; stroke: var(--alley); stroke-width: 0.35; }
.map-avenue { fill: none; stroke: var(--road); stroke-width: 1.5; }
.map-avenue.thin { stroke-width: 1; }
.region-map .map-crack { stroke: #B0307A; stroke-width: 0.5; opacity: 0.6; }
.map-route { fill: none; stroke: var(--route); stroke-width: 0.55; stroke-linecap: round; opacity: 0.55; }
.map-route-min { font-size: 1.15px; font-weight: 700; fill: var(--route); opacity: 0.85; paint-order: stroke; stroke: var(--land); stroke-width: 0.5px; }
.map-route-active { fill: none; stroke: var(--accent-text); stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
.map-route-glow { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0.6; }
.map-fade { pointer-events: none; }
.map-fade-in { stop-color: var(--fade); stop-opacity: 0; }
.map-fade-out { stop-color: var(--fade); stop-opacity: 1; }
.map-region-name { font-size: 2.3px; font-weight: 800; fill: var(--ink); opacity: 0.7; letter-spacing: 0.2px; }
/* 핀 (면으로만) */
.region-map .map-pin { fill: var(--pin); stroke: none; }
.region-map .map-pin.me { fill: var(--accent); }
.region-map .map-pin.break { fill: #E8344F; }
.region-map .map-pin-face { fill: var(--land); }
.region-map .map-icon { stroke: var(--ink); stroke-width: 2.2; }
.region-map .map-spot.me-spot .map-icon { stroke: var(--accent-text); }
.region-map .map-pin-shadow { fill: #000; opacity: 0.45; }
.map-me-glow { fill: var(--accent); opacity: 0.22; animation: meGlow 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes meGlow { 50% { opacity: 0.08; transform: scale(1.25); } }
html[data-motion="reduce"] .map-me-glow { animation: none; }
.region-map .map-label-box { fill: var(--land); stroke: none; opacity: 0.85; }
.region-map .map-label-box.me { fill: var(--accent); opacity: 1; }
.region-map .map-label { fill: var(--ink); }
.region-map .map-spot:hover .map-pin:not(.me):not(.break), .region-map .map-spot:focus-visible .map-pin:not(.me):not(.break) { fill: var(--ink); }
.region-map .map-spot.selected .map-pin:not(.me):not(.break) { fill: var(--accent-text); }
.region-map .map-spot.selected .map-label-box:not(.me) { fill: var(--accent-text); opacity: 1; }
.region-map .map-spot.selected .map-label:not(.me) { fill: var(--land); }

/* 버그 제보 · 건의함 */
.feedback-dialog { width: min(480px, calc(100vw - 32px)); }
.feedback-dialog textarea { width: 100%; box-sizing: border-box; margin: 8px 0; }
.feedback-row { padding: 8px 0; border-top: 1px solid var(--border); }
.feedback-row.done { opacity: 0.5; }
.feedback-head { display: flex; align-items: center; gap: 6px; }
.feedback-head button { margin-left: auto; }
.feedback-tag { font-size: 0.72rem; font-weight: 700; padding: 1px 7px; border-radius: 3px; border: 1px solid currentColor; }
.feedback-tag.bug { color: #ff5c7a; } .feedback-tag.idea { color: #5cc8ff; }
.feedback-text { white-space: pre-wrap; margin: 4px 0 0; }

.region-map .map-label { font-size: 1.95px; font-weight: 700; }
.region-map .map-label-box { opacity: 0.92; }
.map-route-min { font-size: 1.4px; }
.map-region-name { font-size: 2.6px; opacity: 0.85; }

/* 어두운 지도: 글자·아이콘은 밝게 (이전 밝은 지도의 지역별 --ink를 덮어요) */
.region-map[data-region] { --ink: #C9D2E3; }

/* 유튜브 소리 플레이어 줄 (BGM · 도시 소리 · 빗소리): 재생 중인 것만 왼쪽 아래에 나란히 */
/* 유튜브 플레이어는 화면 밖에 둬요 (재생은 그대로, 보이지 않게) */
.yt-dock { position: fixed; left: -10000px; top: 0; z-index: -1; display: flex; gap: 8px; opacity: 0; pointer-events: none; }
.yt-dock .yt-mini { position: static; }

/* 요원 등록: 능력 자세한 설명 · 말 풀이 */
.pick .pick-detail { display: block; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); font-size: 0.78rem; color: var(--muted); line-height: 1.45; }
.term-guide { margin: 10px 0 4px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 3px; background: var(--bg); }
.term-guide summary { cursor: pointer; font-weight: 700; font-size: 0.88rem; }
.term-guide dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 12px; margin: 10px 0 0; }
.term-guide dt { font-weight: 700; color: var(--accent-text); font-size: 0.85rem; }
.term-guide dd { margin: 0; font-size: 0.85rem; color: var(--muted); }
@media (max-width: 520px) { .term-guide dl { grid-template-columns: 1fr; } .term-guide dd { margin-bottom: 4px; } }

/* 요원 등록: 스탯 자세히 */
.stat-detail-box { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 3px; background: var(--bg); }
.stat-detail-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 2px 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.stat-detail-row strong { color: var(--accent-text); grid-row: span 2; font-size: 0.9rem; }
.stat-role-tip { color: var(--muted); }
.stat-notes { margin: 10px 0 0; padding-left: 18px; line-height: 1.6; }

/* 요원 등록: 가이드 공통 능력 */
.guide-common { margin: 4px 0 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 3px; background: var(--surface); }
.guide-common-head { font-size: 0.75rem; color: var(--muted); margin: 4px 0 6px; }
.guide-common-head:not(:first-child) { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.guide-common-row { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; }
.guide-common-row span { font-size: 0.8rem; color: var(--muted); line-height: 1.45; }

/* 파트너 동조율 단계표 */
.sync-ladder { list-style: none; margin: 10px 0 6px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sync-ladder li { display: flex; gap: 8px; align-items: flex-start; font-size: 0.82rem; }
.sync-ladder li div { display: flex; flex-direction: column; gap: 1px; }
.sync-ladder .sync-mark { width: 18px; flex: none; text-align: center; color: #3DD68C; }
.sync-ladder li.locked { opacity: 0.5; }
.sync-ladder li.now strong { color: #3DD68C; }
/* 턴제 전투 칸 (임무 진행 창) */
.battle-box { margin: 8px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 3px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.battle-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.battle-head .battle-clock { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.battle-head .battle-auto { margin-left: auto; font-size: 0.8rem; color: var(--muted); display: flex; align-items: center; gap: 4px; cursor: pointer; }
.battle-notes { margin: 0; font-size: 0.78rem; color: var(--muted); }
.battle-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.battle-actions button { flex: 1 1 auto; min-width: 88px; }
.battle-target { max-width: 220px; }
/* 등급 전리품: 희귀(파랑) · 영웅(보라) · 전설(노랑) */
.rarity-rare, .rarity-rare b { color: #4DA3FF; }
.rarity-hero, .rarity-hero b { color: #B57BFF; }
.rarity-legend, .rarity-legend b { color: #FFD166; }
.log li.rarity-legend { text-shadow: 0 0 8px rgba(255, 209, 102, 0.45); }

/* 거처 장면: 일렁이는 창문 불빛 · 굴뚝 연기 · 반딧불 · 살랑이는 나무 */
.scene .home-window { animation: hearth 3.2s ease-in-out infinite; }
.scene .home-lamp { animation: hearth 2.1s ease-in-out infinite; }
.scene .rest-glow { animation: hearth 5s ease-in-out infinite; } /* 휴식 라운지 간접조명: 천천히 숨 쉬듯 */
.scene .home-halo { animation: halo 4s ease-in-out infinite; }
.scene .home-smoke { opacity: 0; transform-box: fill-box; transform-origin: center; animation: smoke 4.4s ease-out infinite; }
.scene .home-firefly { animation: firefly 6s ease-in-out infinite; }
.scene .home-tree { animation: sway 5s ease-in-out infinite; }
.scene .home-sun { animation: halo 6s ease-in-out infinite; }
@keyframes hearth { 0%, 100% { opacity: 1; } 40% { opacity: 0.82; } 60% { opacity: 0.95; } 80% { opacity: 0.86; } }
@keyframes halo { 0%, 100% { opacity: 0.85; } 50% { opacity: 1; } }
@keyframes smoke { 0% { opacity: 0; transform: translate(0, 0) scale(0.6); } 15% { opacity: 0.55; } 100% { opacity: 0; transform: translate(26px, -70px) scale(2.2); } }
@keyframes firefly { 0%, 100% { opacity: 0.2; transform: translate(0, 0); } 30% { opacity: 1; transform: translate(10px, -8px); } 60% { opacity: 0.5; transform: translate(-6px, -16px); } }
@keyframes sway { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
/* 연금 */
.rarity-tag { font-size: 0.7rem; padding: 1px 6px; border-radius: 3px; border: 1px solid currentColor; }
.alchemy-need { line-height: 1.6; }

/* ---------- 노선도 · 임무: 다른 화면과 같은 톤으로 다듬기 ---------- */
.map-card { padding: 18px 20px; }
.map-card .metro-head strong { font-size: 1.05rem; letter-spacing: 0.02em; }
/* 지역 고르기: 두 줄 카드 (등급 · 이름 / 이동 시간 · 브레이크) */
.region-tabs { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 12px 0 8px; }
.region-tab {
  position: relative;
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  padding: 10px 12px 9px;
  border-radius: 3px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, #fff 8%), var(--surface));
  border: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  overflow: hidden;
}
.region-tab::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tone, var(--border)); opacity: 0.85; }
.region-tab.grade-tone-E { --tone: #8A94A6; } .region-tab.grade-tone-D { --tone: #3DD68C; } .region-tab.grade-tone-C { --tone: #4F8CFF; }
.region-tab.grade-tone-B { --tone: #9B7BFF; } .region-tab.grade-tone-A { --tone: #FFB547; } .region-tab.grade-tone-S { --tone: #FF5470; }
.region-tab:hover:not(.locked) { transform: translateY(-1px); border-color: color-mix(in srgb, var(--tone) 60%, var(--border)); }
.region-tab.active { border-color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-text) inset, 0 6px 18px color-mix(in srgb, var(--accent) 22%, transparent); }
.region-tab-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.region-tab-top strong { font-size: 0.9rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.region-tab-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 0.74rem; color: var(--muted); }
.region-tab-meta .region-here { color: var(--accent-text); font-weight: 700; }
.region-tab .region-break { font-size: 0.66rem; letter-spacing: 0.06em; padding: 1px 7px; border-radius: 3px; color: #FF6B7F; background: rgba(255, 84, 112, 0.12); border: 1px solid rgba(255, 84, 112, 0.35); }
.region-tab.locked { opacity: 0.5; filter: saturate(0.6); }
#regionDesc { margin: 2px 2px 10px; line-height: 1.5; }
/* 지도: 카드 끝까지 넘치지 않고, 둥근 액자 안에 */
.map-card .region-map { width: 100%; margin: 4px 0 10px; border-radius: 3px; border: 1px solid var(--border); background: var(--land); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28); }
.region-map .map-region-name { font-size: 2.1px; letter-spacing: 0.25px; opacity: 0.6; }
.region-map .map-label { font-size: 1.6px; font-weight: 600; letter-spacing: 0.02px; }
.region-map .map-label-box { opacity: 0.88; }
.region-map .map-spot { transition: opacity 0.15s; }
.region-map .map-spot:hover .map-pin-wrap { filter: brightness(1.15); }
.region-map .map-break-tag { font-size: 1.3px; }
/* 범례: 작은 칩 */
.metro-legend { gap: 6px; margin-top: 2px; }
.legend-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 3px; font-size: 0.72rem; color: var(--muted); background: color-mix(in srgb, var(--surface) 85%, #fff 4%); border: 1px solid var(--border); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legend-dot.me { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.legend-dot.break { background: #E8344F; }
.legend-dot.route { background: #6A86B8; border-radius: 2px; height: 3px; width: 12px; }
/* 고른 장소 정보 */
#stationBox { padding: 18px 20px; }
#stationBox .station-head strong { font-size: 1.1rem; }
#stationBox .station-dungeon { font-weight: 600; margin: 6px 0 2px; }/* 지역 6곳: 3칸 × 2줄로 가지런히 (좁으면 2칸) */
.region-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .region-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.region-tab-meta { flex-wrap: wrap; row-gap: 4px; }
/* 도착 알림: 창 아래 가운데에 3초 동안 */
.arrive-pop {
  position: fixed; left: 50%; bottom: 28px; z-index: 80;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 3px;
  background: color-mix(in srgb, var(--surface) 92%, #000 8%);
  border: 1px solid var(--accent-text); color: var(--text);
  font-size: 0.9rem; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
  transform: translate(-50%, 0); animation: arriveIn 0.3s ease-out;
  transition: opacity 0.35s, transform 0.35s;
  pointer-events: none;
}
.arrive-pop.out { opacity: 0; transform: translate(-50%, 12px); }
.arrive-icon { font-size: 1rem; }
@keyframes arriveIn { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-width: 760px) { .arrive-pop { bottom: 120px; } }
/* ---------- 알림 · 경고 · 확인 창 (화면 가운데, 사이트 디자인) ---------- */
dialog.ui-pop {
  --tone: #FFB547;
  margin: auto; /* 화면 정가운데 */
  width: min(480px, calc(100vw - 32px)); /* 확인 창은 조금 넓게 */
  box-sizing: border-box;
  padding: 26px 22px 18px;
  border-radius: 3px;
  border: 1px solid color-mix(in srgb, var(--tone) 35%, var(--border));
  background:
    radial-gradient(120% 70% at 50% -10%, color-mix(in srgb, var(--tone) 16%, transparent), transparent 60%),
    var(--surface);
  color: var(--text);
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  overflow: hidden;
  animation: uiPopIn 0.18s ease-out;
}
dialog.ui-pop::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, transparent, var(--tone), transparent); }
dialog.ui-pop::backdrop { background: rgba(6, 8, 14, 0.62); backdrop-filter: blur(3px); }
dialog.ui-pop.closing { animation: uiPopOut 0.14s ease-in forwards; }
.ui-pop-ok { --tone: #3DD68C; }
.ui-pop-info, .ui-pop-ask { --tone: var(--accent-text); }
.ui-pop-icon {
  width: 46px; height: 46px; margin: 0 auto 10px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 1.35rem; font-weight: 900; font-family: inherit;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 14%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--tone) 55%, transparent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--tone) 30%, transparent);
}
.ui-pop-title { display: block; font-size: 0.78rem; letter-spacing: 0.18em; color: var(--tone); margin-bottom: 8px; }
.ui-pop-text { margin: 0 0 18px; white-space: pre-line; line-height: 1.6; font-size: 0.95rem; word-break: keep-all; }
.ui-pop-buttons { display: flex; gap: 8px; justify-content: center; }
.ui-pop-buttons button { flex: 1 1 0; max-width: 160px; margin: 0; padding: 9px 14px; }
@keyframes uiPopIn { from { opacity: 0; transform: translateY(8px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes uiPopOut { to { opacity: 0; transform: translateY(6px) scale(0.98); } }
html[data-motion="reduce"] dialog.ui-pop { animation: none; }/* 창 글자 크기: 메인 화면 큰 탭(요원 · 상점 …)과 같은 1rem으로 통일 */
.ui-pop-title { font-size: 1rem; letter-spacing: 0.12em; }
.ui-pop-text { font-size: 1rem; }
.ui-pop-buttons button { font-size: 1rem; }
.arrive-pop { font-size: 1rem; }
/* ---------- 던전 브레이크: 빨강 → 사이트 톤에 맞춘 푸른색 (내 위치 핀의 테마 파랑과 구분되게 하늘빛) ---------- */
:root { --break: #38BDF8; --break-soft: rgba(56, 189, 248, 0.14); --break-line: rgba(56, 189, 248, 0.35); }
.board { background: #070B14; border-color: #14243A; color: #7CCBFA; box-shadow: inset 0 0 18px rgba(56, 160, 248, 0.12); }
.board-title { color: var(--break); text-shadow: 0 0 8px rgba(56, 189, 248, 0.75); }
.ticker { border-top-color: #17304A; border-bottom-color: #17304A; }
.ticker-text { color: #A5D8FF; text-shadow: 0 0 6px rgba(120, 190, 255, 0.6); }
.board-list li { border-bottom-color: #0E1A2A; }
.board-list li:hover { color: #C4E6FF; }
.board-grade { background: var(--break); color: #07101C; }
.board-time { color: #5A7A99; }
.board-empty { color: #3E5670; }
.board-note { color: #5A7A99; }
.break-note { color: var(--break); }
.region-break { color: var(--break); }
.region-tab .region-break { color: var(--break); background: var(--break-soft); border-color: var(--break-line); }
.break-ring { fill: var(--break-soft); stroke: var(--break); }
.map-break-tag, .region-map .map-break-tag { fill: var(--break); }
.region-map .map-pin.break { fill: var(--break); filter: drop-shadow(0 0 0.6px rgba(56, 189, 248, 0.9)); }
.legend-dot.break { background: var(--break); }
.persona-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ui-pop-buttons { flex-wrap: wrap; }
.ui-pop-buttons:has(button:nth-child(4)) button { flex: 1 1 28%; }
.guide-box .pop-meter { margin-bottom: 8px; }
.hq-npc { padding: 12px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 3px; }
.hq-npc p { margin: 4px 0 8px; }
.hq-npc button { margin: 0; }
.hq-sub { display: block; margin: 14px 0 6px; font-size: 0.9rem; }
.hq-row { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 6px; text-align: left; }
.hq-name { flex: 1; }
.guide-box button { margin: 4px 0 0; }
.guide-line { margin: 10px 0 0; padding: 10px 12px; border-left: 2px solid var(--accent-text); background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 0 3px 3px 0; font-size: 0.9rem; line-height: 1.6; font-style: italic; word-break: keep-all; }
.break-tip { position: fixed; z-index: 60; transform: translate(-50%, -100%); pointer-events: none; padding: 5px 10px; border-radius: 3px; font-size: 0.82rem; white-space: nowrap; background: var(--surface); color: var(--break); border: 1px solid var(--break-line); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); }
.break-tip[hidden] { display: none; }
/* 요원 정보 창: 프로필 아래 작은 버튼 줄 (누르면 설명 창) */
.agent-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.agent-action { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 3px; font-size: 0.82rem; margin: 0; }
.agent-action-icon { font-size: 0.85rem; opacity: 0.8; }
.agent-action.on { border-color: var(--accent-text); color: var(--accent-text); background: color-mix(in srgb, var(--accent) 12%, transparent); }
/* 설명 창 안의 막대 · 단계표 */
.ui-pop-body { text-align: left; margin: -6px 0 16px; }
.ui-pop-body .pop-meter { margin-bottom: 8px; }
.ui-pop-body .sync-ladder { margin-top: 10px; }
/* ---------- 의뢰 게시판 ---------- */
.board-card { padding: 18px 20px; }
.board-sec-head { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.req-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 10px 12px; margin-bottom: 8px; border-radius: 3px; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 92%, #fff 3%); }
.req-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.req-type { flex: none; font-size: 0.7rem; font-weight: 700; padding: 1px 8px; border-radius: 3px; color: var(--req); background: color-mix(in srgb, var(--req) 14%, transparent); border: 1px solid color-mix(in srgb, var(--req) 45%, transparent); }
.req-name { font-size: 0.92rem; }
.req-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.req-reward { color: var(--accent-text); }
.req-buttons button { margin: 0; white-space: nowrap; }
.req-active { border-color: color-mix(in srgb, var(--accent-text) 45%, var(--border)); }
.req-done { border-color: #3DD68C; box-shadow: 0 0 12px rgba(61, 214, 140, 0.18); }
.req-claimed { opacity: 0.55; }
.req-claim { background: #2FA36B; }

/* ---------- 요원 정보 창: 히든 어빌리티 · 맨 아래 버튼 줄 ---------- */
.hidden-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.hidden-chip { margin: 0; padding: 4px 10px; border-radius: 3px; font-size: 0.8rem; }
.hidden-chip.hidden-pos { color: #3DD68C; border-color: rgba(61, 214, 140, 0.45); }
.hidden-chip.hidden-neu { color: #FFB547; border-color: rgba(255, 181, 71, 0.45); }
.hidden-chip.hidden-neg { color: #FF6B7F; border-color: rgba(255, 107, 127, 0.45); }
.agent-actions { margin: 14px 0 4px; padding: 14px 0 0; border-bottom: none; border-top: 1px solid var(--border); }

/* ---------- 팝업 창: 네온 없이 요원 정보 창과 같은 기본 디자인 ---------- */
dialog.ui-pop, dialog.ui-pop.ui-pop-ok, dialog.ui-pop.ui-pop-info, dialog.ui-pop.ui-pop-ask, dialog.ui-pop.ui-pop-warn { --tone: var(--text); }
dialog.ui-pop { border: 1px solid var(--border); border-radius: 3px; background: var(--surface); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); }
dialog.ui-pop::before { display: none; }
dialog.ui-pop .ui-pop-icon { color: var(--muted); border: 1px solid var(--border); background: transparent; box-shadow: none; text-shadow: none; }
dialog.ui-pop .ui-pop-title { color: var(--text); text-shadow: none; letter-spacing: 0.04em; }
dialog.ui-pop .ui-pop-buttons button { box-shadow: none; }
dialog.ui-pop .ui-pop-buttons button:disabled { opacity: 0.45; }
dialog.ui-pop::backdrop { background: rgba(5, 8, 20, 0.6); backdrop-filter: none; }
.board-sec-head strong { white-space: nowrap; }
@media (max-width: 520px) { .req-row { grid-template-columns: 1fr; } .req-buttons button { width: 100%; } }

/* ---------- 도감 ---------- */
.codex-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.codex-tabs button { margin: 0; }
.codex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.codex-grid.codex-research { display: block; }
.codex-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin: 0; padding: 10px 12px; text-align: left; border-radius: 3px; background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.codex-tile-top { display: flex; align-items: center; gap: 6px; min-width: 0; width: 100%; }
.codex-tile-top strong { font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.codex-tile-sub { font-size: 0.72rem; color: var(--muted); }
.codex-tile.unknown { opacity: 0.45; border-style: dashed; cursor: default; }
.codex-tile.researched { border-color: color-mix(in srgb, #3DD68C 55%, var(--border)); }
.codex-tile.researched .codex-tile-sub { color: #3DD68C; }
.codex-tile.ready { border-color: var(--accent-text); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 30%, transparent); }
.codex-tile.ready .codex-tile-sub { color: var(--accent-text); font-weight: 700; }
.codex-record { margin-bottom: 12px; }
.codex-done { padding: 4px 0; color: #3DD68C; }
/* ===========================================================
   테마 톤 통일: 로고(NULL-POINT)의 파란빛 두 톤으로 맞추기
   --tone-1 : 로고 글자색 (진한 파랑) · --tone-2 : 한 단계 밝은 파랑 · --tone-deep : 버튼 바탕 파랑
   등급(E~S) · 희귀도 · 위험(빨강) · 코어(금색)처럼 뜻이 있는 색은 그대로 둔다
   =========================================================== */
:root {
  --tone-1: var(--accent-text);
  --tone-2: color-mix(in srgb, var(--accent-text) 62%, var(--text));
  --tone-deep: var(--accent);
  --tone-soft: color-mix(in srgb, var(--accent-text) 14%, transparent);
  --tone-line: color-mix(in srgb, var(--accent-text) 40%, transparent);
  --break: var(--tone-2);
  --break-soft: var(--tone-soft);
  --break-line: var(--tone-line);
}
/* 게이지 막대 */
.bar.hp > div { background: var(--tone-1); }
.bar.exp > div { background: var(--tone-2); }
.bar.guide > div { background: linear-gradient(90deg, var(--tone-deep), var(--tone-1)); }
.bar.compat > div { background: linear-gradient(90deg, var(--tone-1), var(--tone-2)); }
.bar.berserk > div { background: linear-gradient(90deg, var(--tone-2), var(--tone-1)); }
.bar.berserk.danger > div { background: linear-gradient(90deg, #FFB347, #FF4D6A); } /* 폭주 중일 때만 경고색 */
/* 던전 브레이크 전광판 · 지도 */
.board { background: color-mix(in srgb, var(--surface) 70%, #000); border-color: var(--border); color: var(--tone-2); box-shadow: inset 0 0 18px var(--tone-soft); }
.board-title { color: var(--tone-1); text-shadow: 0 0 8px var(--tone-line); }
.ticker { border-top-color: var(--border); border-bottom-color: var(--border); }
.ticker-text { color: var(--tone-2); text-shadow: none; }
.board-list li { border-bottom-color: var(--border); }
.board-list li:hover { color: var(--text); }
.board-grade { background: var(--tone-1); color: var(--on-accent); }
.board-time, .board-note, .board-empty { color: var(--muted); }
.region-map .map-pin.break { filter: none; }
.map-crack { stroke: var(--tone-2); }
.map-pin.me { stroke: var(--tone-1); }
.region-map .dest-ring { stroke: var(--tone-1); }
.here-chip { background: var(--tone-soft); color: var(--tone-1); border-color: var(--tone-line); }
/* 칩 · 표시 */
.chat-list li.mine b { color: var(--tone-1); }
.noti-tag.k-admin, .noti-tag.k-mail, .noti-tag.k-gift, .noti-tag.k-relation, .noti-tag.k-home, .noti-tag.k-recover { color: var(--tone-2); border-color: var(--tone-line); }
.buff-chip { color: var(--tone-2); border-color: var(--tone-line); }
.home-card { border-color: var(--tone-line); }
.cook-need.ok { color: var(--tone-1); border-color: var(--tone-line); }
.sync-ladder .sync-mark, .sync-ladder li.now strong { color: var(--tone-1); }
.req-done { border-color: var(--tone-1); box-shadow: 0 0 12px var(--tone-soft); }
.req-claim { background: var(--tone-deep); color: var(--on-accent); }
.hidden-chip.hidden-pos { color: var(--tone-1); border-color: var(--tone-line); }
.hidden-chip.hidden-neu { color: var(--muted); border-color: var(--border); }
.codex-tile.researched { border-color: var(--tone-line); }
.codex-tile.researched .codex-tile-sub, .codex-done { color: var(--tone-2); }
.break-tip { color: var(--tone-1); border-color: var(--tone-line); }
/* 왼쪽 상태 칸: 장착 장비 */
.equip-box { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.equip-title { display: block; font-size: 0.85rem; margin-bottom: 6px; }
.equip-row { display: flex; gap: 10px; align-items: baseline; padding: 3px 0; font-size: 0.85rem; min-width: 0; }
.equip-slot { flex: none; width: 2.6em; color: var(--muted); font-size: 0.78rem; }
.equip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 글씨체: 버튼 · 입력칸도 같은 글씨체, 숫자 · 시간은 고정폭 ---------- */
button, input, select, textarea { font-family: inherit; }
.stat-value, .pc-rank, .gacha-letter, .cp-hex input, .board-time, .noti-time, .battle-clock, time,
.bar-label span:last-child, .core-line strong, .log-time, .chat-time, .kr-time { font-family: var(--font-mono); }

/* ---------- 설정: 테마 6종 카드 ---------- */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 6px 0 14px; }
/* 카드마다 theme.js가 그 테마의 변수(--bg · --accent-text …)를 칠해요 → 글자 대비도 자동 */
.preset-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin: 0; padding: 10px 12px; text-align: left; background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.preset-card strong { color: var(--accent-text); }
.preset-card .small { color: var(--muted); font-size: 0.75rem; line-height: 1.4; }
.preset-card.on { border-color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-text) inset; }
.preset-chips { display: flex; gap: 4px; }
.preset-chips i { width: 16px; height: 16px; border-radius: 3px; border: 1px solid var(--border); }

/* ---------- 설정: 커스텀 3색 · 미리보기 ---------- */
.tc-rows { display: grid; gap: 8px; margin: 8px 0; }
.tc-row { display: grid; grid-template-columns: minmax(84px, 1fr) 44px 110px; align-items: center; gap: 8px; margin: 0; }
.tc-row input[type="color"] { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--border); border-radius: 3px; background: var(--surface); cursor: pointer; }
.tc-row input.tc-hex { margin: 0; padding: 7px 8px; font-family: var(--font-mono); text-transform: uppercase; }
.tc-row input.tc-hex.bad { border-color: var(--danger); outline: 1px solid var(--danger); }
.tc-actions { gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.tp-page { padding: 14px; border: 1px solid var(--border); border-radius: 3px; background: var(--bg); color: var(--text); }
.tp-card { padding: 12px; border: 1px solid var(--border); border-radius: 3px; background: var(--surface); box-shadow: var(--panel-shadow); }
.tp-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tp-tab { padding: 4px 10px; border: 1px solid var(--border); border-radius: 3px; font-size: 0.82rem; color: var(--muted); }
.tp-tab.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent-edge); font-weight: 600; }
.tp-tab.on::before { content: "● "; font-size: 0.7em; } /* 색만으로 구분하지 않게 표시도 */
.tp-text { margin: 0 0 4px; }
.tp-accent { color: var(--accent-text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.tp-muted { margin: 0 0 8px; color: var(--muted); font-size: 0.85rem; }
.tp-bar-label { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); margin-top: 6px; }
.tp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tp-row button { margin: 0; }
.tp-icon { width: 20px; height: 20px; fill: none; stroke: var(--accent-text); stroke-width: 1.8; stroke-linejoin: round; }
.tp-contrast { margin: 8px 0 0; font-size: 0.75rem; color: var(--muted); }
@media (max-width: 520px) { .tc-row { grid-template-columns: 1fr 44px 96px; } }

/* ---------- 자동 대비 보완 (theme.js가 계산한 변수) ---------- */
/* 버튼이 바탕과 비슷한 색이면 테두리를 그려요 · 배경과 패널이 같으면 그림자로 경계 */
/*  (필요할 때만 켜져요: theme.js가 html에 data-accent-edge · data-panel-edge를 붙여요 → 평소 디자인은 그대로) */
[data-accent-edge] button:not(.ghost):not(.preset-card), [data-accent-edge] .button { outline: 1px solid var(--accent-edge); outline-offset: -1px; }
[data-accent-edge] .tp-tab.on { outline: 1px solid var(--accent-edge); outline-offset: -1px; }
[data-panel-edge] .card, [data-panel-edge] .tp-card, [data-panel-edge] dialog, [data-panel-edge] .topbar { box-shadow: var(--panel-shadow); }
select { background: var(--surface); color: var(--text); border-color: var(--border); }
/* 카드 · 패널 안의 글자는 패널 색 기준으로 (배경과 패널의 밝기가 정반대인 커스텀 테마도 읽히게) */
.topbar, .card, dialog, .agent-dialog, .battle-box, .guide-common, .codex-tile, .tp-card, .page-overlay-bar, .yt-mini, .break-tip, .theme-panel, select {
  --text: var(--panel-text); --muted: var(--panel-muted); --accent-text: var(--panel-accent-text); --danger: var(--panel-danger);
  --tone-1: var(--accent-text); --tone-2: color-mix(in srgb, var(--accent-text) 62%, var(--text));
  --tone-soft: color-mix(in srgb, var(--accent-text) 14%, transparent); --tone-line: color-mix(in srgb, var(--accent-text) 40%, transparent); --break: var(--tone-2);
  color: var(--text);
}
/* ---------- 연인 상호작용 패널 (색은 테마 변수만) ---------- */
dialog.lover-panel { width: min(400px, calc(100vw - 32px)); padding: 16px 18px 18px; border: 1px solid var(--border); border-radius: 3px; background: var(--surface); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4); }
dialog.lover-panel::backdrop { background: color-mix(in srgb, var(--theme-bg) 70%, transparent); }
.lp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.lp-title { font-size: 0.8rem; font-weight: 500; letter-spacing: 0.14em; color: var(--muted); }
button.lp-close { width: 28px; height: 28px; padding: 0; margin: 0; border: none; font-size: 1.1rem; line-height: 1; color: var(--muted); }
button.lp-close:hover { color: var(--text); }
.lp-desc { margin: 0 0 14px; font-size: 0.85rem; color: var(--muted); }
.lp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
button.lp-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin: 0; padding: 14px 12px; border: 1px solid var(--border); border-radius: 3px; background: transparent; color: var(--text); font-size: 0.9rem; text-align: left; transition: border-color 0.15s, background 0.15s; }
button.lp-card svg { width: 20px; height: 20px; fill: none; stroke: var(--accent-text); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
button.lp-card:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent-text) 55%, var(--border)); }
button.lp-card.on { border-color: var(--accent-text); background: color-mix(in srgb, var(--accent-text) 9%, transparent); }
.lp-result { margin: 14px 0 0; padding: 10px 12px; border-left: 2px solid var(--accent-text); font-size: 0.9rem; line-height: 1.75; color: var(--text); }
.lp-result.bad { border-left-color: var(--danger); color: var(--danger); }
@media (prefers-reduced-motion: reduce) { button.lp-card { transition: none; } }

/* ---------- 선택적 파장 적출 (히든 어빌리티 카드 안 · 색은 테마 변수만) ---------- */
.wx-box { margin-top: 14px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 6px; }
.wx-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.wx-title { display: block; font-size: 1.05rem; }
.wx-sub { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.wx-icon svg { width: 20px; height: 20px; fill: none; stroke: var(--text); stroke-width: 1.6; stroke-linejoin: round; }
/* ---------- AEGIS Mobile: 왼쪽 통신 카드 · 왼쪽 가장자리 휴대폰 손잡이 · 휴대폰 창 (테마 변수만) ---------- */
.am-card { display: flex; flex-direction: column; align-items: stretch; gap: 2px; width: 100%; box-sizing: border-box; margin: 12px 0 0; text-align: left; cursor: pointer; color: var(--panel-text, var(--text)); font: inherit; background: var(--surface); border: 1px solid var(--border); font-weight: 400; }
.am-card:hover { border-color: var(--accent-text); }
.am-card-head { display: flex; align-items: center; gap: 6px; }
.am-card-head .badge { margin-left: auto; }
.am-icon svg, .am-fab svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.am-icon { display: inline-flex; color: var(--accent-text); }
.am-card-status { color: var(--accent-text); }
.am-card-peer { font-weight: 700; }
.am-card-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 휴대폰 손잡이: 화면 왼쪽 끝 가운데 (왼쪽 칸 바깥 여백 안 · 다른 버튼과 겹치지 않게) */
.am-fab { position: fixed; left: 0; top: 50%; transform: translateY(-50%); z-index: 46; width: 18px; height: 58px; margin: 0; padding: 0; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-left: none; border-radius: 0 8px 8px 0; background: var(--surface); color: var(--accent-text); cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); }
.am-fab svg { width: 13px; height: 13px; }
.am-fab::after { content: ""; position: absolute; inset: -6px -10px -6px 0; } /* 누르는 영역은 조금 넓게 */
.am-fab:hover, .am-fab[aria-expanded="true"] { border-color: var(--accent-text); }
.am-fab-dot { position: absolute; top: 6px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); }
@media (max-width: 700px) { .am-fab { width: 26px; height: 52px; } .am-fab svg { width: 15px; height: 15px; } }
/* 휴대폰 창: 기본은 왼쪽 칸 오른쪽(JS가 left를 정해요) · 좁으면 겹쳐서 · 휴대폰이면 전체 화면 */
.aegis-mobile { position: fixed; top: 12px; bottom: 12px; left: 12px; z-index: 48; width: min(380px, calc(100vw - 24px)); box-sizing: border-box; display: flex; flex-direction: column;
  background: var(--surface); color: var(--panel-text, var(--text)); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5); overflow: hidden; }
.aegis-mobile[hidden] { display: none; }
.aegis-mobile.am-in { animation: amIn 0.22s ease-out; }
@keyframes amIn { from { opacity: 0; transform: translateX(-14px); } }
.aegis-mobile.am-overlay { left: 26px; }
.aegis-mobile.am-full { inset: 0; width: 100%; height: 100dvh; border-radius: 0; border: none; }
body.am-lock { overflow: hidden; }
.am-top { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); flex: none; }
.am-title { font-size: 0.9rem; letter-spacing: 0.06em; color: var(--accent-text); white-space: nowrap; }
.am-tabs { display: flex; gap: 4px; margin-left: auto; }
.am-tabs button, .am-close { margin: 0; padding: 4px 10px; font-size: 0.8rem; }
.am-tabs .badge { margin-left: 3px; }
.am-pane { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; overscroll-behavior: contain; }
.am-pane[hidden] { display: none; }
.am-pane .feed-post, .am-pane .feed-body { overflow-wrap: anywhere; }
/* 메신저: 대화방은 기록이 남는 높이를 다 쓰고 입력칸은 아래에 */
.am-dm { display: flex; flex-direction: column; }
.am-dm .messenger { width: 100%; margin: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.am-dm #dmThreadView:not([hidden]) { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.am-dm .dm-thread { flex: 1; min-height: 120px; max-height: none; }
.am-dm .chat-form { flex: none; padding-bottom: env(safe-area-inset-bottom); }
html[data-motion="reduce"] .aegis-mobile.am-in { animation: none; }
@media (prefers-reduced-motion: reduce) { .aegis-mobile.am-in { animation: none; } }
/* 집중 훈련: 다섯 분야 작은 칸 (테마 변수만) */
.focus-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.focus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; margin: 8px 0; }
.focus-tile { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 7px 8px; margin: 0; text-align: left; background: transparent; color: var(--text); border: 1px solid var(--border); border-radius: 4px; font-size: 0.85rem; }
.focus-tile.on { border-color: var(--accent-text); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.focus-tile.main strong::after { content: " ★"; color: var(--accent-text); font-size: 0.8em; }
.focus-tile-top { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.focus-stage { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.focus-bar { height: 5px; margin: 2px 0; }
.focus-bonus { color: var(--accent-text); }
.focus-desc { margin: 4px 0 6px; }
.focus-times { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.focus-times button, .focus-actions button { margin: 0; }
.focus-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.focus-line { color: var(--muted); line-height: 1.6; border-left: 2px solid var(--accent-text); padding-left: 8px; margin: 6px 0; }
#focusActive .bar { margin: 4px 0 6px; }
/* 직접 거래 · 아이템 선물: 작은 2인 거래창 (테마 변수만 사용) */
.tx-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--panel-text); }
.tx-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.tx-dialog p { margin: 6px 0; }
.tx-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.tx-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 520px) { .tx-cols { grid-template-columns: 1fr; } }
.tx-side { border: 1px solid var(--border); border-radius: 6px; padding: 8px; min-width: 0; }
.tx-side.ok { border-color: var(--accent-text); }
.tx-side-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 4px; }
.tx-ok { font-size: .75rem; padding: 1px 6px; border-radius: 10px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.tx-ok.on { color: var(--accent-text); border-color: var(--accent-text); }
.tx-line { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 3px 0; border-bottom: 1px dashed var(--border); font-size: .85rem; }
.tx-line span { min-width: 0; overflow-wrap: anywhere; }
.tx-line button { padding: 1px 8px; margin: 0; }
.tx-cores { border-bottom: 0; }
.tx-pick { margin: 8px 0; }
.tx-pick summary { cursor: pointer; color: var(--accent-text); }
.tx-inv { display: grid; gap: 2px; max-height: 220px; overflow-y: auto; margin-top: 6px; }
.tx-inv-row { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 4px; font-size: .85rem; }
.tx-inv-row.on { background: rgba(127, 160, 255, .08); }
.tx-inv-row.off { opacity: .55; }
.tx-inv-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tx-inv-row button { padding: 1px 8px; margin: 0; }
.tx-dialog input.tx-qty { flex: 0 0 64px; width: 64px; min-width: 0; margin: 0; padding: 2px 4px; }
.tx-dialog .tx-inv-row button { flex: none; }
.tx-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }
.tx-novel { line-height: 1.7; color: var(--muted); border-left: 2px solid var(--accent-text); padding-left: 8px; }
#nearbyList .agent-row { cursor: pointer; }
/* 가방의 파장 분리 앰플 아이콘 (이름 앞 작은 앰플) */
.amp-icon { display: inline-flex; vertical-align: -3px; margin-right: 5px; }
.amp-icon svg { width: 16px; height: 16px; fill: none; stroke: var(--accent-text, var(--text)); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.wx-desc { margin: 10px 0 14px; font-size: 0.85rem; color: var(--muted); line-height: 1.6; }
.wx-sel-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 8px; }
.wx-list { display: flex; flex-direction: column; gap: 6px; }
.wx-row { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; margin: 0; border: 1px solid transparent; border-radius: 4px; cursor: pointer; }
.wx-row.on { border-color: color-mix(in srgb, var(--accent-text) 55%, var(--border)); background: color-mix(in srgb, var(--accent-text) 7%, transparent); }
.wx-check { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 0; border: 1.5px solid var(--muted); border-radius: 50%; display: grid; place-items: center; cursor: pointer; background: transparent; }
.wx-check:checked { background: var(--text); border-color: var(--text); }
.wx-check:checked::after { content: ""; width: 9px; height: 5px; border-left: 2px solid var(--surface); border-bottom: 2px solid var(--surface); transform: translateY(-1px) rotate(-45deg); }
.wx-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wx-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wx-neg { font-size: 0.68rem; padding: 0 5px; border: 1px solid var(--danger); color: var(--danger); border-radius: 2px; line-height: 15px; }
.wx-pen { font-size: 0.78rem; color: var(--muted); }
.wx-cost { font-size: 0.75rem; color: var(--muted); font-family: var(--font-mono); }
.wx-empty { margin: 4px 0 8px; }
.wx-sum { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.wx-line { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.9rem; color: var(--muted); }
.wx-line b, .wx-line span:last-child { color: var(--text); font-family: var(--font-mono); }
.wx-total b { font-size: 1.15rem; }
button.wx-go { display: block; width: 100%; margin: 14px 0 0; padding: 12px; border-radius: 999px; font-weight: 600; }
.wx-foot { margin: 8px 0 0; text-align: center; font-size: 0.75rem; color: var(--muted); }
dialog.wx-dialog { width: min(420px, calc(100vw - 32px)); padding: 18px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
dialog.wx-dialog::backdrop { background: color-mix(in srgb, var(--theme-bg) 70%, transparent); }
.wx-confirm-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wx-confirm-list li { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 0.9rem; }
.wx-warn { margin: 12px 0 0; font-size: 0.82rem; line-height: 1.6; color: var(--text); padding: 10px 12px; border-left: 2px solid var(--danger); }
.wx-msg { min-height: 1.2em; margin: 8px 0 0; color: var(--danger); }
.wx-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 10px; }
.wx-actions button { margin: 0; }
.wx-actions button.wx-go { margin: 0; }
.wx-done { margin: 10px 0 0; font-size: 0.88rem; line-height: 1.6; }
.wx-line-novel { margin: 12px 0; padding: 10px 12px; border-left: 2px solid var(--accent-text); font-size: 0.88rem; line-height: 1.75; }

/* ---------- 강화 정보 ---------- */
.enh-info { margin: 6px 0 8px; display: flex; flex-direction: column; gap: 3px; font-size: 0.85rem; }
.enh-line { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.enh-short { color: var(--danger); font-weight: 600; }
.enh-fail { margin: 2px 0 0; }

/* ---------- 영구 동조 서약 (결혼) — 색은 테마 변수만 ---------- */
.bond-box { display: flex; flex-direction: column; gap: 8px; }
.bond-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bar.bond { height: 6px; }
.bar.bond > div { background: var(--tone-2); }
.bond-note { margin: 0; }
.bond-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--border); border-radius: 3px; font-size: 0.88rem; }
.bond-row > span { flex: 1 1 180px; min-width: 0; }
.bond-row button { margin: 0; }
button.bond-propose { margin: 2px 0 0; }
.bond-vow { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0 0; border-top: 1px solid var(--border); font-size: 0.9rem; }
.bond-vow strong { font-family: var(--font-mono); color: var(--accent-text); }
.bond-anniv { margin: 0; padding: 8px 10px; border-left: 2px solid var(--accent-text); font-size: 0.85rem; line-height: 1.6; }
.bond-actions { gap: 6px; flex-wrap: wrap; }
.bond-actions button { margin: 0; }
.bond-log p { margin: 6px 0; white-space: pre-line; line-height: 1.6; }
.lp-sub { display: block; margin: 14px 0 8px; }
/* 왼쪽 요원 카드 아래 D-DAY */
button.vow-card { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: baseline; width: 100%; margin: 8px 0 0; padding: 10px 12px; text-align: left; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 3px; }
button.vow-card:hover { border-color: color-mix(in srgb, var(--accent-text) 55%, var(--border)); }
.vow-card-name { font-size: 0.82rem; min-width: 0; overflow-wrap: anywhere; }
.vow-card-dday { grid-row: span 2; font-family: var(--font-mono); font-size: 1.1rem; color: var(--accent-text); }
.vow-card-date { font-size: 0.72rem; color: var(--muted); }
/* 서약서 · 반지 상세 (작은 문서) */
dialog.vow-doc { width: min(460px, calc(100vw - 24px)); padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--page-text); text-align: center; }
dialog.vow-doc::backdrop { background: color-mix(in srgb, var(--theme-bg) 75%, transparent); }
.vow-frame { padding: 16px 16px 12px; border: 1px solid color-mix(in srgb, var(--accent-text) 30%, var(--border)); border-radius: 6px; }
.vow-top { display: flex; justify-content: space-between; align-items: center; font-size: 0.66rem; letter-spacing: 0.08em; color: var(--page-muted); }
.vow-icon { font-size: 0.9rem; color: var(--page-accent-text); }
.vow-title { margin: 14px 0 4px; font-size: 1.25rem; letter-spacing: 0.04em; }
.vow-sub { margin: 0 0 12px; font-size: 0.7rem; letter-spacing: 0.08em; color: var(--page-muted); }
dialog.vow-doc hr { border: none; border-top: 1px solid color-mix(in srgb, var(--accent-text) 25%, var(--border)); margin: 12px 0; }
.vow-text { margin: 8px 0 6px; font-size: 0.92rem; line-height: 1.7; }
.vow-text2 { margin: 0 0 12px; font-size: 0.78rem; line-height: 1.7; color: var(--page-muted); }
.vow-who { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vow-person { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 4px; background: var(--surface); color: var(--panel-text); }
.vow-label { font-size: 0.62rem; letter-spacing: 0.1em; color: var(--page-muted); }
.vow-person .vow-label { color: var(--panel-muted); }
.vow-person strong { font-size: 1.05rem; overflow-wrap: anywhere; }
.vow-date { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.vow-date strong { font-family: var(--font-mono); font-size: 1.05rem; }
.vow-reg { font-family: var(--font-mono); font-size: 0.68rem; color: var(--page-muted); }
.vow-registry { margin: 0; font-size: 0.66rem; letter-spacing: 0.08em; color: var(--page-muted); }
.vow-engrave { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; padding: 12px; border-radius: 4px; background: var(--surface); color: var(--panel-text); }
.vow-engrave .vow-label { color: var(--panel-muted); }
.vow-foot { margin: 10px 0 0; font-size: 0.78rem; color: var(--page-muted); }
.vow-actions { justify-content: center; gap: 8px; margin-top: 12px; }
.vow-actions button, button.vow-close { margin: 10px 0 0; }

/* 입력칸은 바탕이 배경색이라 페이지 기준 글자로 */
input[type="text"], input[type="password"], input[type="email"], input[type="number"], textarea { --text: var(--page-text); --muted: var(--page-muted); color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
:focus-visible, [data-accent-edge] button:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.companion-head { margin: 10px 0 4px; }
.agent-place { color: var(--accent-text); }
.companion-line { display: block; line-height: 1.5; }
.companion-leader { color: var(--accent-text); font-weight: 700; }
.agent-info .agent-name { flex-wrap: wrap; word-break: keep-all; }

/* ---------- 능력 재선택 창: 등록 화면처럼 정사각형에 가까운 카드 ---------- */
.agent-dialog.wide-pick { width: min(880px, calc(100vw - 32px)); }
.wide-pick .pick-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.wide-pick .pick { min-height: 180px; padding: 12px; margin: 0; justify-content: flex-start; white-space: normal; height: auto; }
.pick.current { opacity: 0.55; }
.pick .pick-effect { margin-top: auto; padding-top: 6px; color: var(--accent-text); font-weight: 600; font-size: 0.82rem; }
.travel-party-check { display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-size: 0.9rem; }
.travel-party-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent-text); }
.travel-checks { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.agent-dialog .travel-checks { align-items: flex-start; margin: 4px 0 12px; }
.relic-damaged { border-style: dashed; }

/* ---------- 월드 이벤트 알림판 (화면 가운데 위) ---------- */
.world-card { border-color: var(--tone-1); background: linear-gradient(135deg, var(--tone-soft), transparent 60%), var(--surface); margin-bottom: 12px; }
.world-card .market-head strong { color: var(--tone-1); letter-spacing: 0.06em; }
.world-bar > div { background: linear-gradient(90deg, var(--tone-deep), var(--tone-1)); }
.world-mine { margin: 8px 0 10px; color: var(--tone-2); }
.world-tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.world-tier { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px; text-align: center; border: 1px solid var(--border); border-radius: 3px; opacity: 0.6; }
.world-tier.reached { opacity: 1; border-color: var(--tone-line); background: var(--tone-soft); }
.world-tier.claimed { opacity: 0.75; }
.world-tier button { margin: 2px 0 0; }
@media (max-width: 520px) { .world-tiers { grid-template-columns: 1fr; } }

/* ===== AEGIS 피드 ===== */
.feed-card { display: flex; flex-direction: column; gap: 10px; }
.feed-compose textarea, .feed-comment-form textarea, .feed-edit { width: 100%; box-sizing: border-box; resize: vertical; min-height: 64px; }
.feed-comment-form textarea { min-height: 34px; }
.feed-compose-row { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-top: 6px; flex-wrap: wrap; }
.feed-count { margin-right: auto; font-family: var(--font-mono); }
.feed-share { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding: 8px; border: 1px solid var(--border); border-radius: 6px; }
.feed-share button { text-align: left; }
.feed-search { width: 100%; box-sizing: border-box; }
.feed-list { display: flex; flex-direction: column; gap: 8px; }
.feed-post { border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; background: color-mix(in srgb, var(--bg) 35%, var(--surface)); }
.feed-post.mission { border-left: 3px solid var(--accent-text); }
.feed-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; min-width: 0; }
.feed-name { background: none; border: 0; padding: 0; margin: 0; color: var(--accent-text); font: inherit; font-weight: 600; cursor: pointer; min-height: 0; }
.feed-name:hover, .feed-name:focus-visible, .feed-name[aria-expanded="true"] { text-decoration: underline; }
.feed-name.gone { color: var(--muted); font-weight: 400; cursor: default; }
.feed-role { font-size: 11px; color: var(--muted); }
.feed-at { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.feed-icon { background: none; border: 0; padding: 2px 6px; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; min-height: 0; border-radius: 4px; }
.feed-icon:hover, .feed-icon:focus-visible { color: var(--text); background: color-mix(in srgb, var(--accent) 35%, transparent); }
.feed-like.on { color: var(--accent-text); }
.feed-manage { margin-left: auto; letter-spacing: 1px; }
.feed-mission { font-size: 11px; color: var(--accent-text); margin-top: 4px; }
.feed-body { margin: 6px 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.feed-foot { display: flex; gap: 4px; margin-left: -6px; }
.feed-comments { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.feed-comment .feed-body { margin: 2px 0 0; font-size: 13px; }
.feed-comment-form { display: flex; gap: 6px; align-items: flex-end; }
.feed-new, .feed-more { align-self: center; }
.feed-empty { text-align: center; padding: 12px 0; }
/* 작성자 이름 메뉴 · 관리 메뉴 */
.feed-pop { position: absolute; z-index: 1000; min-width: 148px; max-width: calc(100vw - 16px); padding: 4px; background: var(--surface); color: var(--panel-text, var(--text)); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); display: flex; flex-direction: column; }
.feed-pop-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; background: none; border: 0; border-radius: 4px; color: inherit; font: inherit; font-size: 13px; text-align: left; cursor: pointer; min-height: 36px; }
.feed-pop-item:hover:not([disabled]), .feed-pop-item:focus-visible { background: color-mix(in srgb, var(--accent) 55%, transparent); outline: none; }
.feed-pop-item[disabled] { opacity: 0.45; cursor: not-allowed; }
.feed-pop-icon { width: 16px; text-align: center; color: var(--accent-text); font-size: 13px; }
.feed-pop-note { margin: 0 10px 6px 34px; font-size: 11px; color: var(--muted); max-width: 200px; }
/* 전체 지역 개방: 내 등급보다 높은 지역은 위험 표시만 */
.region-tab.danger .region-tab-meta span:first-child { color: var(--danger); }
/* 가운데 팝업 (연인 상호작용 · 폭주 경고 · 전설 칭호) */
.center-pop { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.45); }
.center-pop-box { width: min(420px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); color: var(--panel-text, var(--text)); border: 1px solid var(--border); border-radius: 6px; padding: 16px 18px; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4); }
.center-pop-box.warn { border-color: var(--danger); }
.center-pop-box.legend { border-color: var(--accent-text); }
.center-pop-kicker { font-size: 0.75rem; color: var(--muted); letter-spacing: 0.04em; margin: 0 0 4px; }
.center-pop-box.warn .center-pop-kicker { color: var(--danger); }
.center-pop-title { margin: 0 0 6px; font-size: 1.05rem; }
.center-pop-who { font-size: 0.8rem; color: var(--muted); margin: 0 0 10px; }
.center-pop-text { margin: 0 0 10px; line-height: 1.65; white-space: pre-wrap; }
.center-pop-list { margin: 0 0 12px; padding-left: 18px; font-size: 0.85rem; color: var(--muted); }
.center-pop-actions { display: flex; justify-content: flex-end; gap: 6px; }
.center-pop-actions button { min-height: 30px; padding: 0 12px; font-size: 0.85rem; }
/* 칭호 등급 · 진행도 (작게) */
.title-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.title-tier { flex: none; font-size: 0.68rem; padding: 0 5px; border: 1px solid var(--border); border-radius: 3px; color: var(--muted); line-height: 1.5; }
.title-tier.tier-hero { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent-text) 45%, var(--border)); }
.title-tier.tier-legend { color: var(--text); border-color: var(--accent-text); background: color-mix(in srgb, var(--accent) 30%, transparent); }
.title-tile.tier-legend.owned { border-color: var(--accent-text); }
.title-prog { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; color: var(--muted); font-family: var(--font-mono); }
.title-prog.done { color: var(--accent-text); font-family: var(--font); }
.title-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.title-bar > div { height: 100%; background: var(--accent-text); }
.danger-note { color: var(--danger); }
/* 연인 상호작용 기록 */
.lp-log { margin-top: 8px; }
.lp-loglist { margin-top: 8px; max-height: 200px; overflow-y: auto; border-top: 1px solid var(--border); padding-top: 6px; }
.lp-logrow p { margin: 2px 0 8px; line-height: 1.5; }
/* 운영진 메시지 띠: 맨 위를 얇게 흘러 지나가요 · 누르거나 막지 않아요 */
.admin-ticker { position: fixed; top: 0; left: 0; right: 0; z-index: 1500; height: 28px; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: color-mix(in srgb, var(--surface) 92%, transparent); border-bottom: 1px solid var(--accent-text); color: var(--panel-text, var(--text)); pointer-events: none; overflow: hidden; }
.admin-ticker[hidden] { display: none; }
.admin-ticker-tag { flex: none; font-size: 0.7rem; letter-spacing: 0.04em; color: var(--accent-text); border: 1px solid var(--accent-text); border-radius: 3px; padding: 0 5px; line-height: 1.5; }
.admin-ticker-lane { flex: 1; overflow: hidden; white-space: nowrap; position: relative; height: 100%; display: flex; align-items: center; }
.admin-ticker-text { display: inline-block; font-size: 0.85rem; white-space: nowrap; will-change: transform; }
@keyframes admin-ticker { from { transform: translateX(var(--ticker-from, 100vw)); } to { transform: translateX(var(--ticker-to, -100%)); } }
@media (prefers-reduced-motion: reduce) { .admin-ticker-text { white-space: normal; overflow: hidden; text-overflow: ellipsis; } }