/* 팬 배틀 아레나 - 깔끔한 다크 테마 */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #14171c;
  --bg2: #1c2129;
  --bg3: #252c37;
  --line: #313a48;
  --text: #e8ecf2;
  --text-dim: #97a3b4;
  --accent: #e5484d;
  --accent2: #4c8dff;
  --green: #46a758;
  --yellow: #ffb224;
  --radius: 10px;
  font-size: 15px;
}
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  line-height: 1.5;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }
[hidden] { display: none !important; }

.btn {
  border: 1px solid var(--line);
  background: var(--bg3);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: #2e3745; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.blue { background: var(--accent2); border-color: var(--accent2); color: #fff; font-weight: 600; }
.btn.small { padding: 4px 10px; font-size: 0.85rem; border-radius: 6px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.error { color: #ff8589; font-size: .9rem; min-height: 1.2em; margin-top: 8px; }
.hint { color: var(--text-dim); font-size: .85rem; margin-top: 6px; }

input[type=text], input[type=number], select, textarea {
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent2); }

/* ---------- 로그인 ---------- */
#view-login {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
}
.login-box {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 16px;
  padding: 40px 44px; width: 360px; text-align: center;
}
.login-box h1 { font-size: 1.6rem; margin-bottom: 4px; }
.login-box .sub { color: var(--text-dim); margin-bottom: 24px; font-size: .92rem; }
.login-box input { margin-bottom: 12px; text-align: center; }
.login-box .btn { width: 100%; }

/* ---------- 상단바 ---------- */
#topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 0 20px; height: 54px;
  background: var(--bg2); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
#topbar .logo { font-weight: 700; color: var(--accent); }
#topbar nav { display: flex; gap: 4px; flex: 1; }
.tab {
  background: none; border: none; color: var(--text-dim);
  padding: 8px 14px; border-radius: 8px; font-size: .95rem;
}
.tab:hover { color: var(--text); background: var(--bg3); }
.tab.active { color: var(--text); background: var(--bg3); font-weight: 600; }
.my-name { color: var(--text-dim); font-size: .9rem; }

.page { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }

.panel {
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px;
}
.panel h2 { font-size: 1.05rem; margin-bottom: 14px; }
.field-label { display: block; color: var(--text-dim); font-size: .85rem; margin: 12px 0 4px; }

/* ---------- 로비 ---------- */
.lobby-grid { display: grid; grid-template-columns: 320px 1fr; gap: 16px; }
.user-list { list-style: none; }
.user-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 6px; border-bottom: 1px solid var(--line);
}
.user-list li:last-child { border-bottom: none; }
.user-list .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.user-list .status-dot.battle { background: var(--yellow); }
.user-list .uname { flex: 1; }
.user-list .ustatus { color: var(--text-dim); font-size: .82rem; }
.challenge-status {
  margin-top: 16px; padding: 12px; border-radius: 8px;
  background: var(--bg3); border: 1px solid var(--line); font-size: .9rem;
}
.challenge-status .btn { margin-top: 8px; margin-right: 6px; }

