:root {
  --bg: #08090d;
  --bg-2: #10131a;
  --panel: #141820;
  --panel-2: #1b202b;
  --line: #2c3340;
  --ivory: #f4efe4;
  --muted: #9b9488;
  --brass: #e0b45a;
  --brass-2: #8d6a2e;
  --blood: #e23d3d;
  --teal: #2fbea4;
  --ink: #12140c;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  font-family: "Noto Sans KR", "Noto Sans CJK KR", "WenQuanYi Micro Hei", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ivory);
  overflow: hidden;
  user-select: none;
}
button, input { font-family: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
.hidden { display: none !important; }

#title {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  background: #07080c;
}
/* title2: 형님 타이틀 영상 배경. 영상 안에 타이틀 문구가 있어 로고는 숨김 */
.title-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #07080c url("../img/title/title_bg.webp?v=20261124-title2") center / cover no-repeat;
}
.title-bg video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.title-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(6, 6, 12, 0.62) 0, rgba(6, 6, 12, 0.18) 14%, transparent 24%),
    radial-gradient(120% 90% at 50% 50%, transparent 62%, rgba(4, 4, 10, 0.5) 100%);
}
#title .title-logo {
  position: absolute;
  left: 50%;
  top: 6.4vh;
  transform: translateX(-50%);
  width: min(860px, 46vw, 82vh);
  margin: 0;
  line-height: 0;
  pointer-events: none;
  user-select: none;
}
#title .title-logo.title-logo-off { display: none; }
#title .title-logo img {
  display: block;
  width: 100%;
  height: auto;
}
.title-card {
  position: absolute;
  left: 50%;
  bottom: 3.6vh;
  transform: translateX(-50%);
  width: max-content;
  max-width: 92vw;
  text-align: center;
  padding: 0;
}
#title .title-actions { gap: 22px; }
#title .title-actions button {
  min-width: 176px;
  padding: 12px 28px;
  font-size: 18px;
  letter-spacing: 0.12em;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}
#title .title-actions button.ghost,
#title #continue {
  background: rgba(14, 10, 16, 0.82);
  color: var(--ivory);
  border: 1px solid #b23a3a;
}
#title .title-actions button.ghost:hover,
#title #continue:hover {
  background: rgba(40, 14, 18, 0.9);
  border-color: #e05a4f;
}
#title .save-note {
  margin: 0 0 12px;
  text-shadow: 0 1px 4px #000, 0 0 10px #000;
}
#title #newgame-confirm,
#title-settings-panel {
  max-width: none;
  margin: 0 auto;
  padding: 18px 26px 18px;
  background: rgba(10, 8, 14, 0.86);
  border: 1px solid #5a3a46;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}
#title #newgame-confirm .title-actions button,
#title-settings-panel .title-actions button { min-width: 120px; font-size: 16px; }
#title-settings-panel .ts-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-width: 260px;
  margin: 0 0 16px;
  font-size: 16px;
  letter-spacing: 0.1em;
  color: var(--ivory);
}
#title-settings-panel .ts-toggle {
  min-width: 84px;
  padding: 7px 16px;
  border: 1px solid var(--brass);
  background: var(--brass);
  color: var(--ink);
  font-weight: 700;
}
#title-settings-panel .ts-toggle.off {
  background: transparent;
  color: #8d877c;
  border-color: #3a3f4a;
}
.pub {
  margin: 0 0 18px;
  letter-spacing: 0.42em;
  font-size: 12px;
  color: var(--brass);
}
.brand {
  margin: 0;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 128px;
  line-height: 0.78;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #f4efe4;
  text-shadow: 0 0 28px rgba(224, 180, 90, 0.35);
}
h1 {
  margin: 10px 0 0;
  font-family: "Black Han Sans", "Noto Sans KR", sans-serif;
  font-size: 64px;
  font-weight: 400;
  letter-spacing: 0.04em;
}
.sub {
  margin: 6px 0 0;
  color: var(--muted);
  letter-spacing: 0.18em;
  font-size: 14px;
  text-transform: uppercase;
}
.goldline {
  width: 72px;
  height: 2px;
  margin: 22px auto 16px;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
}
.title-card .district {
  margin: 0 0 22px;
  font-size: 18px;
  letter-spacing: 0.22em;
}
#enter, #continue, #newgame-yes, #retry, #to-title, #end, #menu-save, .wait {
  border: 0;
  background: var(--brass);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 12px 36px;
  font-size: 16px;
}
#enter:hover, #continue:hover, #newgame-yes:hover, #retry:hover, #end:hover, #menu-save:hover, .wait:hover { background: #f0cb7a; }
#to-title, #menu-btn, #menu-title, #menu-close, #newgame-no, button.ghost {
  background: transparent;
  color: var(--ivory);
  border: 1px solid var(--line);
}
#to-title:hover, #menu-btn:hover, #menu-title:hover, #menu-close:hover, #newgame-no:hover, button.ghost:hover {
  border-color: var(--brass);
  color: var(--brass);
}
#menu-btn, #idle-btn {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}
#idle-btn {
  background: transparent;
  color: var(--ivory);
  border: 1px solid var(--line);
}
#idle-btn:hover { border-color: var(--brass); color: var(--brass); }
#idle-btn:disabled { color: #8d877c; border-color: var(--line); }
#bases-panel {
  position: absolute;
  inset: 0;
  z-index: 21;
  display: grid;
  place-items: center;
  background: rgba(5, 6, 10, 0.62);
}
#bases-panel.hidden { display: none !important; }
.bases-card {
  width: min(720px, calc(100% - 48px));
  max-height: min(70vh, 640px);
  overflow: auto;
  background: #12151c;
  border: 1px solid rgba(224, 180, 90, 0.35);
  box-shadow: var(--shadow);
  padding: 18px 18px 14px;
}
.bases-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.bases-card h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.06em;
}
.bases-card .bases-sum {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.bases-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.bases-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
.bases-table td {
  padding: 8px;
  border-bottom: 1px solid rgba(44, 51, 64, 0.7);
}
.bases-table tr[data-base] { cursor: pointer; }
.bases-table tr[data-base]:hover { background: rgba(224, 180, 90, 0.08); }
.bases-table .tier { color: var(--brass); font-weight: 700; }
.bases-table .own-player { color: #8fd0ff; }
.bases-table .own-enemy { color: #f08a8a; }
.bases-table .own-neutral { color: var(--muted); }
.bases-card .bases-close {
  margin-top: 14px;
  width: 100%;
  padding: 8px 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: transparent;
  color: var(--ivory);
  border: 1px solid var(--line);
}
.bases-card .bases-close:hover { border-color: var(--brass); color: var(--brass); }
.title-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.save-note {
  margin: 0 0 16px;
  color: var(--brass);
  font-size: 14px;
  letter-spacing: 0.08em;
}
#newgame-confirm {
  margin: 8px auto 0;
  max-width: 320px;
}
#newgame-confirm p {
  margin: 0 0 14px;
  color: var(--ivory);
  font-size: 15px;
}
#game-menu {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(5, 6, 10, 0.62);
}
#game-menu.hidden { display: none !important; }
.game-menu-card {
  display: grid;
  gap: 8px;
  min-width: 220px;
  padding: 22px 22px 18px;
  background: #12151c;
  border: 1px solid rgba(224, 180, 90, 0.35);
  box-shadow: var(--shadow);
}
.game-menu-card button {
  width: 100%;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
#menu-save-msg {
  margin: 4px 0 0;
  text-align: center;
  color: var(--brass);
  font-size: 13px;
  letter-spacing: 0.08em;
}

#game {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  background:
    radial-gradient(1200px 500px at 30% 0%, rgba(224, 180, 90, 0.05), transparent 50%),
    var(--bg);
}
@media (min-width: 981px) {
  body {
    background:
      radial-gradient(1200px 600px at 50% 0%, rgba(224, 180, 90, 0.04), transparent 55%),
      #05060a;
  }
  #game, #battle, #overlay {
    width: 100%;
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
  }
  #game {
    box-shadow: 0 0 0 1px rgba(224, 180, 90, 0.2), 0 0 64px rgba(0, 0, 0, 0.55);
  }
  #battle, #overlay {
    left: 0;
    right: 0;
  }
}
#game.enemy { box-shadow: inset 0 3px 0 var(--blood); }
#game.player { box-shadow: inset 0 3px 0 var(--brass); }

