/* v3.1의 숲·돌길·올리브색 패널을 실제 플레이 흐름에 연결한다. */
:root {
  --ground: #0d1513;
  --ground-grid: #19271f;
  --surface: #17231f;
  --surface-2: #213128;
  --surface-3: #2c3d30;
  --surface-hover: #314837;
  --line: #3d5142;
  --line-soft: #2c3c32;
  --line-strong: #718066;
  --ink: #eef0e3;
  --ink-muted: #a5b3a1;
  --ink-faint: #81917d;
  --accent: #c4df99;
  --accent-ink: #21321e;
  --signal: #a8d5a2;
  --danger: #f0a49b;
  --danger-dim: #64433c;
  --health: #ed7474;
  --mana: #6aaaff;
  --shield: #55d7df;
  --gold: #efd28e;
  --boss: #bda6e4;
  --field: #314d32;
  --field-line: #bdcfa4;
  --slot-edge: #b1c296;
  --slot-empty-edge: #9baf7d;
  --path: #a8a27b;
  --path-edge: #716d4b;
  --topbar-h: 66px;
  --rail-w: 224px;
  --detail-w: 282px;
  --dock-h: 136px;
  --shadow-panel: none;
  --r3: 8px;
}
:root[data-theme="light"] {
  --ground: #dde4d4;
  --surface: #f3f3e8;
  --surface-2: #e4e9da;
  --surface-3: #d1ddc3;
  --surface-hover: #d3dfc4;
  --line: #b9c4ac;
  --line-soft: #d3dacb;
  --line-strong: #7d9170;
  --ink: #243323;
  --ink-muted: #5b6e53;
  --ink-faint: #718168;
  --accent: #729c45;
  --accent-ink: #fff;
  --danger: #b75d50;
  --health: #c63e43;
  --mana: #256dd4;
  --shield: #007f87;
  --gold: #93702a;
  --signal: #688e4e;
  --boss: #81619e;
}
[hidden] {
  display: none !important;
}
body {
  background: var(--ground);
}
body[data-screen="lobby"],
body[data-screen="rooms"],
body[data-screen="error"] {
  overflow-y: auto;
}
.skip-link {
  position: fixed;
  z-index: 200;
  left: 16px;
  top: -80px;
  padding: 12px;
  background: var(--accent);
  color: var(--accent-ink);
}
.skip-link:focus {
  top: 10px;
}
.btn {
  min-height: 34px;
  border-radius: 5px;
  font-size: 12px;
}
.btn[data-variant="primary"] {
  box-shadow:
    0 1px 0 #ffffff45 inset,
    0 3px 10px #0002;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn,
input,
select {
  transition:
    background 0.16s,
    border-color 0.16s,
    transform 0.16s;
}
.btn.icon-btn {
  width: 34px;
  justify-content: center;
  font-size: 23px;
  line-height: 1;
  padding: 0;
}
.eyebrow {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}
.type-icon {
  width: 23px;
  height: 23px;
}
.portrait {
  flex: none;
  image-rendering: pixelated;
}

/* 원정의 시작 */
.lobby {
  min-height: 100dvh;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  color: #eef0e3;
  background: #0b1714;
}
.lobby-scenery {
  position: absolute;
  z-index: -2;
  inset: 0;
  background:
    linear-gradient(90deg, #071411af 0%, #0b191352 52%, #0c1916a8 100%),
    linear-gradient(0deg, #081510 0%, transparent 38%, #0b151340 100%),
    url("../assets/generated/expedition-backdrop.png") center 58% / cover;
}
.lobby-scenery::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 29% 58%, #c9d7a808, transparent 52%);
}
.lobby-header {
  min-height: 92px;
  width: min(1392px, 100%);
  padding: 28px 48px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.lobby-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}
.lobby-brand .brand-mark {
  width: 29px;
  height: 29px;
  background: linear-gradient(#c7df9a 0 45%, #17332b 46% 54%, #d2debd 55%);
  border-color: #b8cb98;
}
.lobby-brand b {
  font-size: 18px;
  letter-spacing: 0.12em;
  font-weight: 850;
}
.lobby-brand small {
  display: block;
  color: #b8c8aa;
  font-size: 9px;
  letter-spacing: 0.29em;
  margin-top: 2px;
}
.lobby-nav {
  display: flex;
  gap: 10px;
  align-items: center;
}
.lobby-nav .btn {
  color: #d4dfc8;
  border-color: transparent;
}
.lobby-nav .btn:hover {
  background: #a7c2941c;
}
.lobby-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 396px;
  align-items: center;
  gap: 76px;
  width: min(1296px, 100%);
  padding: 54px 48px 70px;
  flex: 1;
  margin: auto;
}
.hero-copy {
  padding-bottom: 30px;
}
.hero-copy > .eyebrow {
  color: #ccdcac;
  font-size: 11px;
  letter-spacing: 0.16em;
  margin-bottom: 24px;
}
.hero-copy h1 {
  white-space: pre-line;
  font-size: clamp(35px, 3.4vw, 54px);
  font-weight: 750;
  line-height: 1.32;
  letter-spacing: -0.055em;
  text-shadow: 0 3px 25px #04100cd9;
  text-wrap: initial;
}
.hero-intro {
  max-width: 480px;
  font-size: 14px;
  line-height: 1.95;
  color: #b7c5b1;
  margin-top: 24px;
  word-break: keep-all;
}
.hero-features {
  display: flex;
  gap: 0;
  margin: 40px 0 42px;
}
.hero-features > span {
  padding: 0 28px;
  border-left: 1px solid #bace9a36;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hero-features > span:first-child {
  padding-left: 0;
  border: 0;
}
.hero-features b {
  font-family: var(--font-mono);
  font-size: 27px;
  line-height: 1.2;
  color: #e2e9cc;
  font-weight: 500;
}
.hero-features small {
  font-size: 10px;
  color: #a8b89c;
}
.companion-strip {
  background: transparent;
  border: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  color: #dde6ce;
}
.companion-portraits {
  display: flex;
  padding-left: 0;
}
.companion-portraits .portrait {
  margin-left: -6px;
  border: 2px solid #3f5340;
  border-radius: 50%;
  overflow: hidden;
  background: #263c2b;
}
.companion-strip b {
  font-size: 11px;
  font-weight: 500;
}
.companion-strip small {
  display: block;
  font-size: 10px;
  color: #96af86;
  margin-top: 4px;
}
.setup-card {
  border: 1px solid #7f946553;
  border-radius: 13px;
  padding: 29px;
  background: linear-gradient(145deg, #24372be6, #15251eea);
  box-shadow:
    0 20px 70px #0006,
    0 1px 0 #d9edc117 inset;
  backdrop-filter: blur(16px);
}
.setup-heading {
  margin-bottom: 25px;
}
.setup-heading .eyebrow {
  color: #a8bd94;
  font-size: 9px;
}
.setup-heading h2 {
  font-size: 22px;
  margin-top: 7px;
  letter-spacing: -0.035em;
}
.setup-card fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.mode-options {
  display: grid;
  gap: 7px;
}
.mode-option {
  cursor: pointer;
  position: relative;
}
.mode-option input,
.difficulty-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.mode-option > span {
  display: block;
  padding: 13px 14px;
  background: #0d21167a;
  border: 1px solid #64775840;
  border-radius: 6px;
  transition: 0.16s;
}
.mode-option input:checked + span {
  border-color: #abc789a3;
  background: #7e9b6133;
}
.mode-option input:focus-visible + span,
.difficulty-option input:focus-visible + span {
  outline: 2px solid #c4df99;
  outline-offset: 3px;
}
.mode-option b {
  display: block;
  font-size: 12px;
}
.mode-option b::before {
  content: "◇";
  color: #b1ca93;
  margin-right: 8px;
}
.mode-option input:checked + span b::before {
  content: "◆";
}
.mode-option small {
  display: block;
  font-size: 10px;
  color: #a0b394;
  padding-top: 4px;
}
.difficulty-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 21px !important;
}
.difficulty-options legend {
  padding: 0 0 9px;
  font-size: 11px;
  color: #c4d0b8;
}
.difficulty-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}
.difficulty-option > span {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 3px;
  background: #15271b;
  border: 1px solid #53644a;
  border-radius: 5px;
}
.difficulty-option b {
  font-size: 11px;
  font-weight: 500;
}
.difficulty-option small {
  font-size: 8px;
  color: #9eb18f;
  margin-top: 4px;
  white-space: nowrap;
}
.difficulty-option input:checked + span {
  border-color: #c4df99;
  color: #e3efca;
  background: #91ab6833;
  box-shadow: 0 0 0 1px #abc98322;
}
.seed-label {
  display: block;
  margin-top: 21px;
  font-size: 11px;
  color: #c7d3bb;
}
.seed-input {
  display: flex;
  gap: 6px;
  margin: 8px 0 6px;
}
.seed-input input {
  width: 0;
  flex: 1;
  min-height: 38px;
  border: 1px solid #526447;
  background: #102219bd;
  border-radius: 5px;
  padding: 0 11px;
  color: #d1ddc5;
  font-size: 12px;
}
.seed-input .btn {
  color: #bace9f;
  background: #2a3c2a;
  border-color: #526447;
  width: 38px;
  justify-content: center;
  font-size: 19px;
}
.seed-label > small {
  font-size: 9px;
  color: #90a682;
}
.start-button {
  margin-top: 24px;
  width: 100%;
  justify-content: space-between;
  min-height: 49px;
  font-size: 14px;
  padding: 0 18px;
  background: #c4df99 !important;
  border-color: #c4df99 !important;
  color: #21321e !important;
}
.start-button > span:last-child {
  font-size: 21px;
}
.continue-button {
  display: flex;
  width: 100%;
  justify-content: space-between;
  padding: 13px 2px 0;
  margin-top: 13px;
  border: 0;
  border-top: 1px solid #6d805041;
  background: none;
  color: #c5d5b6;
  font-size: 11px;
}
.lobby-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(1392px, 100%);
  padding: 18px 48px 25px;
  margin: 0 auto;
  font-size: 9px;
  color: #7f997e;
  letter-spacing: 0.05em;
}