/* ---------- 타입 뱃지 ---------- */
.type-badge {
  display: inline-block; padding: 1px 8px; border-radius: 5px;
  font-size: .74rem; font-weight: 700; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.4);
  vertical-align: middle;
}
.type-Normal{background:#9fa19f}.type-Fire{background:#e62829}.type-Water{background:#2980ef}
.type-Electric{background:#fac000}.type-Grass{background:#3fa129}.type-Ice{background:#3fd8ff}
.type-Fighting{background:#ff8000}.type-Poison{background:#9141cb}.type-Ground{background:#915121}
.type-Flying{background:#81b9ef}.type-Psychic{background:#ef4179}.type-Bug{background:#91a119}
.type-Rock{background:#afa981}.type-Ghost{background:#704170}.type-Dragon{background:#5060e1}
.type-Dark{background:#50413f}.type-Steel{background:#60a1b8}.type-Fairy{background:#ef70ef}
.type-Stellar{background:linear-gradient(90deg,#7cc7b2,#83a8e4)}

.cat-badge {
  display: inline-block; padding: 1px 7px; border-radius: 5px;
  font-size: .72rem; font-weight: 700; color: #fff;
}
.cat-Physical{background:#c92112}.cat-Special{background:#4f5870}.cat-Status{background:#8c888c}

/* ---------- 팀빌더 ---------- */
.builder-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.team-list-panel .team-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 8px;
  border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px;
  background: var(--bg3); cursor: pointer;
}
.team-row.active { border-color: var(--accent2); }
.team-row .tname { width: 100%; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-row .ticons { display: flex; gap: 0; flex-wrap: wrap; }

.slot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.slot-card {
  position: relative;
  background: var(--bg3); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 10px; cursor: pointer; min-height: 108px; text-align: center;
  transition: border-color .12s;
}
.slot-card.has-error { border-color: var(--accent); }
.slot-remove {
  position: absolute; top: 6px; right: 6px; z-index: 5;
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg2); color: var(--text-dim);
  font-size: .95rem; line-height: 1; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .12s, color .12s, border-color .12s;
}
.slot-card:hover .slot-remove { opacity: 1; }
.slot-remove:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
.slot-errors {
  margin-top: 6px; text-align: left; font-size: .74rem; color: #ff8589;
  border-top: 1px dashed var(--line); padding-top: 5px; line-height: 1.4;
}
.slot-card:hover { border-color: var(--text-dim); }
.slot-card.selected { border-color: var(--accent2); }
.slot-card img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; }
.slot-card .sname { font-size: .9rem; font-weight: 600; }
.slot-card .sitem { font-size: .78rem; color: var(--text-dim); }
.slot-card .empty-plus { font-size: 1.8rem; color: var(--text-dim); line-height: 88px; }

.editor-panel { margin-top: 4px; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.editor-grid .full { grid-column: 1 / -1; }

.search-select { position: relative; }
.search-select .results {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 30;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 8px;
  max-height: 300px; overflow-y: auto; margin-top: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.search-select .results .row {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; cursor: pointer;
  font-size: .9rem;
}
.search-select .results .row:hover, .search-select .results .row.hl { background: var(--bg3); }
.search-select .results .row img { width: 28px; height: 28px; object-fit: contain; image-rendering: pixelated; }
.search-select .results .row .rname { flex: 0 0 auto; min-width: 110px; }
.search-select .results .row .rsub { color: var(--text-dim); font-size: .78rem; flex: 1; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.custom-tag {
  display: inline-block; background: var(--accent); color: #fff; border-radius: 4px;
  font-size: .68rem; padding: 0 5px; font-weight: 700; vertical-align: middle;
}

/* 검색 필터 */
.species-filter { margin-top: 8px; }
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.filter-sel { width: auto; padding: 5px 8px; font-size: .84rem; border-radius: 7px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--bg3); border: 1px solid var(--accent2); color: var(--text);
  border-radius: 20px; padding: 2px 6px 2px 10px; font-size: .8rem;
}
.tag-x {
  border: none; background: none; color: var(--text-dim); font-size: .95rem;
  padding: 0 2px; line-height: 1;
}
.tag-x:hover { color: var(--accent); }

.ev-table { width: 100%; border-collapse: collapse; }
.ev-table td { padding: 4px 6px; vertical-align: middle; }
.ev-table .stat-name { width: 78px; color: var(--text-dim); font-size: .88rem; }
.ev-table .stat-base { width: 40px; text-align: right; color: var(--text-dim); font-size: .85rem; }
.ev-table input[type=range] { width: 100%; accent-color: var(--accent2); }
.ev-table .ev-num { width: 62px; }
.ev-table .ev-num input { padding: 4px 6px; text-align: center; }
.ev-table .stat-final { width: 52px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.ev-remaining { text-align: right; font-size: .9rem; margin-top: 6px; }
.ev-remaining b { color: var(--yellow); }
.ev-remaining.over b { color: var(--accent); }
.nature-up { color: #ff8589; } .nature-down { color: #7db9ff; }

.builder-toolbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.builder-toolbar .spacer { flex: 1; }
#builder-team-name { max-width: 220px; }
.validate-result { margin-top: 10px; font-size: .88rem; white-space: pre-wrap; }
.validate-result.ok { color: var(--green); }
.validate-result.bad { color: #ff8589; }

/* ---------- 배틀 ---------- */
.battle-layout { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.battle-main { min-width: 0; }
.battle-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
  font-size: .92rem; color: var(--text-dim);
}
.battle-header .vs { color: var(--text); font-weight: 600; }
.battle-header .spacer { flex: 1; }

.field {
  position: relative;
  background: linear-gradient(180deg, #24304a 0%, #2c3b57 55%, #33465e 55%, #2b3c50 100%);
  border: 1px solid var(--line); border-radius: 14px;
  height: 380px; overflow: hidden; margin-bottom: 12px;
}
.field .weather-chips { position: absolute; top: 10px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap; max-width: 60%; }
.chip {
  background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.15);
  color: #dfe7f3; border-radius: 6px; padding: 1px 8px; font-size: .75rem;
}
.mon-spot { position: absolute; width: 190px; text-align: center; transition: opacity .3s; }
.mon-spot img.sprite { width: 130px; height: 130px; object-fit: contain; image-rendering: pixelated; }
.mon-spot.fainted { opacity: 0; }
.mon-spot .statusbar {
  background: rgba(10,14,20,.82); border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px; padding: 5px 8px; font-size: .8rem; text-align: left;
}
.statusbar .row1 { display: flex; align-items: center; gap: 6px; }
.statusbar .mname { font-weight: 600; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.statusbar .lv { color: var(--text-dim); font-size: .72rem; }
.hpbar { height: 7px; background: #3a4353; border-radius: 4px; margin-top: 4px; overflow: hidden; }
.hpbar .fill { height: 100%; background: var(--green); border-radius: 4px; transition: width .4s, background .4s; }
.hpbar .fill.mid { background: var(--yellow); }
.hpbar .fill.low { background: var(--accent); }
.statusbar .hptext { font-size: .72rem; color: var(--text-dim); margin-top: 2px; display: flex; justify-content: space-between; }
.status-chip {
  border-radius: 4px; padding: 0 4px; font-size: .68rem; font-weight: 700; color: #fff;
}
.status-brn{background:#e62829}.status-par{background:#c8a000}.status-slp{background:#8c888c}
.status-frz{background:#3fd8ff;color:#123}.status-psn{background:#9141cb}.status-tox{background:#6d28a8}
.boost-chip { font-size: .68rem; border-radius: 4px; padding: 0 4px; background: rgba(255,255,255,.14); }
.boost-chip.neg { color: #7db9ff; } .boost-chip.pos { color: #ffb1b3; }

.controls {
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; min-height: 130px;
}
.controls .prompt { font-size: .92rem; margin-bottom: 10px; color: var(--text-dim); }
.move-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.move-btn {
  text-align: left; border: 1px solid var(--line); background: var(--bg3);
  border-radius: 8px; padding: 8px 10px; color: var(--text);
}
.move-btn:hover:not(:disabled) { border-color: var(--accent2); }
.move-btn .mv-name { font-weight: 600; font-size: .92rem; }
.move-btn .mv-sub { display: flex; gap: 6px; align-items: center; margin-top: 3px; font-size: .75rem; color: var(--text-dim); }
.switch-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.switch-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 1px solid var(--line); background: var(--bg3); border-radius: 8px;
  padding: 6px 8px; color: var(--text); font-size: .78rem; min-width: 76px;
}
.switch-btn img { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; }
.switch-btn:hover:not(:disabled) { border-color: var(--accent2); }
.switch-btn:disabled { opacity: .4; }
.gimmick-row { display: flex; gap: 14px; margin-top: 10px; font-size: .88rem; align-items: center; }
.gimmick-row label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.controls .queue { font-size: .85rem; color: var(--text-dim); margin-bottom: 8px; }

.forfeit-btn { color: #ff8589; }
.forfeit-btn:hover { border-color: var(--accent); }

/* ---------- 기술 애니메이션 (흑백 이펙트 + 타입 색 글로우) ---------- */
.fx {
  position: absolute; pointer-events: none; z-index: 15;
  transform: translate(-50%, -50%);
}
/* 시전자 링 (변화기/소리) */
.fx-ring {
  width: 90px; height: 90px; border-radius: 50%;
  border: 3px solid #e8e8e8;
  box-shadow: 0 0 18px 4px var(--fx), inset 0 0 12px 2px var(--fx);
  animation: fxRing .55s ease-out forwards;
}
.fx-ring2 { animation-delay: .16s; opacity: 0; }
@keyframes fxRing {
  0% { opacity: 0; scale: .3; }
  25% { opacity: 1; }
  100% { opacity: 0; scale: 1.7; }
}
/* 투사체 */
.fx-orb {
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff, #b9b9b9 60%, #8a8a8a);
  box-shadow: 0 0 16px 6px var(--fx);
  animation: fxOrb .32s linear forwards;
}
.fx-orb-pulse { border-radius: 50%; box-shadow: 0 0 20px 9px var(--fx); }
@keyframes fxOrb {
  from { translate: 0 0; opacity: 1; }
  to { translate: var(--tx) var(--ty); opacity: 1; }
}
/* 폭발 */
.fx-burst {
  width: 70px; height: 70px; border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, #cfcfcf 40%, transparent 70%);
  box-shadow: 0 0 26px 10px var(--fx);
  animation: fxBurst .4s ease-out forwards;
}
@keyframes fxBurst {
  0% { opacity: 0; scale: .3; }
  30% { opacity: 1; }
  100% { opacity: 0; scale: 1.5; }
}
/* 임팩트 별 (타격) */
.fx-impact {
  width: 56px; height: 56px;
  background: #f2f2f2;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  filter: drop-shadow(0 0 10px var(--fx));
  animation: fxBurst .38s ease-out forwards;
}
/* 펀치 */
.fx-punch {
  width: 40px; height: 34px; border-radius: 12px 12px 8px 8px;
  background: linear-gradient(180deg, #f5f5f5, #b5b5b5);
  border: 2px solid #7d7d7d;
  box-shadow: 0 0 14px 4px var(--fx);
  animation: fxPunch .42s ease-out forwards;
}
@keyframes fxPunch {
  0% { opacity: 0; translate: 18px 26px; scale: 1.5; }
  35% { opacity: 1; translate: 0 0; scale: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; scale: .9; }
}
/* 베기 */
.fx-slash {
  width: 78px; height: 5px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, #ffffff 30%, #ffffff 70%, transparent);
  box-shadow: 0 0 10px 2px var(--fx);
  rotate: -45deg;
  animation: fxSlash .4s ease-out forwards;
}
.fx-slash2 { rotate: -45deg; animation-delay: .12s; opacity: 0; margin-top: 14px; margin-left: 12px; }
@keyframes fxSlash {
  0% { opacity: 0; scale: .2 1; translate: -26px -26px; }
  30% { opacity: 1; scale: 1 1; translate: 0 0; }
  100% { opacity: 0; translate: 24px 24px; }
}
/* 물기 (위/아래 송곳니) */
.fx-fang {
  width: 46px; height: 20px;
  background: #ededed;
  filter: drop-shadow(0 0 8px var(--fx));
}
.fx-fang-top {
  clip-path: polygon(0 0, 20% 100%, 40% 0, 60% 100%, 80% 0, 100% 100%, 100% 0);
  animation: fxFangTop .4s ease-out forwards;
}
.fx-fang-bot {
  clip-path: polygon(0 100%, 20% 0, 40% 100%, 60% 0, 80% 100%, 100% 0, 100% 100%);
  animation: fxFangBot .4s ease-out forwards;
}
@keyframes fxFangTop {
  0% { opacity: 0; translate: 0 -34px; }
  40% { opacity: 1; translate: 0 -8px; }
  80% { opacity: 1; translate: 0 -6px; }
  100% { opacity: 0; }
}
@keyframes fxFangBot {
  0% { opacity: 0; translate: 0 34px; }
  40% { opacity: 1; translate: 0 8px; }
  80% { opacity: 1; translate: 0 6px; }
  100% { opacity: 0; }
}
/* 돌진 (접촉기) */
img.sprite.fx-tackle { animation: fxTackle .42s ease-in-out; }
@keyframes fxTackle {
  0% { translate: 0 0; }
  45% { translate: var(--dx, 40px) var(--dy, -20px); }
  100% { translate: 0 0; }
}
img.sprite.fx-lunge-my { animation: fxLungeMy .36s ease-in-out; }
img.sprite.fx-lunge-opp { animation: fxLungeOpp .36s ease-in-out; }
@keyframes fxLungeMy { 45% { translate: 34px -18px; } }
@keyframes fxLungeOpp { 45% { translate: -34px 18px; } }
/* 피격 */
img.sprite.fx-hit { animation: fxHit .32s linear; }
@keyframes fxHit {
  0%, 100% { filter: none; translate: 0 0; }
  25% { filter: brightness(2.2) grayscale(.6); translate: -5px 0; }
  50% { filter: brightness(1.6); translate: 5px 0; }
  75% { filter: brightness(2) grayscale(.4); translate: -3px 0; }
}

/* ---------- 도트 아이콘 ---------- */
.poke-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 30px; flex: 0 0 auto;
  image-rendering: pixelated; vertical-align: middle;
}
.poke-icon img { max-width: 40px; max-height: 30px; image-rendering: pixelated; }
.poke-icon.fainted { filter: grayscale(1) brightness(.55); }
.poke-icon.active { filter: drop-shadow(0 0 4px var(--accent2)); }
.poke-icon.unknown::before {
  content: '?'; color: var(--text-dim); font-weight: 700;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px dashed var(--line);
  display: flex; align-items: center; justify-content: center; font-size: .8rem;
}

/* 배틀 엔트리 바 */
.entry-bar {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 10px; margin-bottom: 10px;
}
.entry-row { display: flex; align-items: center; gap: 4px; }
.entry-label {
  width: 76px; font-size: .78rem; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 팀 프리뷰 */
.preview-box { text-align: center; }
.preview-side { margin: 8px 0; }
.preview-side h3 { font-size: .88rem; color: var(--text-dim); margin-bottom: 6px; text-align: left; }
.preview-row { display: flex; gap: 6px; flex-wrap: wrap; }
.preview-mon {
  border: 1.5px solid var(--line); background: var(--bg3); border-radius: 8px;
  padding: 6px 6px 4px; font-size: .74rem; color: var(--text); position: relative;
  min-width: 72px;
}
.preview-mon .pname { margin-top: 2px; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-mon.pickable { cursor: pointer; }
.preview-mon.pickable:hover { border-color: var(--text-dim); }
.preview-mon.picked { border-color: var(--accent2); background: #21304a; }
.preview-mon .pick-order {
  position: absolute; top: -7px; left: -7px; background: var(--accent2); color: #fff;
  width: 19px; height: 19px; border-radius: 50%; font-weight: 700; font-size: .74rem;
  display: flex; align-items: center; justify-content: center;
}

/* 로그 */
.battle-side-panel { display: flex; flex-direction: column; gap: 10px; }
.log-panel {
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius);
  height: 430px; display: flex; flex-direction: column;
}
.log-scroll { flex: 1; overflow-y: auto; padding: 12px 14px; font-size: .87rem; }
.log-scroll p { margin-bottom: 3px; }
.log-scroll .log-turn { font-weight: 700; color: var(--accent2); margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.log-scroll .log-major { }
.log-scroll .log-minor { color: var(--text-dim); font-size: .82rem; }
.log-scroll .log-chat b { color: var(--accent2); }
.log-scroll .log-win { font-weight: 700; color: var(--yellow); margin-top: 6px; }
.chat-row { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }

/* 타겟 선택 오버레이 */
.target-overlay {
  position: absolute; inset: 0; background: rgba(10,13,18,.55); z-index: 20;
  display: flex; align-items: center; justify-content: center;
}
.target-box { text-align: center; }
.target-box .tmsg { margin-bottom: 10px; font-weight: 600; text-shadow: 0 1px 3px #000; }
.target-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* 모달 */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; width: min(520px, 92vw); max-height: 86vh; overflow-y: auto;
}
.modal h3 { margin-bottom: 12px; font-size: 1.05rem; }
.modal textarea { min-height: 220px; font-family: ui-monospace, monospace; font-size: .82rem; }
.modal .modal-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

@media (max-width: 900px) {
  .lobby-grid, .builder-layout, .battle-layout { grid-template-columns: 1fr; }
  .field { height: 320px; }
}