#top {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 12, 16, 0.92);
}
.brandblock { display: flex; align-items: center; gap: 10px; min-width: 240px; }
.vr {
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 34px;
  letter-spacing: 0.06em;
  color: var(--brass);
  line-height: 1;
}
.brandblock strong { display: block; font-size: 16px; letter-spacing: 0.04em; }
.brandblock em { display: block; color: var(--muted); font-style: normal; font-size: 11px; letter-spacing: 0.08em; }
.stageblock { min-width: 120px; }
.stageblock b { display: block; font-size: 18px; }
.stageblock span, .turnblock span, .moneyblock span { color: var(--muted); font-size: 12px; }
.turnblock b, .moneyblock b {
  display: block;
  font-family: "Barlow Condensed", "Noto Sans KR", sans-serif;
  font-size: 28px;
  letter-spacing: 0.04em;
  font-weight: 700;
  line-height: 1;
}
.moneyblock { margin-left: auto; text-align: right; }
.moneyblock b { color: var(--brass); }
#end { padding: 10px 18px; font-size: 14px; }
#end:disabled { background: #2a303b; color: #8d877c; }

#layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  height: 100%;
}
#map-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  background:
    radial-gradient(800px 480px at 50% 45%, #1a2230 0%, #0c1016 72%);
}
#map { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#map-wrap.panning, #map-wrap.panning #map { cursor: grabbing; }
#key {
  position: absolute;
  left: 12px;
  top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  max-width: 70%;
  padding: 6px 8px;
  background: rgba(8, 10, 14, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
#key span { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #d9d1c3; }
.sw { width: 10px; height: 10px; display: inline-block; }
.sw.plain { background: #5d6b86; }
.sw.shallow { background: #3a8ec0; }
.sw.deep { background: #165a96; }
.sw.forest { background: #2f7a52; }
.sw.ruin { background: #7a7368; }
.sw.hospital { background: #d7d0c4; }
.sw.rad { background: #6b8a3a; }
.sw.fire { background: #c45a24; }
.sw.bridge { background: #8a7a5c; }
.sw.city { background: #c4a15a; }
.sw.fort { background: #8a6234; }
.sw.home { box-shadow: inset 0 0 0 2px #f0d48a; }

#dock {
  position: absolute;
  left: 12px;
  bottom: 8px;
  z-index: 6;
  width: auto;
  max-width: calc(100% - 240px);
  pointer-events: none;
}
#info:empty { display: none; }
#info.floating {
  position: fixed;
  z-index: 13;
  width: 280px;
  max-width: min(280px, calc(100vw - 24px));
  max-height: min(52vh, 420px);
  overflow: auto;
  pointer-events: auto;
}
#info.floating.docked {
  right: auto;
  bottom: auto;
  transform: none;
}
#info.floating .card {
  background: rgba(8, 10, 14, 0.92);
  border: 1px solid rgba(224, 180, 90, 0.45);
  padding: 8px 10px;
  margin: 0;
}
#dock #log, #log {
  margin: 0;
  padding: 0 2px;
  font-size: 11px;
  color: #c9c2b6;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#hoverline {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  min-height: 18px;
  font-size: 12px;
  color: #efe7d8;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}

#side {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-left: 1px solid var(--line);
}
#info, #bases, #roster, #log { min-height: 0; }
#info { flex: 0 1 auto; max-height: 42%; overflow: auto; border-bottom: 1px solid var(--line); }
#bases { flex: 0 0 auto; overflow: auto; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
#roster { flex: 1 1 auto; overflow: auto; }
#log {
  flex: 0 0 96px;
  overflow: auto;
  border-top: 1px solid var(--line);
  background: #0e1117;
  padding: 6px 10px 8px;
}
#info h3, #bases h3, #roster h3 {
  margin: 0;
  padding: 8px 12px 4px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-weight: 500;
}
#roster h3 span, #bases h3 span { color: var(--ivory); letter-spacing: 0; }

.dossier, .card { padding: 12px 14px 14px; }
.eyebrow {
  margin: 0;
  color: var(--brass);
  font-size: 11px;
  letter-spacing: 0.18em;
}
.card.foe .eyebrow { color: #ff8d86; }
.dossier h2, .card h2 {
  margin: 2px 0 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
}
.quiet { margin: 4px 0 0; color: var(--muted); }
.card header { display: flex; gap: 10px; align-items: flex-start; }
.card header p { margin: 0; color: var(--muted); font-size: 12px; }
.card-top { display: flex; gap: 8px; align-items: flex-start; }
.card-photo {
  flex: 0 0 64px;
  width: 64px;
  height: 96px;
  background-color: #111;
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  border: 1px solid rgba(224, 180, 90, 0.35);
}
.card-id { flex: 1 1 auto; min-width: 0; }
.card-id .eyebrow { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-id h2 { white-space: nowrap; }
.chip {
  min-width: 36px;
  text-align: center;
  padding: 4px 6px;
  font-family: "Barlow Condensed", "Noto Sans KR", sans-serif;
  font-size: 16px;
  font-style: normal;
  letter-spacing: 0.04em;
  color: #1a1408;
  background: var(--brass);
}
.chip.grade-UR { background: #d5c4ff; }
.chip.grade-HR { background: #e15b55; color: white; }
.chip.grade-R { background: #6cb2ef; color: #082033; }
.chip.grade-N { background: #b7b7b7; }
.chip.grade-foe { background: var(--blood); color: white; font-family: "Noto Sans KR", sans-serif; font-size: 12px; padding-top: 6px; }
.costline { margin-left: auto; color: var(--brass); font-size: 12px; letter-spacing: 0.06em; }
.meters { margin-top: 10px; }
.meters label { font-variant-numeric: tabular-nums; }
.meters label { display: flex; gap: 6px; font-size: 11px; color: var(--muted); margin-top: 6px; }
.meters b { color: var(--ivory); font-weight: 700; }
.bar { height: 7px; background: #2a303b; margin-top: 3px; }
.bar i { display: block; height: 100%; background: var(--brass); }
.card.foe .bar i { background: var(--blood); }
.bar.mp i { background: #3d8fd4; }
.stats, .where { margin: 8px 0 0; font-size: 12px; color: #d9d1c3; line-height: 1.45; }
.attacks { display: grid; gap: 6px; margin-top: 10px; }
.atk {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: var(--panel-2);
  color: var(--ivory);
  border: 1px solid var(--line);
  padding: 7px 8px;
}
.atk b { font-size: 14px; }
.atk small { color: var(--muted); font-size: 11px; }
.atk.armed { border-color: var(--blood); background: #3a1c20; }
.atk.broke, .atk:disabled { opacity: 0.4; }
.atk.readonly { cursor: default; }
.wait { width: 100%; margin-top: 8px; }

#bases .base, #roster .who {
  display: grid;
  align-items: center;
  width: calc(100% - 16px);
  margin: 2px 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ivory);
  text-align: left;
}
#bases .base {
  grid-template-columns: 22px 1fr auto;
  gap: 8px;
  padding: 4px 6px;
}
#bases .base i {
  font-style: normal;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  text-align: center;
}
.tier-S, #bases .tier-S { color: #f2d48a; }
.tier-A, #bases .tier-A { color: #d5dde8; }
.tier-B, #bases .tier-B { color: #e0a36a; }
#bases .base em { font-style: normal; color: var(--muted); font-size: 12px; }
#bases .base.own-player em { color: var(--brass); }
#bases .base:hover, #roster .who:hover:not(:disabled) { background: #222836; }
#roster .who {
  grid-template-columns: 28px 1fr auto auto;
  gap: 6px;
  padding: 5px 6px;
}
#roster .who i {
  font-style: normal;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 13px;
}
#roster .who.grade-UR i { color: #d5c4ff; }
#roster .who.grade-HR i { color: #e15b55; }
#roster .who.grade-R i { color: #6cb2ef; }
#roster .who.grade-N i { color: #b7b7b7; }
#roster .who b { font-weight: 500; font-size: 13px; }
#roster .who span { color: var(--muted); font-size: 11px; }
#roster .who em { font-style: normal; color: var(--brass); font-size: 13px; }
#roster .who.on { border-color: var(--brass); background: #2a2418; }
#roster .who:disabled { opacity: 0.42; }
#roster .who.poor em { color: var(--blood); }
.grade-label {
  margin: 8px 12px 2px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.14em;
}
.empty { margin: 8px 12px; color: var(--muted); font-size: 12px; }

#log p { margin: 0 0 3px; font-size: 12px; color: #b7b0a4; line-height: 1.4; overflow-wrap: anywhere; }
#log p.fresh { color: var(--ivory); }

.hex { stroke: #12151c; stroke-width: 2; }

.hex-fill { stroke: none; pointer-events: none; }
.hex-tile { pointer-events: none; }
.hex.has-tile { fill: none; stroke: none; }
.hex.has-tile.home { stroke: #f0d48a; stroke-width: 2.2; }
.hex.has-tile.hover, .hex.has-tile.focus, .hex.has-tile.sel { stroke: #fff; stroke-width: 2.4; }

.hex.home { stroke: #f0d48a; stroke-width: 2.2; }
.hex.hover, .hex.focus, .hex.sel { stroke: #fff; stroke-width: 2.4; }
.t-plain { fill: #5d6b86; }
.t-shallow { fill: #3a8ec0; }
.t-deep { fill: #165a96; }
.t-forest { fill: #2f7a52; }
.t-ruin { fill: #7a7368; }
.t-hospital { fill: #d7d0c4; }
.t-rad { fill: #6b8a3a; }
.t-fire { fill: #c45a24; }
.t-bridge { fill: #8a7a5c; }
.t-city { fill: #c4a15a; }
.t-fort { fill: #8a6234; }
.wash { stroke: none; pointer-events: none; }
.wash.own-player { fill: rgba(224, 180, 90, 0.2); }
.wash.own-enemy { fill: rgba(180, 36, 36, 0.14); }
.mark { stroke: none; pointer-events: none; }
.mark.move { fill: rgba(47, 190, 164, 0.38); }
.mark.attack { fill: rgba(226, 61, 61, 0.4); }
.mark.attack.pulse {
  animation: hex-pulse 1.05s ease-in-out infinite;
}
@keyframes hex-pulse {
  0%, 100% { fill: rgba(226, 61, 61, 0.32); }
  50% { fill: rgba(255, 211, 106, 0.55); }
}
.token.in-range .glow-ring {
  fill: none;
  stroke: #ffd56a;
  stroke-width: 2.2;
  animation: foe-pulse 1.05s ease-in-out infinite;
}
@keyframes foe-pulse {
  0%, 100% { opacity: 0.45; stroke-width: 1.8; }
  50% { opacity: 1; stroke-width: 3.2; }
}
.mark.chase {
  fill: rgba(232, 120, 40, 0.34);
  stroke: rgba(226, 61, 61, 0.95);
  stroke-width: 2.1;
  stroke-dasharray: 5 3.5;
}
.mark.deploy { fill: rgba(224, 180, 90, 0.42); }
#game.animating { cursor: wait; pointer-events: none; }
.deco { stroke: rgba(255, 255, 255, 0.28); stroke-width: 1.4; fill: none; pointer-events: none; }
.tree { fill: rgba(8, 40, 24, 0.45); pointer-events: none; }
.win { fill: rgba(255, 214, 120, 0.55); pointer-events: none; }
.wave { stroke: rgba(214, 236, 255, 0.55); stroke-width: 1.3; fill: none; pointer-events: none; }
.peak { fill: rgba(48, 30, 12, 0.35); pointer-events: none; }
.flame { fill: rgba(255, 140, 40, 0.7); pointer-events: none; }
.rad-mark { fill: none; stroke: rgba(210, 255, 80, 0.7); stroke-width: 1.6; pointer-events: none; }
.special-flash { fill: rgba(226, 61, 61, 0.45); stroke: #e23d3d; pointer-events: none; }
.special-flash.fail { fill: rgba(180, 180, 180, 0.3); stroke: #aaa; }
.tier, .prog, .maplabel, .uname, .badge, .badge-label { pointer-events: none; text-anchor: middle; }
.tier { font-family: "Barlow Condensed", sans-serif; font-size: 13px; font-weight: 700; }
.tier-S { fill: #ffe7a3; }
.tier-A { fill: #f4f7fb; }
.tier-B { fill: #ffd0a4; }
.prog { fill: #fff; font-size: 10px; font-family: "Noto Sans KR", sans-serif; }
.maplabel {
  fill: rgba(232, 244, 255, 0.8);
  font-size: 11px;
  font-family: "Noto Sans KR", sans-serif;
  letter-spacing: 0.08em;
}
.token.done {
  opacity: 0.78;
  filter: grayscale(0.22) brightness(0.92);
}
.token.done.selected { filter: grayscale(0.1) brightness(0.97); opacity: 0.86; }
.token-base { pointer-events: none; stroke-width: 1.5; }
.token.mine .token-base { fill: rgba(59, 140, 255, 0.5); stroke: #3b8cff; }
.token.foe .token-base { fill: rgba(226, 61, 61, 0.5); stroke: #e23d3d; }
.token .portrait-fill { fill: #161a22; }
.token .glyph {
  fill: #f6f1e6;
  font-size: 16px;
  font-weight: 700;
  text-anchor: middle;
  font-family: "Noto Sans KR", "Noto Sans CJK KR", "WenQuanYi Micro Hei", sans-serif;
  pointer-events: none;
}
.token .facing { pointer-events: none; }
.token.mine .facing { fill: #3b8cff; }
.token.foe .facing { fill: #e23d3d; }
.token .crown { fill: #f0d48a; stroke: #1a1408; stroke-width: 0.7; pointer-events: none; }
.token .select-ring { pointer-events: none; }
.uname {
  fill: #f6f1e6;
  font-size: 10px;
  font-family: "Noto Sans KR", "Noto Sans CJK KR", "WenQuanYi Micro Hei", sans-serif;
}
.badge {
  font-size: 10px;
  font-weight: 700;
  font-family: "Barlow Condensed", "Noto Sans KR", sans-serif;
}
.nameplate { fill: rgba(10, 12, 16, 0.82); pointer-events: none; }
.token.mine .nameplate { stroke: #3b8cff; stroke-width: 1; }
.token.foe .nameplate { stroke: #e23d3d; stroke-width: 1; }
.token .hptrack { fill: rgba(8, 10, 14, 0.85); pointer-events: none; }
.token-badge { pointer-events: none; }
.token-badge .badge-plate {
  fill: rgba(10, 12, 16, 0.88);
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 0.6;
}
.token-badge .badge-label {
  fill: #f6f1e6;
  font-size: 8px;
  font-weight: 700;
  font-family: "Barlow Condensed", "Noto Sans KR", "Noto Sans CJK KR", sans-serif;
}
.badge-grade .badge-label { font-family: "Barlow Condensed", sans-serif; letter-spacing: 0.04em; }
.badge-grade-N .badge-plate { fill: #4a5160; }
.badge-grade-R .badge-plate { fill: #2f6db8; }
.badge-grade-HR .badge-plate { fill: #2a8a4a; }
.badge-grade-SR .badge-plate { fill: #b8861a; }
.badge-grade-UR .badge-plate { fill: #c45a12; }
.badge-grade-MR .badge-plate { fill: #8a2eb8; }
.badge-grade-LR .badge-plate { fill: #c9a227; }
.badge-elem-fire .badge-plate { fill: #c4451a; }
.badge-elem-water .badge-plate { fill: #1d6fb8; }
.badge-elem-wind .badge-plate { fill: #1e8a58; }
.badge-atk .badge-label { font-size: 8px; }
.badge-atk-melee .badge-plate { fill: #6a3a28; }
.badge-atk-ranged .badge-plate { fill: #2a4e72; }
.badge-atk-special .badge-plate { fill: #6b2a6e; }
.token.hit-flash { filter: brightness(2.8) saturate(0.2); }
.token.tok-down { opacity: 0; transition: opacity 0.2s ease; }
#map-fx { pointer-events: none; }
#map-fx .map-slash {
  stroke: #fff8e8;
  stroke-width: 3.2;
  stroke-linecap: round;
  fill: none;
  filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 6px rgba(255, 210, 120, 0.8));
  animation: map-slash 0.28s ease-out forwards;
}
@keyframes map-slash {
  0% { stroke-dasharray: 80; stroke-dashoffset: 80; opacity: 1; }
  55% { stroke-dasharray: 80; stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dasharray: 80; stroke-dashoffset: 0; opacity: 0; }
}
#map-fx .map-shot {
  fill: #fff;
  stroke: #8ec8ff;
  stroke-width: 1.6;
  filter: drop-shadow(0 0 3px #8ec8ff);
}
#map-fx .map-dmg {
  font-family: "Barlow Condensed", "Black Han Sans", "Noto Sans KR", sans-serif;
  font-size: 15px;
  font-weight: 700;
  fill: #f6f1e6;
  stroke: #000;
  stroke-width: 0.8;
  paint-order: stroke;
  text-anchor: middle;
  pointer-events: none;
  opacity: 0;
}
#map-fx .map-dmg.go { animation: map-dmg-pop 0.6s ease forwards; }
#map-fx .map-dmg.res-crit { font-size: 18px; fill: #ffd36a; }
#map-fx .map-dmg.res-dodge { font-size: 13px; fill: #9b9488; }
#map-fx .map-dmg.res-block { font-size: 13px; fill: #9ec6ff; }
@keyframes map-dmg-pop {
  0% { opacity: 0; transform: translateY(6px) scale(0.8); }
  30% { opacity: 1; transform: translateY(-4px) scale(1.08); }
  100% { opacity: 0; transform: translateY(-22px) scale(1); }
}
.hpbit { pointer-events: none; }

#overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(5, 6, 8, 0.72);
}
.overlay-card {
  width: min(440px, calc(100% - 32px));
  padding: 28px 28px 22px;
  background: #141820;
  border: 1px solid var(--brass-2);
  box-shadow: var(--shadow);
  text-align: center;
}
#ov-kicker { margin: 0; letter-spacing: 0.28em; color: var(--brass); font-size: 12px; }
#ov-title {
  margin: 8px 0 0;
  font-family: "Black Han Sans", "Noto Sans KR", sans-serif;
  font-size: 36px;
  font-weight: 400;
}
#ov-sub { margin: 8px 0 18px; color: var(--muted); }
.ov-actions { display: flex; justify-content: center; gap: 10px; }

#side::-webkit-scrollbar, #roster::-webkit-scrollbar, #info::-webkit-scrollbar, #log::-webkit-scrollbar { width: 8px; }
#side::-webkit-scrollbar-thumb, #roster::-webkit-scrollbar-thumb, #info::-webkit-scrollbar-thumb, #log::-webkit-scrollbar-thumb {
  background: #343846;
}


.hex.fog-hidden { fill: #05060a !important; stroke: #07080c; }
.hex.fog-memory { }
.fog-veil { fill: rgba(5, 6, 10, 0.58); stroke: none; pointer-events: none; }

#minimap-box {
  position: absolute;
  right: 12px;
  bottom: 34px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  pointer-events: auto;
}
#minimap {
  display: block;
  width: 200px;
  height: 150px;
  background: #05060a;
  border: 1px solid rgba(224, 180, 90, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  touch-action: none;
}
#recenter {
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(8, 10, 14, 0.86);
  color: var(--brass);
  border: 1px solid rgba(224, 180, 90, 0.45);
}
#recenter:hover { background: #2a2418; color: #f0cb7a; }

@media (max-width: 980px) {
  body { overflow: hidden; }
  #game, #battle, #overlay { max-width: none; width: 100%; height: 100%; margin: 0; }
  #game { height: 100%; }
  #layout { height: 100%; }
  #map-wrap { height: 100%; }
  #minimap { width: 108px; height: 80px; }
  #minimap-box { right: 6px; bottom: 8px; gap: 4px; }
  #dock { left: 8px; bottom: 6px; max-width: calc(100% - 130px); }
  h1 { font-size: 40px; }
  .brand { font-size: 92px; }
  #top {
    flex-wrap: nowrap;
    gap: 8px;
    padding: 6px 8px;
  }
  .brandblock { min-width: 0; }
  .brandblock em { display: none; }
  .vr { font-size: 24px; }
  .brandblock strong { font-size: 13px; }
  .stageblock { min-width: 0; }
  .stageblock b, .turnblock b, .moneyblock b { font-size: 18px; }
  .stageblock span { display: none; }
  #end { padding: 6px 10px; font-size: 12px; flex-shrink: 0; white-space: nowrap; }
  #menu-btn, #idle-btn { padding: 6px 8px; font-size: 12px; }

  .stageblock b, .turnblock b, .moneyblock b { white-space: nowrap; }
  #key { max-width: 58%; padding: 4px 6px; gap: 4px 6px; }
  #key span { font-size: 10px; }
  #info.floating.sheet {
    width: auto;
    max-width: none;
    max-height: 36vh;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 13;
  }
  #info.floating.sheet .card { padding: 6px 8px; }
  #info.floating.sheet .card-extra,
  #info.floating.sheet .eyebrow,
  #info.floating.sheet .costline { display: none; }
  #info.floating.sheet h2 { font-size: 15px; }
  #info.floating.sheet .card-photo { flex-basis: 44px; width: 44px; height: 66px; }
  #info.floating.sheet header { gap: 6px; }
  #info.floating.sheet header p { font-size: 10px; }
  #info.floating.sheet .chip { font-size: 12px; min-width: 26px; padding: 2px 4px; }
  #info.floating.sheet .meters { margin-top: 4px; }
  #info.floating.sheet .meters label { font-variant-numeric: tabular-nums; }
.meters label { margin-top: 2px; font-size: 10px; }
  #info.floating.sheet .card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 8px;
  }
  #info.floating.sheet header,
  #info.floating.sheet .meters { grid-column: 1 / -1; }
  #info.floating.sheet .attacks {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
    grid-column: 1;
  }
  #info.floating.sheet .atk { flex: 1 1 28%; padding: 5px 6px; }
  #info.floating.sheet .atk b { font-size: 12px; }
  #info.floating.sheet .atk small { display: none; }
  #info.floating.sheet .wait {
    width: auto;
    grid-column: 2;
    margin-top: 2px;
    padding: 6px 12px;
    font-size: 12px;
    align-self: stretch;
  }
  .icon-btn, #recenter { width: 24px; height: 24px; }
  .hq-menu.sheet-dock {
    display: flex;
    flex-direction: row;
    min-width: 0;
    width: auto;
    padding: 2px;
    z-index: 13;
  }
  .hq-menu.sheet-dock button {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    font-size: 12px;
    white-space: nowrap;
  }
}


@media (max-width: 400px) {
  .brandblock strong { display: none; }
  #income { display: none; }
  .stageblock b, .turnblock b, .moneyblock b { font-size: 16px; }
  .brandblock, .stageblock, .turnblock, .moneyblock, #end { flex-shrink: 0; white-space: nowrap; }
  #end { padding: 6px 8px; }
}

@media (max-width: 980px) and (orientation: landscape) {
  #top { padding: 3px 8px; }
  .brandblock { display: none; }
  .turnblock b, .moneyblock b, .stageblock b { font-size: 16px; }
  #info.floating.sheet { max-height: none; }
  #info.floating.sheet .card {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
  }
  #info.floating.sheet header { flex: 0 0 auto; }
  #info.floating.sheet header p { display: none; }
  #info.floating.sheet .meters { flex: 1 1 140px; margin-top: 0; min-width: 110px; }
  #info.floating.sheet .attacks { flex: 1 1 auto; margin-top: 0; flex-wrap: nowrap; }
  #info.floating.sheet .wait { margin-top: 0; padding: 6px 10px; }
  #minimap { width: 96px; height: 70px; }
  #minimap-box { right: 6px; }
  .hq-menu.sheet-dock button { padding: 6px 4px; font-size: 11px; }
}

.icon-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(8, 10, 14, 0.86);
  color: var(--brass);
  border: 1px solid rgba(224, 180, 90, 0.45);
}
.icon-btn:hover { background: #2a2418; color: #f0cb7a; }
.icon-btn.off { color: #8d877c; border-color: #3a3f4a; }
.icon-btn.off svg { opacity: 0.55; }
.icon-btn.off::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 1.6px;
  background: #e23d3d;
  transform: rotate(-42deg);
  pointer-events: none;
}
#battle-toggle, #battle-toggle-scene, .icon-btn { position: relative; }

#battle {
  position: fixed;
  inset: 0;
  z-index: 35;
  overflow: hidden;
  background: #05060a;
  cursor: pointer;
}
#battle.entering .battle-field,
#battle.entering .battle-bg { animation: battle-in 0.28s ease both; }
#battle.entering .battle-actor.side-left { animation: cutin-slide-left 0.4s ease both; }
#battle.entering .battle-actor.side-right { animation: cutin-slide-right 0.4s ease both; }
#battle.leaving { pointer-events: none; }
#battle.leaving .battle-field,
#battle.leaving .battle-bg { animation: battle-out 0.18s ease both; }

.battle-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, #1a2230 0%, #0c1016 70%);
}
.battle-bg.terrain-road {
  background:
    linear-gradient(180deg, #2a3344 0%, #171d28 42%, #0e1218 100%);
}
.battle-bg.terrain-road::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 62%;
  height: 18%;
  background:
    repeating-linear-gradient(90deg, transparent 0 36px, rgba(244, 239, 228, 0.28) 36px 52px),
    linear-gradient(180deg, #3a4658, #2a3344);
  clip-path: polygon(4% 0, 96% 0, 100% 100%, 0 100%);
  opacity: 0.85;
}
.battle-bg.terrain-alley {
  background:
    linear-gradient(90deg, #120e0c 0%, #2a2018 22%, #3a2a22 50%, #2a2018 78%, #120e0c 100%);
}
.battle-bg.terrain-alley::before,
.battle-bg.terrain-alley::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 22%;
  background: linear-gradient(180deg, #1a1410, #0a0807);
  opacity: 0.92;
}
.battle-bg.terrain-alley::before { left: 0; }
.battle-bg.terrain-alley::after { right: 0; }
.battle-bg.terrain-park {
  background:
    linear-gradient(180deg, #1a3d2e 0%, #163526 40%, #0d1c16 100%);
}
.battle-bg.terrain-park::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 38%;
  background:
    radial-gradient(circle at 18% 20%, #1d5a38 0 40px, transparent 42px),
    radial-gradient(circle at 28% 8%, #247047 0 54px, transparent 56px),
    radial-gradient(circle at 72% 16%, #1d5a38 0 48px, transparent 50px),
    radial-gradient(circle at 84% 0%, #247047 0 60px, transparent 62px),
    linear-gradient(180deg, transparent, #0e2a1c);
}
.battle-bg.terrain-building {
  background:
    linear-gradient(180deg, #2a2926 0%, #1a1916 55%, #10100e 100%);
}
.battle-bg.terrain-building::before {
  content: "";
  position: absolute;
  inset: 8% 10% 30%;
  background:
    repeating-linear-gradient(90deg, transparent 0 28px, rgba(255, 214, 120, 0.22) 28px 40px, transparent 40px 70px),
    repeating-linear-gradient(180deg, transparent 0 18px, rgba(255, 214, 120, 0.12) 18px 32px, transparent 32px 58px);
  opacity: 0.7;
}
.battle-bg.terrain-river {
  background:
    linear-gradient(180deg, #14324a 0%, #0d3a5c 36%, #0a1c30 100%);
}
.battle-bg.terrain-river::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 48%;
  height: 40%;
  background:
    repeating-linear-gradient(180deg, transparent 0 16px, rgba(214, 236, 255, 0.16) 16px 18px);
  animation: river-shift 6s linear infinite;
}
.battle-bg.terrain-hill,
.battle-bg.terrain-mountain {
  background:
    linear-gradient(180deg, #4a3420 0%, #2c1e12 48%, #16100a 100%);
}
.battle-bg.terrain-hill::before,
.battle-bg.terrain-mountain::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 58%;
  background:
    linear-gradient(200deg, transparent 30%, #3a2816 30% 54%, transparent 54%),
    linear-gradient(160deg, transparent 36%, #2a1c10 36% 70%, transparent 70%);
  opacity: 0.9;
}

.battle-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(70% 60% at 50% 46%, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
  z-index: 2;
}
.battle-shake {
  position: absolute;
  inset: 0;
  z-index: 3;
}
#battle.screen-shake .battle-shake {
  animation: screen-shake 0.45s ease-in-out;
}
#battle.crit-zoom .battle-stage {
  animation: crit-zoom 0.45s ease-out;
}
#battle.special-flash::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 6;
  background: radial-gradient(circle at 50% 50%, rgba(224, 180, 90, 0.35), transparent 55%);
  animation: flash-fade 0.5s ease-out both;
  pointer-events: none;
}

.battle-field {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  z-index: 4;
}
.battle-hud-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 22px 0;
  pointer-events: none;
}
.battle-hud {
  width: min(420px, 46vw);
  background: rgba(8, 10, 14, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px 12px;
}
.battle-hud.hud-enemy { text-align: right; }
.hud-name { display: flex; flex-direction: column; gap: 2px; }
.hud-enemy .hud-name { align-items: flex-end; }
.hud-name em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--brass);
}
.hud-enemy .hud-name em { color: #ff8d86; }
.hud-name b { font-size: 20px; letter-spacing: 0.02em; }
.hud-meters { margin-top: 8px; }
.hud-row { display: grid; grid-template-columns: 24px 1fr 42px; align-items: center; gap: 8px; margin-top: 5px; }
.hud-row span { font-size: 10px; color: var(--muted); }
.hud-row b { font-size: 12px; font-family: "Barlow Condensed", "Noto Sans KR", sans-serif; }
.battle-hud .bar { height: 8px; background: #2a303b; margin-top: 0; }
.battle-hud .bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--brass);
  transform-origin: left center;
  transition: width 0.45s ease;
}
.battle-hud.hud-enemy .bar i { background: var(--blood); }
.battle-hud .bar.mp i { background: #3d8fd4; }

.battle-stage {
  /* Face-off: pair stays centered.
     0.5 * --actor-w looks wider than a half-body because SD art and the
     silhouette placeholder do not fill the actor box. A small standoff plus
     a lunge that covers that standoff plus ~0.28 box width makes the visible
     gap ~0.5 of the drawn body, and the strike overlaps slightly. */
  --actor-w: min(280px, 34vw);
  --standoff: clamp(8px, 0.08 * var(--actor-w), 24px);
  --lunge: calc(var(--standoff) + 0.28 * var(--actor-w));
  position: relative;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--standoff);
  padding: 0 4% 88px;
}
.battle-actor {
  position: relative;
  width: var(--actor-w);
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: 50% 90%;
  transition: transform 0.28s ease;
}
.battle-actor.side-left { align-items: flex-start; }
.battle-actor.side-right { align-items: flex-end; }
.actor-stage { position: relative; width: 100%; }
.actor-art { position: relative; width: 100%; height: min(58vh, 520px); display: grid; place-items: end center; }
.actor-sprite {
  display: none;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center bottom;
  align-self: end;
  image-rendering: auto;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.55));
}
.actor-sprite.on { display: block; }
.actor-sprite.chibi {
  width: min(340px, 118%);
  max-height: 88%;
  height: auto;
}
.actor-sprite.illust {
  height: 100%;
  width: auto;
  max-width: 118%;
  max-height: 100%;
  object-fit: contain;
  object-position: center bottom;
}
.battle-actor.illust-art { width: min(320px, 38vw); }
.battle-actor.illust-art .actor-meta { display: none; }
.battle-stage:has(.illust-art) {
  --actor-w: min(320px, 38vw);
  --standoff: clamp(12px, 0.12 * var(--actor-w), 36px);
}
/* 도트는 128 그리드의 정수배로만 키워서 픽셀이 들쭉날쭉하지 않게 한다. */
.battle-actor.pixel-art {
  --pixel-size: max(128px, round(down, min(var(--actor-w), min(58vh, 520px)), 128px));
}
.actor-sprite.pixel {
  image-rendering: pixelated;
  image-rendering: -webkit-optimize-contrast;
  width: var(--pixel-size, 256px);
  height: var(--pixel-size, 256px);
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(2px 4px 0 rgba(0, 0, 0, 0.55));
}
/* flipFoe 가 켜지고 .flip-art 가 붙은 때만 좌우 반전한다. 기본은 그림 그대로. */
.battle-actor.flip-art .actor-sprite { transform: scaleX(-1); }
/* 512x512 전투 컷의 발 기준선을 .actor-art 하단(지면)에 맞춘다. SD=484, 도트=480. */
.actor-art:has(.actor-sprite.baseline-484.on) {
  padding-bottom: calc((512 - 484) / 512 * min(340px, 118%));
}
.actor-sprite.baseline-484 {
  transform: translateY(calc((512 - 484) / 512 * 100%));
}
.battle-actor.flip-art .actor-sprite.baseline-484 {
  transform: scaleX(-1) translateY(calc((512 - 484) / 512 * 100%));
}
.actor-art:has(.actor-sprite.baseline-480.on) {
  padding-bottom: calc((512 - 480) / 512 * var(--pixel-size, 256px));
}
.actor-sprite.baseline-480 {
  transform: translateY(calc((512 - 480) / 512 * 100%));
}
.battle-actor.flip-art .actor-sprite.baseline-480 {
  transform: scaleX(-1) translateY(calc((512 - 480) / 512 * 100%));
}
.actor-ph {
  position: relative;
  width: min(220px, 100%);
  height: min(52vh, 480px);
  display: grid;
  place-items: end center;
}
.actor-sil {
  width: 100%;
  height: 100%;
  fill: var(--team);
  opacity: 0.88;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.55));
}
.battle-actor.side-player .actor-sil { stroke: #3b8cff; stroke-width: 3; }
.battle-actor.side-enemy .actor-sil { stroke: #e23d3d; stroke-width: 3; }
.actor-face {
  position: absolute;
  left: 50%;
  top: 11%;
  width: 28%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #161a22;
  border: 3px solid var(--team);
  color: #f6f1e6;
  font-weight: 700;
  font-size: 22px;
  transform: translateX(-50%);
  overflow: hidden;
  background-size: cover;
  background-position: center;
}
.actor-face.photo span { display: none; }
.battle-actor.flip-art .actor-face.photo { transform: translateX(-50%) scaleX(-1); }
.actor-meta {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(8, 10, 14, 0.8);
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.battle-actor.side-right .actor-meta { flex-direction: row-reverse; }
.actor-meta b { font-size: 16px; }
.actor-tags {
  min-height: 22px;
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}
.fx-tag {
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  background: rgba(8, 10, 14, 0.86);
  border: 1px solid var(--brass);
  color: var(--brass);
}
.fx-tag.tag-cover { border-color: #6cb2ef; color: #6cb2ef; }
.fx-tag.tag-high { border-color: #e0b45a; color: #e0b45a; }
.fx-tag.tag-frail { border-color: #e23d3d; color: #ff8d86; }

.battle-actor.windup { transition-duration: 0.16s; transition-timing-function: ease-in; }
.battle-actor.side-left.windup { transform: translateX(calc(-0.16 * var(--actor-w))); }
.battle-actor.side-right.windup { transform: translateX(calc(0.16 * var(--actor-w))); }
.battle-actor.has-windup-art.windup { transform: none; }
.battle-actor.lunge { transition-duration: 0.18s; transition-timing-function: cubic-bezier(0.15, 0.9, 0.3, 1); }
.battle-actor.side-left.lunge { transform: translateX(var(--lunge)) scale(1.04); }
.battle-actor.side-right.lunge { transform: translateX(calc(-1 * var(--lunge))) scale(1.04); }
.battle-actor.pixel-art.side-left.lunge { transform: translateX(round(var(--lunge), 1px)); }
.battle-actor.pixel-art.side-right.lunge { transform: translateX(calc(-1 * round(var(--lunge), 1px))); }
.battle-actor.special .actor-art { filter: drop-shadow(0 0 18px rgba(224, 180, 90, 0.7)); }
.battle-actor.knockback { transition-duration: 0.16s; transition-timing-function: cubic-bezier(0.2, 0.7, 0.3, 1); }
.battle-actor.side-left.knockback { transform: translateX(calc(-0.2 * var(--actor-w))); }
.battle-actor.side-right.knockback { transform: translateX(calc(0.2 * var(--actor-w))); }
.battle-actor.side-left.knockback-sm { transform: translateX(calc(-0.08 * var(--actor-w))); }
.battle-actor.side-right.knockback-sm { transform: translateX(calc(0.08 * var(--actor-w))); }
.battle-actor.pose-hit .actor-art,
.battle-actor.pose-crit .actor-art { animation: hit-flash 0.28s ease; }
.battle-actor.side-left.pose-dodge { transform: translate(calc(-0.22 * var(--actor-w)), -8px); }
.battle-actor.side-right.pose-dodge { transform: translate(calc(0.22 * var(--actor-w)), -8px); }
.battle-actor.pose-block .actor-art { filter: drop-shadow(0 0 16px rgba(180, 210, 255, 0.85)); }
.battle-actor.down {
  transform: translateY(40px);
  opacity: 0;
  filter: brightness(2.2);
  transition: transform 0.55s ease, opacity 0.45s ease 0.05s, filter 0.2s ease;
}
.battle-actor.side-right.down { transform: translateY(40px); }
.battle-actor.down.has-down-art,
.battle-actor.side-right.down.has-down-art {
  transform: none;
  opacity: 1;
  filter: none;
  transition: none;
}

.battle-stage > .afterimage {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  opacity: 0.42;
  filter: brightness(1.45) saturate(0.55);
  animation: afterimage-fade 0.38s ease-out forwards;
}
.fx-slash {
  position: absolute;
  left: 50%;
  top: 62%;
  width: min(240px, 36vw);
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, #fff 18%, #f3e2a4 52%, #fff 78%, transparent);
  box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.8), 0 0 18px rgba(224, 180, 90, 0.7);
  z-index: 8;
  pointer-events: none;
  transform-origin: left center;
  animation: slash-sweep 0.28s ease-out forwards;
}
.fx-slash.from-left { margin-left: -8%; }
.fx-slash.from-right {
  transform-origin: right center;
  margin-left: 8%;
  animation-name: slash-sweep-rev;
}
.fx-slash.special {
  height: 10px;
  width: min(320px, 48vw);
  box-shadow: 0 0 16px 4px rgba(255, 240, 180, 0.95), 0 0 36px rgba(226, 61, 61, 0.55);
}
.fx-slash.slash-x { top: 50%; animation-name: slash-sweep-x; }
.fx-slash.from-right.slash-x { animation-name: slash-sweep-x-rev; }
.fx-shot {
  position: absolute;
  top: 62%;
  width: 22px;
  height: 8px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 0 10px 4px rgba(140, 210, 255, 0.95), 0 0 22px rgba(80, 160, 255, 0.7);
  z-index: 8;
  pointer-events: none;
}
.fx-shot.from-left { left: 38%; animation: shot-fly 0.26s linear forwards; }
.fx-shot.from-right { right: 38%; animation: shot-fly-rev 0.26s linear forwards; }
.fx-shield {
  position: absolute;
  inset: 16% 6% 6%;
  border: 3px solid rgba(170, 215, 255, 0.95);
  border-radius: 50% 50% 42% 42%;
  box-shadow: 0 0 22px rgba(120, 180, 255, 0.8), inset 0 0 18px rgba(180, 220, 255, 0.4);
  background: radial-gradient(circle at 50% 40%, rgba(200, 230, 255, 0.28), transparent 65%);
  pointer-events: none;
  z-index: 6;
  animation: shield-pop 0.5s ease-out forwards;
}
#battle.hitstop .battle-actor,
#battle.hitstop .battle-fx,
#battle.hitstop .fx-slash,
#battle.hitstop .fx-shot,
#battle.hitstop .afterimage {
  animation-play-state: paused !important;
}
#battle.screen-shake-hard .battle-shake {
  animation: screen-shake-hard 0.42s ease;
}

.battle-banner {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  z-index: 7;
  min-width: 180px;
}
.battle-skill {
  display: block;
  font-family: "Black Han Sans", "Noto Sans KR", sans-serif;
  font-size: 36px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 12px #000;
}
.battle-result {
  display: block;
  margin-top: 6px;
  font-style: normal;
  letter-spacing: 0.2em;
  color: var(--brass);
  font-size: 16px;
  text-shadow: 0 2px 8px #000;
}
#battle.is-counter .battle-result { color: #ff8d86; }

.battle-line {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 12px;
  z-index: 8;
  display: flex;
  align-items: baseline;
  gap: 14px;
  background: rgba(8, 10, 14, 0.86);
  border-top: 2px solid var(--brass);
  border-bottom: 1px solid rgba(224, 180, 90, 0.35);
  padding: 10px 20px 12px;
  pointer-events: none;
}
.battle-line[hidden] { display: none !important; }
.battle-line .line-name {
  flex: 0 0 auto;
  color: var(--brass);
  font-size: 14px;
  letter-spacing: 0.08em;
}
.battle-line .line-text {
  margin: 0;
  font-size: 18px;
  color: #f6f1e6;
  text-shadow: 0 2px 8px #000;
}

.dmg-pop {
  position: absolute;
  top: 28%;
  font-family: "Barlow Condensed", "Black Han Sans", "Noto Sans KR", sans-serif;
  font-size: 44px;
  font-weight: 700;
  color: #f6f1e6;
  text-shadow: 0 2px 0 #000, 0 8px 16px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  z-index: 8;
}
.dmg-pop.pop-left { left: calc(50% - var(--actor-w) * 0.85); }
.dmg-pop.pop-right { right: calc(50% - var(--actor-w) * 0.85); }
.dmg-pop.go { animation: dmg-pop 0.7s ease forwards; }
.dmg-pop.res-crit { font-size: 62px; color: #ffd36a; }
.dmg-pop.res-dodge { font-size: 32px; color: #9b9488; letter-spacing: 0.12em; }
.dmg-pop.res-block { font-size: 34px; color: #9ec6ff; }

.battle-fx { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.fx-burst { position: absolute; inset: 0; }
.fx-burst.fx-hit::before,
.fx-burst.fx-crit::before,
.fx-burst.fx-special::before,
.fx-burst.fx-block::before,
.fx-burst.fx-dodge::before {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%) scale(0.4);
  animation: burst 0.45s ease-out forwards;
}
.fx-burst.fx-hit::before { background: radial-gradient(circle, #fff 0 20%, rgba(226, 61, 61, 0.5) 40%, transparent 70%); }
.fx-burst.fx-crit::before {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, #fff 0 14%, rgba(224, 180, 90, 0.7) 36%, transparent 70%);
}
.fx-burst.fx-special::before {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(224, 180, 90, 0.95) 0 16%, rgba(226, 61, 61, 0.4) 40%, transparent 70%);
}
.fx-burst.fx-block::before { background: radial-gradient(circle, #fff 0 16%, rgba(110, 170, 255, 0.6) 40%, transparent 70%); }
.fx-burst.fx-dodge::before { background: none; border: 2px dashed rgba(244, 239, 228, 0.6); }

.battle-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 9;
  pointer-events: auto;
}

@keyframes battle-in {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: none; }
}
@keyframes battle-out {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes screen-shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-10px, 4px); }
  40% { transform: translate(8px, -6px); }
  60% { transform: translate(-6px, -3px); }
  80% { transform: translate(7px, 5px); }
}
@keyframes screen-shake-hard {
  0%, 100% { transform: translate(0, 0); }
  12% { transform: translate(-16px, 7px); }
  28% { transform: translate(15px, -9px); }
  44% { transform: translate(-12px, -5px); }
  60% { transform: translate(13px, 8px); }
  76% { transform: translate(-8px, 3px); }
}
@keyframes hit-flash {
  0% { filter: brightness(3.4) saturate(0.15) contrast(1.25); }
  45% { filter: brightness(2.2) saturate(0.5); }
  100% { filter: none; }
}
@keyframes afterimage-fade {
  from { opacity: 0.45; }
  to { opacity: 0; }
}
@keyframes slash-sweep {
  0% { transform: translate(-20%, -50%) rotate(-28deg) scaleX(0.15); opacity: 1; }
  55% { transform: translate(-10%, -50%) rotate(-28deg) scaleX(1); opacity: 1; }
  100% { transform: translate(18%, -50%) rotate(-28deg) scaleX(1.05); opacity: 0; }
}
@keyframes slash-sweep-rev {
  0% { transform: translate(20%, -50%) rotate(28deg) scaleX(0.15); opacity: 1; }
  55% { transform: translate(10%, -50%) rotate(28deg) scaleX(1); opacity: 1; }
  100% { transform: translate(-18%, -50%) rotate(28deg) scaleX(1.05); opacity: 0; }
}
@keyframes slash-sweep-x {
  0% { transform: translate(-20%, -50%) rotate(32deg) scaleX(0.15); opacity: 1; }
  55% { transform: translate(-10%, -50%) rotate(32deg) scaleX(1); opacity: 1; }
  100% { transform: translate(18%, -50%) rotate(32deg) scaleX(1.05); opacity: 0; }
}
@keyframes slash-sweep-x-rev {
  0% { transform: translate(20%, -50%) rotate(-32deg) scaleX(0.15); opacity: 1; }
  55% { transform: translate(10%, -50%) rotate(-32deg) scaleX(1); opacity: 1; }
  100% { transform: translate(-18%, -50%) rotate(-32deg) scaleX(1.05); opacity: 0; }
}
@keyframes shot-fly {
  0% { transform: translateX(0) scaleX(1); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateX(min(220px, 28vw)) scaleX(1.4); opacity: 0; }
}
@keyframes shot-fly-rev {
  0% { transform: translateX(0) scaleX(1); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateX(calc(-1 * min(220px, 28vw))) scaleX(1.4); opacity: 0; }
}
@keyframes shield-pop {
  0% { transform: scale(0.7); opacity: 0; }
  35% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}
@keyframes crit-zoom {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@keyframes hit-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-5px); }
}
@keyframes dmg-pop {
  0% { opacity: 0; transform: translateY(12px) scale(0.7); }
  30% { opacity: 1; transform: translateY(-6px) scale(1.08); }
  100% { opacity: 0; transform: translateY(-36px) scale(1); }
}
@keyframes burst {
  to { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}
@keyframes flash-fade {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes river-shift {
  from { background-position: 0 0; }
  to { background-position: 0 36px; }
}

@media (prefers-reduced-motion: reduce) {
  #battle.entering .battle-field,
  #battle.entering .battle-bg,
  #battle.leaving .battle-field,
  #battle.leaving .battle-bg,
  #battle.screen-shake .battle-shake,
  #battle.screen-shake-hard .battle-shake,
  #battle.crit-zoom .battle-stage,
  .battle-actor.pose-hit .actor-art,
  .battle-actor.pose-crit .actor-art,
  .dmg-pop.go,
  .fx-burst.fx-hit::before,
  .fx-burst.fx-crit::before,
  .fx-burst.fx-special::before,
  .fx-burst.fx-block::before,
  .fx-burst.fx-dodge::before,
  .fx-slash,
  .fx-shot,
  .fx-shield,
  .afterimage,
  .battle-bg.terrain-river::before,
  #map-fx .map-dmg.go {
    animation: none !important;
  }
  .battle-hud .bar i { transition: none; }
  .battle-actor, .battle-actor.down { transition: opacity 0.1s linear; }
}

@media (max-width: 980px) {
  .battle-hud { width: min(48vw, 100%); padding: 8px 8px 10px; }
  .hud-name b { font-size: 16px; }
  .battle-skill { font-size: 26px; }
  .dmg-pop { font-size: 32px; }
  .dmg-pop.res-crit { font-size: 44px; }
  .actor-art { height: min(48vh, 360px); }
  .battle-stage { padding: 0 max(12px, 4%) 6%; }
}

/* UI/UX 1차: 미니맵 접기, 보스 메뉴, 모집/인재풀/스킬 창 */
#minimap-box { z-index: 8; }
#minimap-box.folded #minimap { display: none; }
#minimap-fold { order: -1; }
#minimap-box { flex-direction: column; }

#hq {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
}
#hq > * { pointer-events: auto; }

.hq-menu {
  position: fixed;
  z-index: 13;
  display: flex;
  flex-direction: column;
  min-width: 108px;
  background: #1b2130;
  border: 1px solid rgba(224, 180, 90, 0.45);
  padding: 2px;
  visibility: hidden;
}
.hq-menu.anchored { visibility: visible; }
.hq-menu button { padding: 6px 8px; font-size: 13px; }
.hq-menu button, .hq-sort-btn, .hq-x, .hq-pop-act button, .hq-skill-act button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  background: transparent;
  color: #f3efe4;
  border: 0;
  font-weight: 700;
  cursor: pointer;
}
.hq-menu button { padding: 6px 8px; font-size: 13px; }
.hq-menu button:hover, .hq-sort-btn.on, .hq-sort-btn:hover { background: #2a2418; color: #f0cb7a; }

.hq-win.anchored {
  position: fixed;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  z-index: 14;
}
.atk-pop {
  position: fixed;
  z-index: 15;
  display: flex;
  flex-direction: column;
  min-width: 112px;
  background: #1b2130;
  border: 1px solid rgba(224, 180, 90, 0.45);
  padding: 2px;
  color: #f3efe4;
}
.atk-pop.hidden { display: none; }
.atk-pop button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  background: transparent;
  color: #f3efe4;
  border: 0;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
}
.atk-pop button:hover:not(:disabled) { background: #2a2418; color: #f0cb7a; }
.atk-pop button:disabled { opacity: 0.4; cursor: default; }
.atk-pop button.joint { color: #f0cb7a; }
.hq-win {
  position: absolute;
  top: 64px;
  right: 16px;
  bottom: 24px;
  width: min(420px, 92%);
  z-index: 14;
  display: flex;
  flex-direction: column;
  background: #12151c;
  border: 1px solid rgba(224, 180, 90, 0.45);
  color: #f3efe4;
  overflow: hidden;
}
.hq-win.slim { width: min(280px, 92vw); left: 16px; right: auto; top: auto; bottom: 72px; height: auto; }
.hq-win header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #2a303b;
}
.hq-win header b { font-size: 16px; }
.hq-x { width: auto; padding: 4px 8px; }
.hq-sort { display: flex; gap: 4px; padding: 8px 10px; }
.hq-sort-btn { width: auto; border: 1px solid #2a303b; }
.hq-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px;
  overflow: auto;
}
.hq-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 1px solid #2a303b;
  background: #0c0e14;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
}
.hq-tile.busy { opacity: 0.45; }
.hq-art {
  flex: 1;
  background-size: cover;
  background-position: top center;
  min-height: 70px;
}
.hq-art.ph { display: grid; place-items: center; font: 700 22px/1 "Black Han Sans", sans-serif; background: #222; }
.hq-grade {
  position: absolute;
  left: 4px;
  bottom: 4px;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 4px;
  background: rgba(0,0,0,.7);
}
.hq-cost {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #d4a017;
  color: #111;
  font-size: 11px;
  font-weight: 900;
}
.hq-cost.poor { background: #a33; color: #fff; }
.hq-evo, .hq-name, .hq-lv {
  position: absolute;
  left: 4px;
  font-size: 10px;
  text-shadow: 0 1px 2px #000;
}
.hq-evo { top: 4px; }
.hq-name { bottom: 18px; }
.hq-lv { bottom: 4px; left: auto; right: 4px; }
.hq-empty { padding: 16px; opacity: .6; }
.hq-tile.on { border-color: var(--brass); box-shadow: inset 0 0 0 1px var(--brass); }
.hq-detail {
  position: absolute;
  z-index: 6;
  width: 230px;
  max-width: calc(100% - 16px);
  flex: none;
  border: 1px solid rgba(224, 180, 90, 0.5);
  padding: 10px 12px 12px;
  background: #161a24;
  color: #f3efe4;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}
.hq-detail h3 { margin: 0 0 4px; font-size: 16px; }
.hq-detail p { margin: 3px 0; font-size: 12px; }
#skill-desc.hq-detail {
  position: relative;
  width: auto;
  max-width: none;
  margin: 8px 10px 10px;
}
.hq-fee {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 4px;
  font-weight: 700;
}
.hq-coin {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #d4a017;
  color: #111;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}
.hq-grid { min-height: 0; }

.hq-pop {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 16;
  width: min(320px, 88vw);
  background: #161a24;
  border: 1px solid rgba(224, 180, 90, 0.55);
  padding: 16px;
  color: #f3efe4;
}
.hq-pop h3 { margin: 0 0 8px; }
.hq-pop p { margin: 4px 0; }
.hq-pop-act { display: flex; gap: 8px; margin-top: 12px; }
.hq-pop-act button { width: auto; flex: 1; background: #2a2418; border: 1px solid rgba(224, 180, 90, 0.45); }
.hq-pop-act button[disabled] { opacity: 0.4; }

.hq-skills { padding: 8px; }
.hq-skill { padding: 8px 4px; border-bottom: 1px solid #2a303b; }
.hq-skill b { display: block; margin-bottom: 6px; }
.hq-skill-act { display: flex; gap: 6px; }
.hq-skill-act button { width: auto; flex: 1; border: 1px solid #2a303b; }
.hq-skill-act button[disabled] { opacity: 0.4; }

polygon.mark.place { fill: rgba(0, 230, 255, 0.55); stroke: #fff; stroke-width: 2; }
.map-skill-flash { fill: rgba(226, 61, 61, 0.45); stroke: #e23d3d; pointer-events: none; }

@media (max-width: 980px) {
  .hq-win { top: 48px; right: 8px; left: 8px; width: auto; bottom: 8px; }
  .hq-win.slim { left: 8px; right: 8px; width: auto; bottom: 16px; top: auto; max-height: 62vh; }
  .hq-grid { grid-template-columns: repeat(3, 1fr); }
  .hq-tile { aspect-ratio: auto; height: 96px; }
}

.battle-bg.terrain-plain { background: linear-gradient(#3a4254, #1c212c); }
.battle-bg.terrain-bridge { background: linear-gradient(#4a4030, #1c212c); }
.battle-bg.terrain-shallow, .battle-bg.terrain-deep {
  background: linear-gradient(#1a4a6e, #0b1c2c);
}
.battle-bg.terrain-forest { background: linear-gradient(#1d4a32, #0c1a12); }
.battle-bg.terrain-ruin, .battle-bg.terrain-hospital, .battle-bg.terrain-city {
  background: linear-gradient(#4a453c, #1a1814);
}
.battle-bg.terrain-fort { background: linear-gradient(#5a3a1e, #1a1208); }
.battle-bg.terrain-fire { background: linear-gradient(#6a2a10, #1a0a04); }
.battle-bg.terrain-rad { background: linear-gradient(#3a4a16, #101404); }

#map-cutin {
  position: absolute;
  inset: 0;
  z-index: 32;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}
#map-cutin.hidden { display: none; }
#map-cutin .map-cutin-band {
  position: relative;
  width: 100%;
  height: 38%;
  min-height: 140px;
  max-height: 280px;
  overflow: hidden;
  background: #0a0a0a;
  box-shadow: 0 0 48px #000;
  transform: translateX(-100%);
}
#map-cutin.from-right .map-cutin-band { transform: translateX(100%); }
#map-cutin.in .map-cutin-band {
  transition: transform .22s cubic-bezier(.2,.8,.2,1);
  transform: translateX(0);
}
#map-cutin.out .map-cutin-band { transition: transform .16s ease-in; }
#map-cutin.out:not(.from-right) .map-cutin-band { transform: translateX(-100%); }
#map-cutin.out.from-right .map-cutin-band { transform: translateX(100%); }
#map-cutin .map-cutin-art {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
}
#map-cutin.in::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  animation: map-cutin-flash .28s ease-out;
  pointer-events: none;
}
@keyframes map-cutin-flash {
  0% { opacity: .5; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #map-cutin .map-cutin-band,
  #map-cutin.in .map-cutin-band,
  #map-cutin.out .map-cutin-band { transition: none; transform: none; }
  #map-cutin.in::after { animation: none; }
}

/* ---- 오토 (auto1) ---- */
#auto-btn {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  flex-shrink: 0;
  background: transparent;
  color: var(--ivory);
  border: 1px solid var(--line);
}
#auto-btn:hover { border-color: var(--brass); color: var(--brass); }
#auto-btn:disabled { color: #8d877c; border-color: var(--line); }
#auto-btn.aiming { border-color: var(--brass); color: var(--brass); animation: auto-blink 0.9s ease-in-out infinite; }
#auto-btn.on { background: #c0392b; border-color: #e5604f; color: #fff; box-shadow: 0 0 10px rgba(229, 96, 79, 0.55); }
@keyframes auto-blink { 50% { box-shadow: 0 0 12px rgba(231, 185, 92, 0.7); } }
#map-wrap.auto-aim #map { cursor: crosshair; }
#map-wrap.auto-aim .hex.hover { stroke: #e7b95c; stroke-width: 3; }
.auto-goal-ring { fill: rgba(229, 96, 79, 0.14); stroke: #e5604f; stroke-width: 3; stroke-dasharray: 6 4; }
.auto-goal-pole { stroke: #f3ead8; stroke-width: 2.5; stroke-linecap: round; }
.auto-goal-flag { fill: #e5604f; stroke: #7a1d14; stroke-width: 1; }
@media (max-width: 900px) {
  #auto-btn { padding: 6px 8px; font-size: 12px; }
}

/* sfx1: 소리 켜기/끄기 */
#top .sfx-btn { width: 34px; height: 34px; flex-shrink: 0; }
#top .sfx-btn .sfx-off { display: none; }
#top .sfx-btn.muted { color: #8d877c; border-color: #3a3f4a; }
#top .sfx-btn.muted .sfx-on { display: none; }
#top .sfx-btn.muted .sfx-off { display: inline; }