/* 전장: 한눈에 팀과 길을 읽을 수 있는 3열 */
.app {
  grid-template-rows: var(--topbar-h) minmax(0, 1fr) var(--dock-h) 26px;
  height: 100dvh;
  max-width: 2048px;
  margin: auto;
}
.topbar {
  background: linear-gradient(90deg, #26372b, var(--surface) 50%);
  padding: 0 22px;
  gap: 24px;
}
.brand-button {
  border: 0;
  background: none;
  color: inherit;
  padding: 0;
  text-align: left;
}
.brand-mark {
  background: linear-gradient(#b2cc8d 0 46%, #223b2a 47% 53%, #c8d4b3 54%);
  border-color: #849774;
}
.brand-text b {
  font-size: 12px;
  letter-spacing: -0.02em;
}
.brand-text span {
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin-top: 6px;
}
.readout {
  min-width: 72px;
  padding: 0 18px;
}
.readout > .label {
  font-family: var(--font-ui);
  letter-spacing: 0;
  font-size: 9px;
}
.readout > .value {
  font-family: var(--font-mono);
  font-size: 21px;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -0.04em;
}
.readout > .value small {
  font-size: 10px;
  letter-spacing: 0;
}
.readout[data-tone="round"] > .value {
  color: var(--accent);
}
.readout[data-tone="enemies"],
.readout[data-tone="board"] {
  min-width: 60px;
}
.readout[data-tone="enemies"] > .value,
.readout[data-tone="board"] > .value {
  font-size: 17px;
}
.top-actions {
  gap: 2px;
}
.main {
  padding: 12px 14px 10px;
  gap: 10px;
}
.rail,
.detail {
  gap: 10px;
  padding: 0;
  scrollbar-width: thin;
}
.panel {
  border-color: var(--line-soft);
  border-radius: 7px;
  background: var(--surface);
}
.panel > header {
  padding: 13px 14px;
  border-bottom-color: var(--line-soft);
}
.panel > .panel-body {
  padding: 14px;
}
.stage {
  gap: 7px;
}
.stage-head {
  min-height: 38px;
  flex-wrap: nowrap;
}
.phase {
  gap: 9px;
}
.phase-dot {
  width: 6px;
  height: 6px;
}
.phase-label {
  font-size: 11px;
  white-space: nowrap;
}
.phase-time {
  font-size: 13px;
  color: var(--ink-muted);
  min-width: 48px;
}
.stage-controls {
  gap: 5px;
  flex-wrap: nowrap;
}
.stage-controls .btn {
  min-height: 29px;
  padding: 0 10px;
  font-size: 10px;
}
.stage-controls .segment .btn {
  min-height: 27px;
  padding: 0 7px;
}
.stage-timer {
  height: 3px;
  margin-top: 4px;
}
.field-wrap {
  border: 1px solid #61724d88;
  border-radius: 7px;
  box-shadow: inset 0 0 60px #07150c35;
}
.location-label {
  position: absolute;
  z-index: 1;
  left: 13px;
  top: 12px;
  pointer-events: none;
  border: 1px solid #b4c79540;
  border-radius: 4px;
  padding: 5px 9px;
  background: #162c20dc;
  color: #d9e6c8;
  font-size: 10px;
  box-shadow: 0 3px 10px #0002;
}
.field-overlay {
  bottom: 10px;
  left: 12px;
  right: 12px;
}
.hint {
  font-size: 10px;
  padding: 5px 9px;
  color: #d8e4c7;
  background: #1b3023e6;
  border-color: #9fb5874a;
}
.round-banner {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translate(-50%, -8px);
  max-width: 95%;
  padding: 12px 25px;
  white-space: nowrap;
  border: 1px solid #c3df8d77;
  border-radius: 6px;
  color: #ecf6d4;
  background: #20341ae6;
  box-shadow: 0 8px 25px #0003;
  font-size: 17px;
  letter-spacing: -0.025em;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.4s,
    transform 0.4s;
}
.round-banner[data-visible="true"] {
  opacity: 1;
  transform: translate(-50%, 0);
}
.round-banner[data-boss="true"] {
  color: #e5d7fc;
  border-color: #bb9ce8;
  background: #352544e8;
}
.board-access {
  height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
}
.board-access:focus-within {
  height: auto;
  min-height: 48px;
}
.board-slot-access {
  font-size: 9px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.synergy-row {
  min-height: 44px;
  padding: 6px 3px;
  border-left: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
}
.synergy-name {
  gap: 8px;
  display: flex;
  align-items: center;
  font-size: 11px;
}
.synergy-row[data-active="false"] {
  color: var(--ink-muted);
  opacity: 0.73;
}
.synergy-steps {
  gap: 4px;
  font-family: var(--font-ui);
  font-size: 9px;
}
.synergy-steps b {
  color: var(--accent);
}
.synergy-count {
  font-size: 12px;
  margin-left: 3px;
  padding-left: 8px;
  color: var(--accent);
}
.synergy-footnote {
  font-size: 9px;
  margin-top: 14px;
  line-height: 1.65;
}
.boss-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.boss-preview-round {
  font-family: var(--font-mono);
  letter-spacing: 0.11em;
  font-size: 9px;
  color: var(--boss);
}
.boss-preview-selected {
  display: flex;
  gap: 9px;
  align-items: center;
}
.boss-preview-selected b {
  display: block;
  font-size: 16px;
  letter-spacing: -0.035em;
}
.boss-preview-selected small {
  display: block;
  color: var(--accent);
  font-size: 9px;
  margin-top: 5px;
}
.boss-preview > p {
  font-size: 10px;
}
.boss-candidates {
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}
.boss-candidates > span {
  font-size: 9px;
}
.boss-candidates > div {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.boss-candidate {
  flex: 1;
  text-align: center;
  opacity: 0.5;
}
.boss-candidate small {
  display: block;
  font-size: 8px;
}
.boss-candidate[data-selected="true"] {
  opacity: 1;
  color: var(--boss);
}
.wave-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
}
.wave-summary small {
  display: block;
  font-size: 9px;
  margin-top: 3px;
}
.boss-hud:empty {
  display: none;
}
.boss-life-row {
  padding: 7px 2px 0;
  font-size: 10px;
}
.boss-life-row > div:first-child {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.boss-life-row b {
  color: var(--boss);
}
.boss-life-row .meter {
  height: 5px;
}
.ally-detail {
  display: grid;
  gap: 8px;
}
.detail-title h3 {
  font-size: 19px;
  letter-spacing: -0.04em;
}
.detail-title .unit-stars {
  font-size: 10px;
  letter-spacing: 2px;
}
.detail-head {
  gap: 11px;
}
.type-chip {
  font-size: 9px;
  padding: 3px 7px;
  background: #ffffff05;
}
.type-chip .type-icon {
  width: 15px;
  height: 15px;
}
.stat-grid {
  gap: 14px 12px;
}
.stat dt {
  font-family: var(--font-ui);
  font-size: 9px;
  color: var(--ink-muted);
  letter-spacing: 0;
}
.stat dd {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  margin-top: 3px;
}
.ability-card {
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
  display: grid;
  gap: 6px;
}
.ability-card b {
  font-size: 12px;
}
.ability-card p {
  font-size: 11px;
  line-height: 1.85;
  word-break: keep-all;
}
.evolution-inline {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border-radius: 5px;
  background: #8fa96d0b;
  border: 1px solid var(--line-soft);
}
.evolution-inline b {
  font-size: 10px;
  display: block;
}
.evolution-inline small {
  font-size: 9px;
}
.target-select {
  display: grid;
  gap: 7px;
}
.target-select select {
  width: 100%;
  border: 1px solid var(--line);
  padding: 6px;
  background: var(--surface-2);
  border-radius: 4px;
  font-size: 11px;
}
.detail-unit-actions {
  gap: 5px;
}
.detail-unit-actions .btn {
  font-size: 10px;
  min-height: 30px;
  padding: 0 8px;
}
.detail .panel > header {
  padding: 8px 11px;
}
.detail .panel > .panel-body {
  padding: 10px 11px;
}
.detail .detail-title h3 {
  font-size: 17px;
}
.detail .detail-head {
  gap: 7px;
}
.detail .detail-head .btn-row {
  gap: 3px;
}
.detail .type-chip {
  padding: 2px 5px;
  font-size: 8px;
}
.detail .type-chip .type-icon {
  width: 13px;
  height: 13px;
}
.detail-stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}
.detail-stat-grid .stat {
  min-width: 0;
  padding: 5px 6px;
  background: var(--surface-2);
  border-radius: 4px;
}
.detail-stat-grid dt {
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
}
.detail-stat-grid dd {
  font-size: 13px;
  margin: 3px 0 0;
  white-space: nowrap;
}
.stat-icon {
  color: var(--ink);
  font-size: 12px;
  line-height: 1;
}
.stat[data-stat="hp"] dd,
.stat[data-stat="hp"] .stat-icon,
.readout[data-tone="life"] > .value {
  color: var(--health);
}
.stat[data-stat="mana"] dd,
.stat[data-stat="mana"] .stat-icon {
  color: var(--mana);
}
.meter[data-tone="life"] > span {
  background: var(--health);
}
.meter[data-tone="mana"] > span {
  background: var(--mana);
}
.detail-health,
.detail-mana {
  height: 5px;
}
.ally-detail .ability-card {
  gap: 3px;
  padding-top: 7px;
}
.ally-detail .ability-card p {
  font-size: 10px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.ally-detail .evolution-inline {
  display: block;
  padding: 0;
  background: none;
  border: 0;
}
.evolution-action {
  width: 100%;
  min-height: 40px;
  gap: 6px;
  text-align: left;
  white-space: normal;
}
.evolution-action > span:last-child {
  min-width: 0;
}
.evolution-action b,
.evolution-action small {
  display: block;
}
.evolution-action b {
  font-size: 10px;
}
.evolution-action small {
  font-size: 9px;
  opacity: 0.85;
}
.evolution-action-icon {
  font-size: 21px;
}
.evolution-reason {
  margin-top: 3px;
  font-size: 9px;
  line-height: 1.4;
}
.ally-detail .equipment-preview {
  gap: 4px;
}
.ally-detail .equipment-slots {
  gap: 6px;
}
.ally-detail .equipment-slot {
  width: 33px;
  height: 33px;
}
.detail-collapse {
  display: none;
}
.detail .detail-head-compact {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.detail-identity {
  display: grid;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.detail-identity .detail-title {
  flex-wrap: wrap;
  gap: 3px 6px;
}
.ally-detail .ability-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 6px;
}
.ally-detail .ability-card > p {
  grid-column: 1 / -1;
}
.combat-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 5px;
  margin: 0;
}
.combat-option-grid > .stat {
  min-width: 0;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 3px;
  padding: 2px 4px;
  border-radius: 3px;
  background: var(--surface-2);
}
.combat-option-grid dt {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 8px;
  line-height: 1.3;
}
.combat-option-grid dd {
  flex: none;
  margin: 0;
  font-size: 10px;
  line-height: 1.3;
  white-space: nowrap;
}
.combat-option-grid .stat-icon {
  font-size: 10px;
}
.stat[data-stat="shield"] dd,
.stat[data-stat="shield"] .stat-icon {
  color: var(--shield);
}
.meter[data-tone="shield"] > span {
  background: var(--shield);
}
.detail-shield {
  height: 5px;
}
.item-combat-options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.item-combat-options:empty {
  display: none;
}
.item-combat-options .chip {
  font-size: 9px;
  padding: 2px 5px;
}
.empty-detail {
  white-space: pre-line;
  gap: 13px;
  padding: 18px 3px;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.9;
}
.empty-symbol {
  font-size: 45px;
  color: var(--accent);
  opacity: 0.6;
}

/* 대기석은 12종을 한 화면에 표시하며 같은 종의 개별 UID/수량을 보존한다. */
.dock {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  height: var(--dock-h);
  padding: 12px 20px;
  gap: 22px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.bench-section {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}
.bench-label h2 {
  font-size: 12px;
  font-weight: 650;
}
.bench-capacity {
  display: block;
  font-size: 10px;
  color: var(--accent);
  margin-top: 4px;
}
.bench-label > small {
  font-size: 9px;
  display: block;
  color: var(--ink-muted);
  margin-top: 7px;
}
.bench-label > .btn {
  font-size: 9px;
  padding: 0;
  min-height: 26px;
  margin-top: 5px;
}
.bench-label > .bench-page {
  padding: 0 8px;
  margin-left: 6px;
}
.bench-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 5px;
  align-content: center;
}
.bench-group {
  position: relative;
  min-width: 0;
}
.bench-copy-next {
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--surface);
  color: var(--accent);
  font-size: 15px;
  line-height: 1;
}
.bench-copy-next:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.bench-unit {
  position: relative;
  min-width: 0;
  width: 100%;
  height: 86px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 5px 2px 2px;
  border: 1px solid #6e7e57;
  border-bottom: 3px solid #829861;
  background: linear-gradient(#34452e, #223326);
  border-radius: 6px;
  color: #d8e5c7;
  transition:
    transform 0.16s,
    border-color 0.16s;
}
.bench-unit:hover {
  transform: translateY(-3px);
  border-color: #c4df99;
}
.bench-unit[data-selected="true"] {
  border-color: #d8e8a8;
  background: linear-gradient(#536940, #31472b);
  box-shadow:
    0 0 0 1px #c5e39466,
    0 4px 15px #0002;
}
.bench-number {
  position: absolute;
  left: 6px;
  top: 4px;
  font-size: 9px;
  color: #b9cba3;
}
.bench-name {
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.bench-unit .unit-stars {
  font-size: 7px;
  line-height: 1.2;
  color: #d5c98a;
}
.stack-count {
  position: absolute;
  right: 3px;
  top: 3px;
  height: fit-content;
  padding: 1px 4px;
  border: 1px solid #a9c47b88;
  border-radius: 3px;
  background: #1f3428;
  color: #e3efbd;
  font-size: 10px;
}
.bench-empty-slot {
  background: #0f20168a;
  border: 1px dashed #526549;
  color: #667c5a;
  font-size: 18px;
}
.bench-empty-slot .bench-number {
  color: #6e8563;
}
.bench-empty-slot:disabled {
  cursor: default;
}
.bench-empty-slot:disabled:hover {
  transform: none;
  border-color: #526549;
}
.recruit-controls {
  display: grid;
  align-content: center;
  gap: 7px;
}
.recruit-button {
  min-height: 39px;
  justify-content: space-between;
  padding: 0 13px;
}
.recruit-button b {
  font-size: 12px;
}
.recruit-button > span {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 650;
}
.recruit-button kbd {
  font-size: 10px;
  opacity: 0.55;
  font-weight: 400;
}
.recruit-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.recruit-secondary .btn {
  justify-content: center;
  font-size: 11px;
  min-height: 31px;
}
.recruit-controls > small {
  font-size: 8px;
  text-align: center;
}
.game-footer {
  display: flex;
  justify-content: space-between;
  padding: 4px 20px;
  color: var(--ink-faint);
  font-size: 9px;
  background: var(--ground);
}

/* 도감·성장·결과 */
.game-dialog {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
  padding: 0;
  width: min(940px, 94vw);
  max-width: 94vw;
  max-height: 90dvh;
  box-shadow: 0 28px 100px #0008;
}
.game-dialog::backdrop {
  background: #030c09b5;
  backdrop-filter: blur(6px);
}
.game-dialog[open] {
  animation: dialog-appear 0.22s ease-out;
}
@keyframes dialog-appear {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.dialog-heading h2 {
  font-size: 24px;
  margin-top: 6px;
  letter-spacing: -0.045em;
}
.dialog-heading p.muted {
  font-size: 11px;
  margin-top: 8px;
}
.catalog-screen {
  padding: 28px;
}
.catalog-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}
.catalog-tools input,
.catalog-tools select {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  min-height: 38px;
  padding: 8px 11px;
  font-size: 12px;
}
.catalog-tools input {
  flex: 1;
  min-width: 0;
}
.catalog-tools select {
  max-width: 150px;
}
.catalog-tools > span {
  font-size: 11px;
  font-family: var(--font-mono);
}
.catalog-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 24px;
}
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
  max-height: 52dvh;
  overflow-y: auto;
  padding: 2px;
}
.catalog-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 4px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink);
  min-width: 0;
}
.catalog-unit b {
  font-size: 11px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.catalog-unit .unit-stars {
  font-size: 8px;
  color: var(--gold);
}
.catalog-unit[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--surface-3);
}
.catalog-detail {
  border-left: 1px solid var(--line);
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.catalog-portrait {
  width: 100%;
  display: grid;
  place-items: center;
  padding: 15px 0 5px;
  background: radial-gradient(ellipse, #c3df8d17, transparent 68%);
}
.catalog-detail > .unit-stars {
  align-self: center;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--gold);
}
.catalog-detail h3 {
  font-size: 23px;
  letter-spacing: -0.045em;
}
.catalog-detail .stat-grid {
  width: 100%;
  margin: 3px 0;
}
.catalog-detail .ability-card {
  width: 100%;
}
.game-dialog[data-view="settings"],
.game-dialog[data-view="research"],
.game-dialog[data-view="evolution"],
.game-dialog[data-view="synergy"],
#result-dialog {
  width: min(550px, 94vw);
}
.settings-screen,
.research-screen,
.evolution-screen,
.synergy-screen,
.journal-screen,
.lab-screen {
  padding: 28px;
}
.settings-switch {
  border-bottom: 1px solid var(--line-soft);
  padding: 15px 0;
  font-size: 13px;
}
.settings-volume {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.settings-volume input {
  accent-color: var(--accent);
  width: 50%;
}
.settings-screen > .btn-row {
  margin-top: 22px;
}
.settings-shortcuts {
  font-size: 10px;
  padding-top: 25px;
}
.research-gold {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  color: var(--gold);
  background: #cfb2660a;
  border: 1px solid #cfb26624;
  border-radius: 5px;
  font-size: 12px;
  margin-bottom: 20px;
}
.draw-upgrade {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 14px;
}
.draw-upgrade h3 {
  font-size: 15px;
}
.draw-upgrade p {
  font-size: 10px;
  margin-top: 3px;
}
.odds-legend {
  margin-top: 8px;
  font-size: 8px;
  gap: 5px 11px;
}
.research-cards {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}
.research-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
}
.research-card > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.research-card h3 {
  font-size: 12px;
}
.research-card b {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 14px;
}
.research-card .pips {
  grid-row: 2;
}
.research-card .btn,
.research-card .chip {
  grid-row: 1 / 3;
  grid-column: 2;
  min-width: 64px;
  justify-content: center;
  font-size: 10px;
}
.research-card .pips > i {
  width: 12px;
  height: 4px;
}
.planner-screen .research-card[data-goal-id] {
  display: block;
}
.evolution-screen > p {
  font-size: 11px;
}
.evolution-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}
.evolution-plan {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.evolution-plan > div {
  flex: 1;
}
.evolution-plan b {
  font-size: 11px;
  display: block;
}
.evolution-plan small {
  font-size: 9px;
  display: block;
  margin-top: 4px;
}
.synergy-description {
  margin: 20px 0;
  white-space: pre-line;
  line-height: 1.9;
  font-size: 13px;
}
.synergy-thresholds {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.synergy-screen > p.muted {
  font-size: 11px;
}
.lab-screen > .panel {
  margin-top: 14px;
}
.result {
  text-align: center;
  align-items: center;
  padding: 38px;
  gap: 16px;
}
.result > .eyebrow {
  color: var(--accent);
  font-size: 9px;
}
.result-emblem {
  font-size: 56px;
  line-height: 1;
  color: var(--accent);
}
.result h2 {
  font-size: 26px;
  letter-spacing: -0.055em;
}
.result > p.muted {
  font-size: 12px;
}
.result-round {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 5px 0;
  color: var(--ink-muted);
}
.result-round b {
  font-family: var(--font-mono);
  font-size: 58px;
  line-height: 1.1;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.06em;
}
.result .stat-grid {
  width: 100%;
  text-align: left;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.result > p.faint {
  font-size: 10px;
}
.result-actions {
  display: grid;
  gap: 9px;
  width: 100%;
  margin-top: 4px;
}
.result-actions .btn {
  justify-content: center;
  min-height: 40px;
}
.loading-error {
  max-width: 700px;
  margin: 15dvh auto;
  padding: 30px;
  display: grid;
  gap: 20px;
}
.loading-error h1 {
  font-size: 24px;
}
.toast {
  z-index: 150;
  background: #dce9c5;
  color: #243822;
  border-color: #bfd39d;
  border-radius: 7px;
  font-size: 12px;
  padding: 10px 18px;
  bottom: 35px;
}

@media (min-width: 1700px) {
  :root {
    --rail-w: 250px;
    --detail-w: 310px;
    --dock-h: 144px;
  }
  .main {
    padding: 16px 20px 12px;
    gap: 14px;
  }
  .topbar {
    padding: 0 28px;
  }
  .bench-unit {
    height: 94px;
  }
}
@media (max-width: 1279px) {
  :root {
    --topbar-h: 62px;
    --rail-w: 210px;
    --detail-w: 260px;
  }
  .brand-text b {
    font-size: 10px;
  }
  .brand-text span {
    font-size: 8px;
  }
  .topbar {
    gap: 16px;
    padding: 0 14px;
  }
  .readout {
    padding: 0 13px;
    min-width: 60px;
  }
  .readout[data-tone="board"] {
    display: none;
  }
  .main {
    grid-template-columns: 205px minmax(0, 1fr);
  }
  .rail {
    display: flex;
  }
  .detail {
    display: none;
  }
  .main[data-pane="detail"] .detail,
  .main[data-pane="rail"] .rail {
    top: 74px;
    bottom: calc(var(--dock-h) + 34px);
    padding: 12px;
    z-index: 25;
    background: var(--surface);
  }
  .pane-toggles {
    display: flex;
  }
  .pane-toggles .btn {
    font-size: 10px;
    padding: 0 6px;
  }
  .bench-section {
    grid-template-columns: 115px minmax(0, 1fr);
    gap: 10px;
  }
  .dock {
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 16px;
    padding: 12px 14px;
  }
  .bench-grid {
    gap: 5px;
  }
  .bench-name {
    font-size: 8px;
  }
  .lobby-content {
    gap: 35px;
    grid-template-columns: minmax(0, 1fr) 370px;
    padding-left: 36px;
    padding-right: 36px;
  }
  .hero-copy h1 {
    font-size: 39px;
  }
  .hero-intro {
    font-size: 12px;
  }
}
@media (max-width: 900px) {
  :root {
    --dock-h: 204px;
  }
  .bench-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .lobby-header {
    padding: 22px 26px;
  }
  .lobby-content {
    padding: 30px 26px 45px;
    gap: 30px;
    grid-template-columns: minmax(0, 1fr) 335px;
  }
  .hero-copy h1 {
    font-size: 31px;
  }
  .hero-copy > .eyebrow {
    font-size: 9px;
  }
  .hero-intro {
    font-size: 11px;
  }
  .setup-card {
    padding: 23px;
  }
  .hero-features > span {
    padding: 0 20px;
  }
  .hero-features b {
    font-size: 23px;
  }
  .companion-strip {
    gap: 9px;
    flex-wrap: wrap;
  }
  .lobby-footer {
    padding-left: 26px;
    padding-right: 26px;
  }
  .main {
    grid-template-columns: minmax(0, 1fr);
    padding: 7px 8px;
  }
  .rail {
    display: none;
  }
  .topbar {
    gap: 9px;
  }
  .brand-text {
    display: none;
  }
  .readout {
    padding: 0 12px;
  }
  .readout[data-tone="enemies"] {
    display: none;
  }
  .top-actions .btn {
    padding: 0 7px;
    font-size: 10px;
  }
  .readout > .value {
    font-size: 18px;
  }
  .dock {
    grid-template-columns: minmax(0, 1fr) 200px;
    gap: 12px;
  }
  .bench-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }
  .bench-label {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .bench-label > small {
    display: none;
  }
  .bench-label > .btn {
    margin: 0;
    min-height: 20px;
  }
  .bench-unit {
    height: 71px;
  }
  .bench-unit > .portrait {
    width: 32px !important;
    height: 32px !important;
  }
  .bench-name {
    font-size: 7px;
  }
  .bench-unit .unit-stars {
    display: none;
  }
  .bench-number {
    left: 3px;
    top: 3px;
    font-size: 7px;
  }
  .catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 900px) and (max-width: 1279px) {
  :root {
    --dock-h: 136px;
  }
  .main {
    grid-template-columns: minmax(0, 1fr) 250px;
  }
  .rail {
    display: none;
  }
  .main > .detail,
  .main[data-pane="detail"] > .detail,
  .main[data-pane="rail"] > .detail {
    display: flex;
    position: static;
    inset: auto;
    z-index: auto;
    width: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .main[data-pane="rail"] > .rail {
    display: flex;
  }
  .bench-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }
  .bench-label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px 8px;
  }
  .bench-capacity {
    margin-top: 0;
  }
  .bench-label > small {
    display: block;
    margin-top: 0;
  }
  .bench-label > .btn {
    margin-top: 0;
    min-height: 22px;
  }
  .bench-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
  .bench-unit {
    height: 72px;
  }
  .bench-unit > .portrait {
    width: 32px !important;
    height: 32px !important;
  }
  .bench-name {
    font-size: 8px;
  }
}
@media (max-width: 899px) {
  .detail-collapse {
    display: inline-flex;
    justify-content: center;
    width: 28px;
    min-height: 26px;
    padding: 0;
    font-size: 19px;
  }
}
@media (max-width: 640px) {
  :root {
    --topbar-h: 55px;
    --dock-h: 220px;
  }
  .lobby-header {
    padding: 21px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .lobby-brand b {
    font-size: 15px;
  }
  .lobby-brand small {
    font-size: 8px;
  }
  .lobby-nav {
    gap: 2px;
  }
  .lobby-nav .btn {
    font-size: 10px;
    padding: 0 7px;
  }
  .lobby-content {
    display: flex;
    flex-direction: column;
    padding: 25px 21px 35px;
    gap: 22px;
    align-items: stretch;
  }
  .hero-copy {
    padding-bottom: 0;
  }
  .hero-copy > .eyebrow {
    margin-bottom: 15px;
  }
  .hero-copy h1 {
    font-size: 35px;
  }
  .hero-intro {
    max-width: 340px;
    margin-top: 17px;
    font-size: 12px;
  }
  .hero-features {
    margin: 25px 0;
  }
  .companion-strip {
    display: none;
  }
  .setup-card {
    width: 100%;
    max-width: 420px;
    padding: 24px;
    margin: 0 auto;
  }
  .lobby-footer {
    flex-direction: column;
    font-size: 8px;
    gap: 5px;
    padding: 15px 21px 25px;
  }
  .lobby-scenery {
    background-position: 42% center;
  }
  .readout {
    padding: 0 7px;
    min-width: 47px;
  }
  .readout > .value {
    font-size: 15px;
  }
  .readout > .label {
    font-size: 8px;
  }
  .brand-button {
    display: none;
  }
  .topbar {
    padding: 0 9px;
    gap: 5px;
  }
  .top-actions {
    margin-left: auto;
  }
  .top-actions > .btn {
    font-size: 9px;
    padding: 0 5px;
  }
  .top-actions > .btn:nth-of-type(1) {
    display: none;
  }
  .pane-toggles {
    gap: 1px;
  }
  .pane-toggles .btn {
    font-size: 9px;
    padding: 0 5px;
  }
  .readouts {
    flex: initial;
  }
  .readout > .value small {
    font-size: 8px;
  }
  .stage-controls .btn {
    padding: 0 7px;
    font-size: 9px;
  }
  .phase-label {
    font-size: 10px;
  }
  .phase-time {
    font-size: 11px;
    min-width: 38px;
  }
  .phase {
    gap: 6px;
  }
  .location-label {
    top: 8px;
    left: 8px;
    font-size: 8px;
  }
  .hint {
    font-size: 8px;
  }
  .round-banner {
    font-size: 13px;
    padding: 10px 15px;
  }
  .dock {
    grid-template-columns: minmax(0, 1fr);
    padding: 7px 9px;
    gap: 5px;
  }
  .bench-section {
    gap: 3px;
  }
  .bench-label h2 {
    font-size: 10px;
  }
  .bench-label h2 span {
    font-size: 9px;
  }
  .bench-label > .btn {
    font-size: 8px;
  }
  .bench-grid {
    gap: 3px;
  }
  .bench-unit {
    height: 64px;
  }
  .bench-unit > .portrait {
    width: 29px !important;
    height: 29px !important;
  }
  .bench-name {
    font-size: 7px;
  }
  .stack-count {
    font-size: 8px;
    right: 1px;
    top: 1px;
    padding: 0 2px;
  }
  .recruit-controls {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }
  .recruit-button {
    min-height: 36px;
    padding: 0 10px;
  }
  .recruit-button b {
    font-size: 11px;
  }
  .recruit-button > span {
    font-size: 10px;
    gap: 6px;
  }
  .recruit-secondary .btn {
    min-height: 36px;
    font-size: 10px;
    padding: 0 7px;
  }
  .recruit-controls > small {
    display: none;
  }
  .game-footer {
    padding: 4px 10px;
    font-size: 7px;
  }
  .catalog-screen,
  .settings-screen,
  .research-screen,
  .evolution-screen,
  .synergy-screen,
  .journal-screen,
  .lab-screen {
    padding: 20px;
  }
  .catalog-content {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .catalog-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-height: 28dvh;
  }
  .catalog-unit {
    padding: 8px 2px;
  }
  .catalog-unit b {
    font-size: 9px;
  }
  .catalog-unit .portrait {
    width: 35px !important;
    height: 35px !important;
  }
  .catalog-detail {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 12px 0 0;
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 10px;
  }
  .catalog-portrait {
    grid-row: 1 / 4;
  }
  .catalog-portrait .portrait {
    width: 80px !important;
    height: 80px !important;
  }
  .catalog-detail > .unit-stars {
    grid-row: 2;
  }
  .catalog-detail h3 {
    font-size: 20px;
    grid-row: 1;
    grid-column: 2;
    align-self: end;
  }
  .catalog-detail > .btn-row {
    grid-column: 2;
  }
  .catalog-detail .stat-grid {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .catalog-detail .ability-card {
    grid-column: 1 / -1;
  }
  .catalog-tools {
    gap: 6px;
  }
  .catalog-tools input {
    font-size: 10px;
  }
  .catalog-tools select {
    width: 90px;
    font-size: 10px;
  }
  .dialog-heading {
    margin-bottom: 18px;
  }
  .dialog-heading h2 {
    font-size: 21px;
  }
  .result {
    padding: 28px;
  }
  .result h2 {
    font-size: 23px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
:root[data-motion="reduced"] *,
:root[data-motion="reduced"] *::before,
:root[data-motion="reduced"] *::after {
  animation-duration: 0.01ms !important;
  transition-duration: 0.01ms !important;
}

.opening-recruit-note {
  font-size: 9px;
  color: #a7b999;
  line-height: 1.7;
  margin-top: 10px;
}
.setup-preferences {
  border-top: 1px solid #65804f42;
  margin-top: 16px;
  padding-top: 12px;
  font-size: 10px;
}
.setup-preferences summary {
  cursor: pointer;
  color: #bdcfae;
}
.setup-preferences > p {
  font-size: 9px;
  line-height: 1.8;
  margin: 10px 0;
  color: #9eaf93;
}
.preference-types {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}
.preference-type {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 3px;
  background: #14261c;
  border: 1px solid #4a6042;
  border-radius: 4px;
  color: #b5c5a7;
  font-size: 8px;
  min-width: 0;
}
.preference-type .type-icon {
  width: 15px;
  height: 15px;
}
.preference-type[data-value="preferred"] {
  border-color: #b7d48d;
  color: #e0efc4;
  background: #687c3d3b;
}
.preference-type[data-value="avoided"] {
  border-color: #bb9b77;
  color: #e7bd9b;
  background: #88644436;
}
.preference-type > span {
  position: absolute;
  right: 3px;
  top: 0;
  font-size: 10px;
}
.setup-regional {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #bbcdab;
  margin-top: 10px;
}
.setup-regional input {
  accent-color: #b9d78e;
}
.item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: var(--accent);
}
.item-icon img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}
.equipment-preview {
  display: grid;
  gap: 8px;
}
.equipment-slots {
  display: flex;
  gap: 7px;
}
.equipment-slot {
  width: 39px;
  height: 39px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--ink-faint);
}
.equipment-slot[data-berry="true"] {
  border-color: #91b76b77;
  margin-left: 7px;
  color: var(--accent);
}
.items-screen,
.fairy-screen {
  padding: 28px;
}
.items-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.item-gold {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 16px;
}
.item-shop-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
}
.item-shop-actions .btn {
  font-size: 10px;
  min-height: 30px;
}
.item-shop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.shop-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}
.shop-item h3 {
  font-size: 13px;
}
.shop-item p {
  font-size: 10px;
  line-height: 1.8;
  flex: 1;
}
.shop-item .btn {
  min-height: 31px;
  font-size: 10px;
  width: 100%;
  justify-content: center;
}
.items-content:has(.owned-items) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 22px;
}
.owned-items {
  max-height: 53dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.owned-item {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding-right: 10px;
}
.owned-item[data-selected="true"] {
  border-color: var(--accent);
  background: var(--surface-3);
}
.owned-item-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border: 0;
  text-align: left;
  background: none;
  color: var(--ink);
}
.owned-item-button b {
  font-size: 11px;
  display: block;
}
.owned-item-button small {
  font-size: 9px;
  display: block;
  margin-top: 3px;
}
.owned-item > input {
  accent-color: var(--accent);
}
.item-detail {
  border-left: 1px solid var(--line);
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.selected-item-detail {
  display: grid;
  gap: 12px;
}
.selected-item-detail h3 {
  font-size: 17px;
}
.selected-item-detail p {
  font-size: 11px;
  line-height: 1.8;
}
.item-detail > .btn-row .btn {
  font-size: 10px;
}
.craft-panel {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 7px;
  display: grid;
  gap: 8px;
}
.craft-panel > b {
  font-size: 12px;
}
.craft-panel > p {
  font-size: 10px;
  line-height: 1.75;
}
.craft-result {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.craft-result b {
  font-size: 10px;
}
.craft-result .btn {
  width: 100%;
  justify-content: center;
  font-size: 10px;
  margin-top: 5px;
}
.borrowed-tools {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.borrowed-tools > h3 {
  width: 100%;
}
.wand-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}
.wand-choices > article {
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 15px;
}
.wand-choices h3 {
  font-size: 15px;
}
.wand-choices p {
  font-size: 11px;
  line-height: 1.8;
  flex: 1;
}
.wand-choices .btn {
  width: 100%;
  justify-content: center;
}
.fairy-screen > p {
  font-size: 12px;
}
.room-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.room-seat-tabs {
  display: flex;
  gap: 6px;
  flex: 1;
}
.room-seat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 11px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  color: var(--ink-muted);
  font-size: 10px;
}
.room-seat b {
  font-size: 10px;
  font-weight: 500;
}
.room-seat > span {
  color: var(--danger);
  font-size: 9px;
}
.room-seat[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--ink);
  background: var(--surface-3);
}
.room-vote {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 10px;
}
.room-vote > span {
  margin-right: auto;
}
.room-vote .btn {
  min-height: 27px;
  font-size: 10px;
}
@media (max-width: 640px) {
  .items-screen,
  .fairy-screen {
    padding: 20px;
  }
  .item-shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .shop-item {
    padding: 12px;
    gap: 9px;
  }
  .items-content:has(.owned-items) {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .owned-items {
    max-height: 26dvh;
  }
  .item-detail {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 16px;
  }
  .wand-choices {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 18px;
  }
  .wand-choices > article {
    padding: 16px;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px 15px;
  }
  .wand-choices p {
    grid-column: 2;
  }
  .wand-choices .btn {
    grid-column: 1 / -1;
  }
  .room-seat {
    padding: 5px 7px;
    gap: 4px;
    flex-direction: column;
  }
}

/* 짧은 창에서는 내용을 접거나 잘라내지 않고 행간과 패널 여백을 줄인다. */
@media (max-height: 800px) {
  .detail .panel > header {
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .detail .panel > .panel-body {
    padding-top: 5px;
    padding-bottom: 5px;
  }
  .detail .ally-detail {
    gap: 6px;
  }
  .detail .ally-detail .ability-card {
    padding-top: 5px;
  }
  .detail .ally-detail .ability-card p {
    line-height: 1.45;
  }
  .detail .evolution-action {
    min-height: 36px;
  }
  .detail .detail-unit-actions .btn {
    min-height: 28px;
  }
  .rail {
    gap: 8px;
  }
  .rail .panel > header {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .rail .panel > .panel-body {
    padding: 10px 12px;
  }
  .rail .synergy-list {
    gap: 2px;
  }
  .rail .synergy-row {
    min-height: 30px;
    padding: 3px 2px;
  }
  .rail .synergy-name {
    gap: 6px;
  }
  .rail .synergy-name .type-icon {
    width: 20px;
    height: 20px;
  }
  .rail .synergy-footnote {
    margin-top: 6px;
    line-height: 1.4;
  }
  .rail .boss-preview {
    gap: 6px;
  }
  .rail .boss-preview-selected small {
    margin-top: 3px;
  }
  .rail .boss-candidates {
    padding-top: 6px;
  }
  .rail .boss-candidates > div {
    margin-top: 4px;
  }
}
