/* ===========================================
   style.css — 모든 페이지가 같이 쓰는 "옷"
   색은 전부 아래 변수(--이름)로만 씁니다.
   처음에는 "기본 색"을 쓰고,
   설정 탭에서 배경 색·버튼 색을 고르면 theme.js가 그 색으로 바꿔줘요.
   =========================================== */

/* 기본 색 · 라이트 모드 */
:root {
  --bg:      #F8F8F8;   /* 배경 */
  --surface: #FFFFFF;   /* 카드 배경 */
  --border:  #E0E1E6;   /* 테두리 */
  --text:    #1C1C1C;   /* 글자 */
  --muted:   #6B6E78;   /* 흐린 글자 */
  --accent:  #8696C0;   /* 포인트 색 (버튼 배경) */
  --on-accent: #10172E; /* 포인트 색 위의 글자 (밝은 버튼이라 어두운 글자) */
  --accent-text: #4A5D94; /* 포인트 색으로 쓰는 글자 (배경 위에서 잘 보이게 조금 진하게) */
  --danger:  #C62F3A;   /* 오류 메시지 */
}

/* 기본 색 · 다크 모드 (html에 data-theme="dark"가 붙으면 적용) */
:root[data-theme="dark"] {
  --bg:      #1C1C1C;
  --surface: #252525;
  --border:  #353535;
  --text:    #ECECEC;
  --muted:   #9A9A9A;
  --accent:  #123DA8;
  --on-accent: #FFFFFF;
  --accent-text: #5B82E8; /* 어두운 배경 위에서 잘 보이게 조금 밝게 */
  --danger:  #FF6B6B;
}

/* 설정 탭에서 배경 색·버튼 색을 직접 고르면,
   theme.js가 위 색들(--bg, --accent ...)을 고른 색으로 덮어써요. */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, "Malgun Gothic", sans-serif;
  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; }
.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: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

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

button, .button {
  display: inline-block;
  border: none;
  border-radius: 8px;
  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: 8px;
  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-family: ui-monospace, Consolas, monospace;
  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(150px, 34vw, 240px);
  border-radius: 12px;
  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; }

/* 점이 . → .. → ... 순서로 바뀌는 애니메이션 */
.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: 999px;
  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: 999px; 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: #105BE6; border-color: #105BE6; color: #FFFFFF; }
.pick.selected[data-role="esper"] span { color: rgba(255, 255, 255, 0.85); }
.pick.selected[data-role="guide"] { background: #F3F3F4; border-color: #C9CBD3; color: #1C1C1C; }
.pick.selected[data-role="guide"] span { color: #4A4D57; }

/* 임무 */
.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: 8px;
  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-name { font-size: 0.7rem; color: var(--muted); white-space: nowrap; }
.room-link { color: var(--border); }

.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-family: ui-monospace, Consolas, monospace; 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: 10px; 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: 8px;
  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: 8px;
  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: 999px;
  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: 10px;
  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: 10px;
  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: 272px;
  max-width: 100%;
  min-height: 140px;
  box-sizing: border-box;
  padding: 18px;
  margin-bottom: 16px;
  border-radius: 14px;
  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: 10px; overflow: hidden; border: 1px solid var(--border); }
.bgm-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  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: 6px;
  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: 10px;
  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: 14px;
  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: 10px; 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: 14px;
    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;
  grid-template-columns: 300px minmax(0, 1fr) 320px;
  gap: 16px;
  max-width: 1500px;
  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: 999px;
  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: 10px; 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: 999px; background: rgba(79, 168, 255, 0.18); color: #6FB8FF; border: 1px solid #4FA8FF; }

/* ---------- 오른쪽: 던전 브레이크 전광판 ---------- */
.board {
  background: #07080D;
  border: 2px solid #2A1218;
  border-radius: 12px;
  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: 4px; 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-family: ui-monospace, Consolas, monospace; 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: 8px; 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; }

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: 10px;
  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: 5px; }
.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: 999px;
  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: 14px;
  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: 10px; }
@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: 272px; 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: 10px;
  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: 999px;
  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: 12px;
  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: 999px; 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: 10px;
  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) {
  .log, .chat-list, .top-panel, .panel-left, .panel-right, .agent-dialog, .storage-col, textarea {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--accent-text) 55%, transparent) transparent;
  }
}
.log::-webkit-scrollbar, .chat-list::-webkit-scrollbar, .top-panel::-webkit-scrollbar,
.panel-left::-webkit-scrollbar, .panel-right::-webkit-scrollbar, .agent-dialog::-webkit-scrollbar { width: 6px; height: 6px; }
.log::-webkit-scrollbar-track, .chat-list::-webkit-scrollbar-track, .top-panel::-webkit-scrollbar-track,
.panel-left::-webkit-scrollbar-track, .panel-right::-webkit-scrollbar-track, .agent-dialog::-webkit-scrollbar-track { background: transparent; }
.log::-webkit-scrollbar-thumb, .chat-list::-webkit-scrollbar-thumb, .top-panel::-webkit-scrollbar-thumb,
.panel-left::-webkit-scrollbar-thumb, .panel-right::-webkit-scrollbar-thumb, .agent-dialog::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent-text) 55%, transparent);
  border-radius: 999px;
}
.log::-webkit-scrollbar-button, .chat-list::-webkit-scrollbar-button, .top-panel::-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: 8px;
  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; }

/* 파트너 상성 막대 · 버프 칩 · 파티 */
.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: 999px; 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: 10px; 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; }

/* 상점: 이름 옆 가격 */
.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: 4px; margin: 8px 0; white-space: pre-line; }
.role-chip { font-size: 0.75rem; padding: 1px 8px; border-radius: 999px; 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: 8px; 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: 360px; }
.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: 8px; 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); }
.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: 10px;
  background: var(--bg);
}
.cosmetic-tile.owned { opacity: 0.75; }
.cosmetic-tile button { margin-top: auto; }
.mini-card {
  position: relative;
  height: 64px;
  border-radius: 10px;
  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: 5px; }
.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; }
.title-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-top: 8px; }
.title-tile { display: flex; flex-direction: column; gap: 2px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; opacity: 0.6; }
.title-tile.owned { opacity: 1; border-color: var(--accent-text); box-shadow: 0 0 8px rgba(91, 130, 232, 0.25); }
.title-tile.secret { border-style: dashed; }

/* ---------- 캐릭터 테마 색 고르기 (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: 10px;
  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-bottom: 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-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: 8px;
  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: 8px;
  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: 12px;
  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: 8px;
  background: var(--accent);
}

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