* {
  box-sizing: border-box;
}

:root {
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, sans-serif;
  color: #f7f8fb;
  background: #10141f;
}

html, body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

button, input {
  font: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(255, 218, 121, .8);
  outline-offset: 3px;
}

#game {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #171d2a;
}

.layer {
  position: absolute;
  inset: 0;
}

.layer-bg { z-index: 1; }
.layer-object { z-index: 2; pointer-events: none; }
.layer-character { z-index: 3; pointer-events: none; }
.layer-ui { z-index: 4; }

.full-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.fallback-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 35%, rgba(77, 93, 126, .35), transparent 35%),
    linear-gradient(180deg, #27324a 0%, #182033 55%, #101521 100%);
}

.object-image {
  object-fit: cover;
}

.character-image {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(38vw, 520px);
  max-height: 82vh;
  object-fit: contain;
  transform: translateX(-50%);
  display: none;
  filter: drop-shadow(0 24px 32px rgba(0,0,0,.4));
}

.character-fallback {
  position: absolute;
  left: 50%;
  bottom: 9vh;
  transform: translateX(-50%);
  font-size: clamp(120px, 18vw, 260px);
  opacity: .45;
  filter: drop-shadow(0 20px 24px rgba(0,0,0,.35));
}

.layer-ui {
  padding: 20px;
  overflow: auto;
}

.glass {
  background: rgba(15, 19, 31, .84);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 16px 40px rgba(0,0,0,.28);
  backdrop-filter: blur(10px);
}

.topbar {
  width: min(1420px, 100%);
  margin: 0 auto 18px;
  min-height: 78px;
  border-radius: 18px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 30px;
}

.topbar > div:not(.save-state) {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.label {
  color: #9da9bf;
  font-size: 12px;
}

.topbar strong {
  font-size: 24px;
}

.online-player {
  min-width: 180px;
}

.online-player-identity {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 3px;
}

.player-avatar-button {
  width: 100px;
  height: 100px;
  flex: 0 0 100px;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.065);
  color: #fff;
  cursor: pointer;
}

.player-avatar-button:hover {
  border-color: rgba(255, 211, 103, .55);
  background: rgba(255, 211, 103, .09);
}

.player-avatar-button img {
  width: 100%;
  height: 100%;
  display: none;
  object-fit: cover;
}

.player-avatar-button span {
  font-size: 50px;
  line-height: 1;
}

.nickname-button {
  width: max-content;
  max-width: 190px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font-weight: 850;
  font-size: 16px;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.nickname-button:hover {
  color: #ffd66b;
}

.save-state {
  margin-left: auto;
  color: #9da9bf;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.online-ok { color: #79dfa0; }
.online-warn { color: #ffd16f; }
.online-error { color: #ff8c8c; }

.state-divider {
  opacity: .5;
}

.game-layout {
  width: min(1420px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(310px, 380px) minmax(390px, 1fr) minmax(270px, 320px);
  gap: 18px;
  min-height: calc(100vh - 136px);
}

.loot-panel,
.equipment-panel,
.ranking-panel {
  border-radius: 22px;
  padding: 22px;
}

.loot-panel h1,
.equipment-panel h2,
.inventory-title h2,
.ranking-panel h2 {
  margin: 0;
}

.sub {
  color: #aab4c9;
  margin: 8px 0 10px;
  font-size: 14px;
}

.chest-button {
  width: 100%;
  height: 230px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 18px;
}

.chest-button:hover {
  background: rgba(255,255,255,.035);
}

.chest-button:active {
  transform: translateY(2px);
}

#chestImage {
  width: min(72%, 230px);
  max-height: 190px;
  object-fit: contain;
  display: none;
  filter: drop-shadow(0 18px 18px rgba(0,0,0,.3));
}

.chest-fallback {
  font-size: 130px;
  line-height: 1;
}

.forge-gold-balance {
  min-height: 18px;
  margin: -4px 4px 8px;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  color: #a1a2a7;
  font-size: 10px;
  line-height: 1.2;
}

.forge-gold-balance strong {
  color: #898a90;
  font-size: 11px;
  font-weight: 750;
}

.primary-button,
.secondary-button {
  border: 0;
  cursor: pointer;
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 800;
}

.primary-button {
  width: 100%;
  color: #241b09;
  background: linear-gradient(180deg, #ffd96a, #f2ad35);
  box-shadow: inset 0 1px rgba(255,255,255,.55), 0 8px 18px rgba(0,0,0,.2);
}

.primary-button:hover {
  filter: brightness(1.04);
}

.secondary-button {
  color: #edf1fa;
  background: rgba(255,255,255,.11);
}

.compact {
  width: auto;
  flex: 1;
  padding: 11px 14px;
}

.loot-result {
  margin-top: 16px;
  min-height: 190px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.08);
}

.loot-result.empty {
  display: grid;
  place-items: center;
  color: #9faabd;
  text-align: center;
}

.hidden {
  display: none !important;
}

.rarity {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 900;
  background: rgba(255,255,255,.08);
}

#itemResult h2 {
  margin: 10px 0 8px;
}

.item-meta {
  display: flex;
  justify-content: space-between;
  color: #dce2ef;
  margin-bottom: 9px;
}

.compare {
  font-size: 14px;
  color: #aeb8ca;
  margin: 10px 0 16px;
}

.compare.up {
  color: #7ee7a1;
}

.compare.down {
  color: #ff9292;
}

.row {
  display: flex;
  gap: 8px;
}

.equipment-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.equipment-slot {
  min-height: 104px;
  padding: 13px;
  border-radius: 14px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.075);
}

.dungeon-relic-equipment-slot {
  grid-column: 1 / -1;
  margin-top: 10px;
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-color: rgba(221, 180, 98, .3);
  background: linear-gradient(135deg, rgba(221, 180, 98, .1), rgba(255,255,255,.045));
}

.relic-slot-icon {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(221, 180, 98, .13);
  border: 1px solid rgba(221, 180, 98, .24);
  font-size: 24px;
}

.relic-slot-copy {
  min-width: 0;
  flex: 1;
}

.dungeon-relic-equipment-slot .slot-label {
  margin-bottom: 5px;
  color: #d8bd80;
}

.dungeon-relic-equipment-slot .slot-name {
  margin-bottom: 3px;
}

.relic-name { color: #f1d590; }

.relic-slot-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 78px;
  padding: 9px 12px;
}

.dungeon-title-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.dungeon-relic-codex-button {
  border: 1px solid rgba(221, 180, 98, .34);
  border-radius: 10px;
  padding: 8px 11px;
  background: rgba(221, 180, 98, .1);
  color: #ead49f;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.dungeon-relic-codex-button:hover {
  background: rgba(221, 180, 98, .18);
}

.dungeon-relic-codex-button strong {
  margin-left: 4px;
  color: #fff0c4;
}

.dungeon-relic-modal { z-index: 38; }

.dungeon-relic-modal-card {
  width: min(960px, 100%);
  max-height: min(820px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dungeon-relic-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dungeon-relic-modal-head p { margin-bottom: 12px; }

.dungeon-relic-status {
  margin-bottom: 12px;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(255,255,255,.055);
  color: #abb5c7;
  font-size: 12px;
}

.dungeon-relic-status.ok { color: #8ee6aa; }
.dungeon-relic-status.warn { color: #f0ca7d; }
.dungeon-relic-status.error { color: #ff9c9c; }

.dungeon-relic-codex-grid {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-right: 4px;
}

.dungeon-relic-card {
  min-width: 0;
  padding: 13px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.045);
}

.dungeon-relic-card.acquired {
  border-color: rgba(221, 180, 98, .22);
  background: rgba(221, 180, 98, .065);
}

.dungeon-relic-card.equipped {
  border-color: rgba(241, 205, 120, .75);
  box-shadow: inset 0 0 0 1px rgba(241, 205, 120, .18);
}

.dungeon-relic-card.locked { opacity: .58; }

.dungeon-relic-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dungeon-relic-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255,255,255,.07);
  font-size: 20px;
  font-weight: 900;
}

.dungeon-relic-floor {
  color: #cbb67f;
  font-size: 11px;
  font-weight: 850;
}

.dungeon-relic-card h3 {
  margin: 10px 0 5px;
  color: #f0d898;
  font-size: 14px;
}

.dungeon-relic-card p { margin: 0; }

.dungeon-relic-source {
  color: #8f9aad !important;
  font-size: 11px !important;
}

.dungeon-relic-effect {
  min-height: 38px;
  padding-top: 8px;
  color: #d4dbe7 !important;
  font-size: 12px !important;
}

.dungeon-relic-power {
  margin: 7px 0;
  color: #f2cb75;
  font-size: 11px;
  font-weight: 850;
}

.dungeon-relic-research {
  margin: 7px 0;
  color: #b9c8e6;
  font-size: 11px;
  font-weight: 750;
}

.dungeon-relic-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.dungeon-relic-card .relic-research-button {
  background: #536f9b;
}

.dungeon-daily-limits {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 9px;
  color: #9ea9bb;
  font-size: 11px;
}

.dungeon-daily-limits strong { color: #e9c977; }

.dungeon-restriction-notice {
  margin-bottom: 9px;
  padding: 8px 10px;
  border: 1px solid rgba(221, 91, 91, .4);
  border-radius: 9px;
  background: rgba(151, 45, 45, .14);
  color: #ffb2b2;
  font-size: 12px;
  font-weight: 800;
}

.dungeon-relic-card button {
  width: 100%;
  border: 0;
  border-radius: 9px;
  padding: 8px 10px;
  background: #bb8d35;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.dungeon-relic-card button:disabled {
  cursor: default;
  background: rgba(255,255,255,.08);
  color: #8994a8;
}

.dungeon-relic-card.equipped button:disabled {
  background: rgba(221, 180, 98, .18);
  color: #f1d590;
}

.dungeon-relic-modal-actions { flex: 0 0 auto; margin-top: 14px; }

@media (max-width: 760px) {
  .dungeon-relic-codex-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dungeon-title-actions { justify-content: flex-start; }
}

@media (max-width: 520px) {
  .dungeon-relic-equipment-slot { align-items: flex-start; flex-wrap: wrap; }
  .relic-slot-button { width: 100%; }
  .dungeon-relic-modal { padding: 10px; }
  .dungeon-relic-modal-card { max-height: calc(100vh - 20px); padding: 17px; }
  .dungeon-relic-codex-grid { grid-template-columns: 1fr; }
}

.slot-label {
  color: #9da9bd;
  font-size: 12px;
  margin-bottom: 8px;
}

.slot-name {
  font-weight: 850;
  margin-bottom: 4px;
}

.slot-power {
  color: #c7d0df;
  font-size: 13px;
}

.inventory-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
}

.danger-link {
  border: 0;
  background: none;
  color: #ff8f8f;
  cursor: pointer;
  font-size: 12px;
}

.inventory-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.inventory-empty,
.inventory-item {
  padding: 12px 13px;
  border-radius: 13px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.065);
}

.inventory-empty {
  color: #9ea9bb;
}

.inventory-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.inventory-info {
  min-width: 0;
  flex: 1;
}

.inventory-name {
  font-weight: 800;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.inventory-meta {
  margin-top: 3px;
  color: #aeb8ca;
  font-size: 12px;
}

.inventory-power-comparison {
  font-weight: 900;
  white-space: nowrap;
}

.inventory-power-comparison.power-comparison-positive {
  color: #63dc8a;
}

.inventory-power-comparison.power-comparison-negative {
  color: #ff6f76;
}

.inventory-power-comparison.power-comparison-neutral {
  color: #aeb8ca;
}

.inventory-item button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 9px;
  padding: 8px 10px;
  cursor: pointer;
  background: rgba(255,255,255,.12);
  color: #fff;
}

/* Ranking */
.ranking-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ranking-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.ranking-mode-tab {
  min-width: 0;
  border: 0;
  border-radius: 9px;
  padding: 8px 6px;
  background: transparent;
  color: #aeb8ca;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.ranking-mode-tab.active {
  background: rgba(255, 211, 103, 0.13);
  color: #ffd463;
  box-shadow: inset 0 0 0 1px rgba(255, 211, 103, 0.18);
}

.ranking-mode-tab:focus-visible {
  outline: 2px solid rgba(255, 211, 103, 0.75);
  outline-offset: 2px;
}

.ranking-kicker {
  color: #7ee7a1;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
  margin-bottom: 4px;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  background: rgba(255,255,255,.07);
  color: #fff;
  cursor: pointer;
  font-size: 20px;
}

.ranking-status {
  margin: 10px 0 10px;
  color: #a5b0c4;
  font-size: 12px;
}

.ranking-list {
  display: grid;
  gap: 7px;
}

.rank-row {
  display: grid;
  grid-template-columns: 30px 30px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 42px;
  padding: 8px 9px;
  border-radius: 11px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.055);
}

.rank-row.me {
  border-color: rgba(255, 211, 103, .45);
  background: rgba(255, 211, 103, .09);
}

.rank-number {
  color: #aeb8ca;
  font-weight: 900;
  text-align: center;
}

.rank-row:nth-child(1) .rank-number { color: #ffd463; }
.rank-row:nth-child(2) .rank-number { color: #dfe5ee; }
.rank-row:nth-child(3) .rank-number { color: #e0a674; }

.rank-name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 750;
}

.rank-power {
  color: #dce4f2;
  font-size: 13px;
  font-weight: 850;
}

.rank-adventure-value {
  display: grid;
  justify-items: end;
  gap: 2px;
  line-height: 1.05;
}

.rank-adventure-value strong {
  font-size: 12px;
}

.rank-adventure-value small {
  color: #8f9aaf;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.my-rank-card {
  margin-top: 14px;
  padding: 13px;
  border-radius: 13px;
  border: 1px solid rgba(255, 211, 103, .28);
  background: rgba(255, 211, 103, .07);
  display: grid;
  gap: 4px;
}

.my-rank-card strong {
  font-size: 21px;
}

.my-rank-card > span:last-child {
  color: #b9c3d3;
  font-size: 13px;
}

.ranking-note {
  margin: 14px 2px 0;
  color: #8f9aaf;
  font-size: 11px;
  line-height: 1.55;
}

/* Nickname modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 9, 15, .76);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: min(420px, 100%);
  border-radius: 20px;
  padding: 26px;
  background: #171d2a;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 24px 70px rgba(0,0,0,.48);
}

.modal-badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(126, 231, 161, .12);
  color: #7ee7a1;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
}

.modal-card h2 {
  margin: 0 0 8px;
}

.modal-card p {
  margin: 0 0 18px;
  color: #9faabd;
  font-size: 13px;
  line-height: 1.55;
}

.nickname-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(255,255,255,.07);
  color: #fff;
}

.nickname-input::placeholder {
  color: #748098;
}

.nickname-error {
  min-height: 20px;
  padding-top: 6px;
  color: #ff9292;
  font-size: 12px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.modal-actions .primary-button,
.modal-actions .secondary-button {
  flex: 1;
  width: auto;
}

.r-common { color: #e2e5eb; }
.r-uncommon { color: #83df93; }
.r-rare { color: #7ebaff; }
.r-epic { color: #d395ff; }
.r-legendary { color: #ffc75e; }
.r-god { color: #ff5f7a; }
.r-ancient { color: #55e5d2; text-shadow: 0 0 10px rgba(85, 229, 210, .24); }

@media (max-width: 1120px) {
  .game-layout {
    grid-template-columns: minmax(310px, 380px) minmax(390px, 1fr);
  }

  .ranking-panel {
    grid-column: 1 / -1;
  }

  .ranking-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .layer-ui {
    padding: 12px;
  }

  .game-layout {
    grid-template-columns: 1fr;
  }

  .ranking-panel {
    grid-column: auto;
  }

  .ranking-list {
    grid-template-columns: 1fr;
  }

  .layer-character {
    opacity: .24;
  }

  .topbar {
    gap: 18px;
    flex-wrap: wrap;
  }

  .save-state {
    width: 100%;
    margin-left: 0;
  }
}

/* 화면 오른쪽 아래의 은은한 버전 표시 */
.game-version-label {
  position: fixed;
  right: 10px;
  bottom: 7px;
  z-index: 50;
  color: rgba(255, 255, 255, .45);
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .06em;
  pointer-events: none;
  user-select: none;
}

@media (max-width: 480px) {
  .equipment-grid {
    grid-template-columns: 1fr;
  }

  .loot-panel,
  .equipment-panel,
  .ranking-panel {
    padding: 16px;
  }

  .chest-button {
    height: 190px;
  }

  .chest-fallback {
    font-size: 105px;
  }
}

/* ============================================================
   1.5 · 브랜든 가문의 후원 50회 제작 쿠폰
   ============================================================ */

.brandon-sponsorship-card {
  position: relative;
  margin-top: 22px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(154, 112, 39, .24);
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 4%, rgba(220, 172, 69, .18), transparent 36%),
    linear-gradient(145deg, rgba(255, 254, 248, .98), rgba(247, 239, 220, .97));
  box-shadow: 0 12px 28px rgba(86, 62, 25, .09);
}

.brandon-sponsorship-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #d9a941, #7f5a1d);
}

.brandon-sponsorship-card-head,
.brandon-sponsorship-modal-top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.brandon-sponsorship-card-head h2 {
  margin: 3px 0 0;
  color: #45371f;
  font-size: 18px;
  line-height: 1.28;
}

.brandon-sponsorship-kicker {
  color: #9b7028;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .13em;
}

.brandon-sponsorship-count {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid rgba(151, 109, 36, .18);
  border-radius: 999px;
  color: #79551c;
  background: rgba(245, 225, 178, .8);
  font-size: 9px;
  font-weight: 900;
}

.brandon-sponsorship-description {
  position: relative;
  margin: 12px 0;
  color: #756b59;
  font-size: 11px;
  line-height: 1.58;
}

.brandon-sponsorship-facts {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.brandon-sponsorship-facts > div {
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid rgba(142, 103, 37, .11);
  border-radius: 11px;
  background: rgba(252, 246, 229, .82);
}

.brandon-sponsorship-facts span {
  color: #8a795d;
  font-size: 9px;
  font-weight: 800;
}

.brandon-sponsorship-facts strong {
  color: #65491d;
  font-size: 12px;
}

.brandon-sponsorship-use,
.brandon-sponsorship-close {
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  color: #fff;
  background: linear-gradient(135deg, #b9842d, #76521a);
}

.brandon-sponsorship-use:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.brandon-sponsorship-status {
  margin-top: 9px;
  padding: 9px 10px;
  border-radius: 10px;
  color: #7c6948;
  background: rgba(248, 238, 210, .9);
  font-size: 9px;
  line-height: 1.5;
}

.brandon-sponsorship-status.ok {
  color: #4f7045;
  background: rgba(229, 241, 224, .92);
}

.brandon-sponsorship-status.loading {
  color: #506a83;
  background: rgba(226, 234, 244, .9);
}

.brandon-sponsorship-status.warn {
  color: #85631c;
  background: rgba(250, 237, 199, .94);
}

.brandon-sponsorship-status.error {
  color: #9d4d42;
  background: rgba(249, 226, 222, .94);
}

.brandon-sponsorship-modal-card {
  width: min(560px, 100%);
  max-height: min(88vh, 760px);
  overflow-y: auto;
  border-color: rgba(177, 130, 45, .3);
  color: #403724;
  background:
    radial-gradient(circle at 92% 0%, rgba(221, 174, 73, .2), transparent 35%),
    linear-gradient(155deg, #fffef9, #f8eed7);
  box-shadow: 0 28px 90px rgba(58, 42, 17, .34);
}

.brandon-sponsorship-modal-card h2 {
  color: #44361e;
}

.brandon-sponsorship-modal-card p {
  color: #766c59;
}

.brandon-sponsorship-modal-badge {
  color: #8a611f;
  background: rgba(188, 139, 48, .12);
}

.brandon-sponsorship-seal {
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(153, 109, 36, .16);
  border-radius: 20px;
  background: linear-gradient(145deg, #fffaf0, #ead39f);
  box-shadow: 0 10px 24px rgba(104, 73, 24, .14);
  font-size: 31px;
}

@media (max-width: 480px) {
  .brandon-sponsorship-card,
  .brandon-sponsorship-modal-card {
    padding: 15px;
  }

  .brandon-sponsorship-card-head,
  .brandon-sponsorship-modal-top {
    align-items: center;
  }

  .brandon-sponsorship-card-head h2 {
    font-size: 16px;
  }
}


/* Gold / selling */
.gold-hint {
  margin-top: 8px;
  color: #9aa7bd;
  font-size: 12px;
  text-align: center;
}

.gold-hint:empty {
  display: none;
}

.forge-auto-craft {
  margin: 10px 0 14px;
}

.forge-auto-craft-button {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 0;
  border-radius: 14px;
  color: #503613;
  background: #f2b13a;
  background-image: none;
  box-shadow: none;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 0.15s ease, filter 0.15s ease;
}

.forge-auto-craft-button:hover:not(:disabled) {
  background: #f6bd4d;
  background-image: none;
  filter: none;
}

.forge-auto-craft-button.active {
  color: #503613;
  background: #e8a12f;
  background-image: none;
  box-shadow: none;
}

.has-common-button-skin .primary-button.forge-auto-craft-button {
  background-color: #f2b13a;
  background-image: none;
  box-shadow: none;
}

.has-common-button-skin .primary-button.forge-auto-craft-button:hover:not(:disabled) {
  background-color: #f6bd4d;
  background-image: none;
}

.has-common-button-skin .primary-button.forge-auto-craft-button.active {
  background-color: #e8a12f;
  background-image: none;
}

.forge-auto-craft-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* 2.0 · 검은맥 광석 촉매 */
.forge-catalyst-panel {
  margin: 0 0 15px;
  padding: 13px;
  border: 1px solid rgba(94, 74, 45, .13);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(252, 248, 239, .96), rgba(241, 236, 225, .92));
}

.forge-catalyst-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.forge-catalyst-head > div { display: grid; gap: 2px; text-align: left; }
.forge-catalyst-kicker { color: #92713d; font-size: 8px; font-weight: 950; letter-spacing: .13em; }
.forge-catalyst-head strong { color: #4e463b; font-size: 13px; }

.forge-catalyst-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #756b5d;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.forge-catalyst-toggle input { accent-color: #c08a2c; }

.forge-catalyst-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.forge-catalyst-chip {
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 5px;
  padding: 7px 8px;
  border: 1px solid rgba(91, 80, 64, .12);
  border-radius: 9px;
  color: #665d51;
  background: rgba(255, 255, 255, .66);
  font: inherit;
  font-size: 9px;
  cursor: pointer;
}

.forge-catalyst-chip strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.forge-catalyst-chip b { color: #4d463d; }
.forge-catalyst-chip.selected { border-color: var(--ore-color); box-shadow: inset 0 0 0 1px var(--ore-color); background: #fff; }
.forge-catalyst-status { margin: 9px 0 0; color: #847a6e; font-size: 9px; line-height: 1.45; text-align: left; }
.forge-catalyst-status.active { color: #8b5d16; font-weight: 800; }

/* 2.1 · 모든 제작품 즉시 보관 */
.forge-auto-store-notice {
  width: min(260px, 100%);
  margin: 10px auto;
  padding: 9px 12px;
  border: 1px solid rgba(194, 135, 23, .24);
  border-radius: 10px;
  color: #70501a;
  background: #fff8e5;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
  text-align: center;
}

.primary-button:disabled,
.secondary-button:disabled,
.sell-button:disabled {
  cursor: not-allowed;
  opacity: .48;
  filter: none;
}

.sell-button {
  border: 0;
  cursor: pointer;
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 800;
  color: #fff1c6;
  background: rgba(212, 151, 47, .18);
  border: 1px solid rgba(255, 197, 87, .26);
}

.sell-button:hover {
  background: rgba(212, 151, 47, .28);
}

.result-actions {
  flex-wrap: wrap;
}

.result-actions .compact {
  min-width: 88px;
}

.slot-actions {
  display: flex;
  gap: 7px;
  margin-top: 9px;
}

.slot-actions button {
  border: 0;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  color: #ffe6a8;
  background: rgba(255, 192, 75, .11);
  font-size: 11px;
  font-weight: 800;
}

.slot-actions .enhance-equipped-button,
.inventory-actions .enhance-inventory-button {
  color: #dfffe9;
  background: rgba(60, 175, 112, .18);
  border: 1px solid rgba(104, 224, 153, .24);
}

.slot-actions .enhance-equipped-button:hover,
.inventory-actions .enhance-inventory-button:hover {
  background: rgba(60, 175, 112, .29);
}

.inventory-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-left: auto;
}

.inventory-main-line {
  min-width: 0;
  flex: 1 1 auto;
}

.inventory-actions button {
  flex: 0 0 auto;
}

.inventory-actions .sell-inventory-button {
  color: #ffe2a0;
  background: rgba(215, 153, 47, .16);
}

.sell-price {
  color: #ffc85e;
  font-weight: 850;
}

.gold-flash {
  animation: goldFlash .45s ease;
}

@keyframes goldFlash {
  0% { transform: scale(1); }
  50% { transform: scale(1.13); }
  100% { transform: scale(1); }
}

.notice-toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(12px);
  min-width: 220px;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(10, 13, 21, .95);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  text-align: center;
  box-shadow: 0 14px 32px rgba(0,0,0,.35);
  opacity: 0;
  pointer-events: none;
  transition: .18s ease;
}

.notice-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.auto-craft-item-notice {
  position: fixed;
  z-index: 31;
  right: 18px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 11px;
  width: min(340px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 13px;
  color: #eef3ff;
  background: rgba(14, 19, 29, .96);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .38);
  opacity: 0;
  pointer-events: none;
  transform: translateX(18px);
  transition: opacity .2s ease, transform .2s ease;
}

.auto-craft-item-notice.show {
  opacity: 1;
  transform: translateX(0);
}

.auto-craft-item-notice-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 35px;
  height: 35px;
  border-radius: 10px;
  background: rgba(201, 165, 79, .14);
  font-size: 18px;
}

.auto-craft-item-notice-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.auto-craft-item-notice-copy strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auto-craft-item-notice-copy small {
  color: #9da9bd;
  font-size: 11px;
}

.brandon-sponsorship-notice-card {
  width: min(470px, 100%);
  text-align: center;
}

.brandon-sponsorship-notice-card .brandon-sponsorship-modal-top {
  text-align: left;
}

.brandon-sponsorship-notice-card > p {
  margin: 20px 0 22px;
  color: #51462f;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.7;
}

@media (max-width: 560px) {
  .auto-craft-item-notice {
    right: 16px;
    bottom: 16px;
  }
}


/* Item database icon support */
.item-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 10px 0 8px;
}

.item-heading h2 {
  margin: 0 !important;
}

.item-preview-icon,
.mini-item-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
}

.item-preview-icon {
  width: 54px;
  height: 54px;
  border-radius: 12px;
}

.mini-item-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
}

.item-preview-icon img,
.mini-item-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.item-preview-icon span {
  font-size: 27px;
}

.mini-item-icon span {
  font-size: 19px;
}

.slot-item-line,
.inventory-main-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slot-item-copy,
.inventory-info {
  min-width: 0;
  flex: 1;
}


/* ============================================================
   GAME TABS
   ============================================================ */

.game-tabs {
  width: min(1420px, 100%);
  margin: 0 auto 14px;
  display: flex;
  gap: 8px;
}

.game-tab {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 10px 18px;
  background: rgba(15, 19, 31, .7);
  color: #9ea9bc;
  cursor: pointer;
  font-weight: 850;
}

.game-tab.active {
  color: #221a08;
  border-color: transparent;
  background: linear-gradient(180deg, #ffd96a, #f2ad35);
}

/* ============================================================
   DUNGEON
   ============================================================ */

.dungeon-screen {
  width: min(1420px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(290px, .7fr);
  gap: 18px;
  min-height: calc(100vh - 190px);
}

/* 2.0 · 던전 하위 탭 / 검은맥 심층광산 */
.dungeon-mode-tabs {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  padding: 7px;
  border-radius: 17px;
  height: 58px;
  min-height: 58px;
  max-height: 58px;
  align-items: center;
  align-self: start;
  box-sizing: border-box;
}

.dungeon-mode-button {
  min-width: 148px;
  width: 148px;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted-text);
  background: transparent;
  font: inherit;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  box-sizing: border-box;
  cursor: pointer;
}

.dungeon-mode-button:focus-visible {
  outline: 2px solid rgba(189, 151, 44, 0.45);
  outline-offset: -3px;
}

.dungeon-mode-button:hover {
  background: rgba(173, 143, 58, 0.08);
}

.dungeon-mode-button.active,
#deepMineModeButton.active {
  border-color: rgba(189, 151, 44, 0.34);
  background: rgba(246, 224, 158, 0.48);
  color: #795813;
}

.deep-mine-kicker { color: #c6a2ef; }
.deep-mine-floor-panel { margin-top: 14px; padding: 12px 14px; border: 1px solid rgba(193,157,232,.15); border-radius: 13px; background: rgba(138,101,173,.065); }
.deep-mine-floor-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 5px; margin-top: 10px; }
.deep-mine-floor-button { min-width: 0; min-height: 31px; padding: 4px 2px; border: 1px solid rgba(255,255,255,.07); border-radius: 7px; color: #6f7888; background: rgba(255,255,255,.025); font: inherit; font-size: 9px; font-weight: 850; cursor: pointer; }
.deep-mine-floor-button.unlocked { color: #b7c1cf; border-color: rgba(190,154,225,.18); }
.deep-mine-floor-button.cleared { color: #91d9ac; }
.deep-mine-floor-button.cleared::after { content: " ✓"; font-size: 7px; }
.deep-mine-floor-button.locked::after { content: " 🔒"; font-size: 7px; }
.deep-mine-floor-button.active { color: #281d34; border-color: transparent; background: #bea0e0; }
.deep-mine-floor-button:disabled { cursor: wait; opacity: .68; }

.deep-mine-scene {
  --dungeon-background: none;
  background:
    linear-gradient(rgba(10,9,15,.42), rgba(8,8,13,.76)),
    radial-gradient(circle at 46% 38%, rgba(148,96,187,.28), transparent 38%),
    linear-gradient(180deg, #2b2634, #101016);
}

.deep-mine-monster-stage { min-height: 300px; }
.deep-mine-monster-fallback { filter: drop-shadow(0 0 28px rgba(180,118,229,.35)) drop-shadow(0 18px 18px rgba(0,0,0,.35)); }
.deep-mine-status.ok { color: #86e1a7; }
.deep-mine-status.warn { color: #ffd176; }
.deep-mine-status.error { color: #ff9898; }
.deep-mine-status.loading { color: #c6a2ef; }
.deep-mine-excavate-button { color: #241c2f; background: linear-gradient(180deg, #d4b5f2, #a17bc9); }
.deep-mine-stop-button.secondary-button {
  width: 100%;
  color: #7d2929;
  border-color: rgba(173, 69, 69, .24);
  background: #f7e2df;
}
.deep-mine-stop-button.secondary-button:hover:not(:disabled) { background: #f1d4d0; }

.deep-mine-info-list { display: grid; gap: 8px; margin: 13px 0 0; }
.deep-mine-info-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 9px; background: rgba(93,105,124,.055); }
.deep-mine-info-list dt { color: #566276; font-size: 10px; font-weight: 800; }
.deep-mine-info-list dd { margin: 0; color: #303744; font-size: 11px; font-weight: 900; text-align: right; }
.deep-mine-ore-wallet { display: grid; gap: 6px; margin-top: 12px; }
.deep-mine-ore-row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid color-mix(in srgb, var(--ore-color) 38%, rgba(91,100,116,.24)); border-radius: 9px; background: rgba(90,101,119,.035); }
.deep-mine-ore-icon { color: color-mix(in srgb, var(--ore-color) 65%, #3f4857 35%); text-align: center; }
.deep-mine-ore-row > span:nth-child(2) { min-width: 0; display: grid; gap: 1px; }
.deep-mine-ore-row strong { color: #3f4857; font-size: 10px; font-weight: 850; }
.deep-mine-ore-row small { color: #5f6c7f; font-size: 8px; font-weight: 700; }
.deep-mine-ore-row b { color: color-mix(in srgb, var(--ore-color) 48%, #29313e 52%); font-size: 12px; }
.deep-mine-help { margin: 10px 0 0; color: #586579; font-size: 9px; font-weight: 700; line-height: 1.55; }
.deep-mine-title-track { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.deep-mine-title-row { min-width: 0; display: flex; align-items: center; gap: 7px; padding: 7px; border-radius: 8px; background: rgba(101,86,123,.045); opacity: 1; }
.deep-mine-title-row > span { width: 23px; height: 23px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 7px; background: rgba(126,103,157,.12); color: #675477; font-size: 8px; font-weight: 900; }
.deep-mine-title-row > div { min-width: 0; display: grid; gap: 1px; }
.deep-mine-title-row strong { overflow: hidden; color: #3f4858; white-space: nowrap; text-overflow: ellipsis; font-size: 8px; font-weight: 850; }
.deep-mine-title-row small { color: #667286; font-size: 7px; font-weight: 700; }
.deep-mine-title-row.earned { opacity: 1; background: rgba(128,203,156,.07); }
.deep-mine-title-row.earned > span { color: #79d59b; }

@media (max-width: 720px) {
  .dungeon-mode-tabs {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 4px;
    height: auto;
    max-height: none;
  }
  .dungeon-mode-button {
    min-width: 0;
    width: 100%;
    max-width: none;
    padding-inline: 4px;
    font-size: clamp(10px, 2.8vw, 13px);
  }
  .deep-mine-floor-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .deep-mine-monster-stage { min-height: 210px; }
  .forge-catalyst-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
  .dungeon-mode-button { padding-inline: 2px; }
  .deep-mine-title-track { grid-template-columns: 1fr; }
}

.dungeon-main,
.dungeon-info-panel {
  border-radius: 22px;
}

.dungeon-main {
  padding: 24px;
}

.dungeon-side {
  display: grid;
  align-content: start;
  gap: 14px;
}

.dungeon-info-panel {
  padding: 18px;
}

.dungeon-title-row,
.dungeon-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dungeon-title-row h1,
.dungeon-side-head h2 {
  margin: 0;
}
/* 이 부분을 새로 추가 */
.dungeon-recommended-power {
  font-size: 13px;
  font-weight: 600;
  color: #777;
  white-space: nowrap;
}
.dungeon-kicker {
  color: #7ee7a1;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .16em;
  margin-bottom: 5px;
}

.wave-badge {
  padding: 9px 12px;
  border-radius: 11px;
  background: rgba(255,255,255,.06);
  color: #aab5c7;
  font-size: 12px;
}

.wave-badge strong {
  color: #fff;
  margin-left: 5px;
}

.dungeon-floor-replay-panel {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 13px;
  background: rgba(255,255,255,.035);
}

.dungeon-floor-replay-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dungeon-floor-replay-copy strong {
  font-size: 12px;
}

.dungeon-floor-replay-copy span {
  color: #909caf;
  font-size: 10px;
  text-align: right;
}

.dungeon-floor-tabs {
  margin-top: 9px;
}

.dungeon-floor-tab.cleared::after {
  content: " ✓";
  color: #4bb77a;
  font-size: 9px;
}

.dungeon-floor-tab.locked::after {
  content: " 🔒";
  font-size: 8px;
  filter: grayscale(1);
}

.dungeon-floor-tab:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.dungeon-scene {
  --dungeon-background: none;

  margin-top: 18px;
  min-height: 520px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
  padding: 22px;

  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px minmax(260px, .72fr);
  align-items: center;
  gap: 18px;

  background:
    linear-gradient(rgba(11,14,23,.50), rgba(11,14,23,.68)),
    var(--dungeon-background),
    radial-gradient(circle at 50% 34%, rgba(98,78,52,.32), transparent 36%),
    linear-gradient(180deg, #252d3a, #121823);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.enemy-card,
.player-battle-card {
  border-radius: 17px;
  background: rgba(13, 17, 27, .74);
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: 0 14px 34px rgba(0,0,0,.22);
}

.enemy-card {
  background: transparent;
  border: none;
  box-shadow: none;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity .2s ease, transform .2s ease;
}

.dungeon-scene.wave-transition-out .enemy-card {
  opacity: 0;
  transform: translateY(8px) scale(.97);
}

.player-battle-card {
  padding: 20px;
  align-self: end;
}

.enemy-card h2,
.player-battle-card h2 {
  margin: 6px 0 0;
}

.enemy-role,
.battle-label {
  color: #77dfa0;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .13em;
}

.enemy-role.boss {
  color: #ff8d76;
}

.monster-stage {
  min-height: 280px;
  display: grid;
  place-items: center;
}

#dungeonEnemyImage {
  display: none;
  width: min(86%, 380px);
  max-height: 320px;
  object-fit: contain;
  filter: drop-shadow(0 18px 24px rgba(0,0,0,.42));
}

.monster-fallback {
  font-size: clamp(100px, 12vw, 190px);
  filter: drop-shadow(0 18px 18px rgba(0,0,0,.28));
}

.versus-mark {
  text-align: center;
  color: rgba(255,255,255,.36);
  font-size: 30px;
  font-weight: 950;
  font-style: italic;
}

.hp-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #aeb8c9;
  font-size: 12px;
  margin: 11px 0 7px;
}

.hp-label strong {
  color: #fff;
}

.hp-track {
  width: 100%;
  height: 13px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.08);
}

.hp-fill {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  transition: width .18s ease;
}

.hp-track.enemy .hp-fill {
  background: linear-gradient(90deg, #d44755, #ff6c72);
}

.hp-track.player .hp-fill {
  background: linear-gradient(90deg, #3caf79, #6ee6a5);
}

.dungeon-actions {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.dungeon-status {
  min-height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255,255,255,.045);
  color: #c0c9d8;
  font-size: 13px;
  text-align: center;
  padding: 8px 12px;
}

.dungeon-side-head > span {
  color: #909caf;
  font-size: 11px;
}

.dungeon-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.dungeon-stats-grid > div {
  min-width: 0;
  padding: 11px;
  border-radius: 11px;
  background: rgba(255,255,255,.05);
}

.dungeon-stats-grid span {
  display: block;
  color: #9da8ba;
  font-size: 10px;
  margin-bottom: 5px;
}

.dungeon-stats-grid strong {
  font-size: 19px;
}

.dungeon-progress {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.dungeon-progress-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 11px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.055);
}

.dungeon-progress-step.current {
  border-color: rgba(255,207,91,.44);
  background: rgba(255,207,91,.075);
}

.dungeon-progress-step.cleared {
  opacity: .64;
}

.dungeon-progress-step.boss .progress-dot {
  color: #ff9b85;
}

.progress-dot {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: rgba(255,255,255,.075);
  color: #c8d1df;
  font-weight: 900;
}

.dungeon-progress-step.current .progress-dot {
  color: #2b2109;
  background: #ffc85b;
}

.progress-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.progress-copy strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-copy span {
  color: #8f9baf;
  font-size: 10px;
}

.battle-log-panel {
  min-height: 230px;
}

.battle-log {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.battle-log-row {
  padding: 8px 9px;
  border-radius: 9px;
  background: rgba(255,255,255,.035);
  color: #aeb8c8;
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 1020px) {
  .dungeon-screen {
    grid-template-columns: 1fr;
  }

  .dungeon-scene {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .versus-mark {
    font-size: 21px;
  }

  .player-battle-card {
    align-self: auto;
  }

  .monster-stage {
    min-height: 220px;
  }
}

@media (max-width: 520px) {
  #dungeonEnemyImage {
    width: min(92%, 310px);
    max-height: 260px;
  }

  .game-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .dungeon-main {
    padding: 16px;
  }

  .dungeon-title-row {
    align-items: flex-start;
  }

  .dungeon-title-row h1 {
    font-size: 22px;
  }

  .dungeon-stats-grid {
    grid-template-columns: 1fr;
  }

  .dungeon-floor-replay-copy {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .dungeon-floor-replay-copy span {
    text-align: left;
  }

  .dungeon-floor-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


/* ============================================================
   FLOOR CONQUEST
   ============================================================ */

.conquest-panel {
  position: relative;
  overflow: hidden;
}

.conquest-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 88% 10%, rgba(255, 201, 76, .10), transparent 28%);
}

.conquest-kicker {
  color: #ffc85b;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .14em;
  margin-bottom: 3px;
}

.conquest-floor-tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.conquest-floor-tab {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 9px;
  background: rgba(255, 255, 255, .04);
  color: #98a5b8;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.conquest-floor-tab:hover:not(:disabled) {
  border-color: rgba(255, 202, 86, .30);
  color: #ffd675;
}

.conquest-floor-tab.active {
  border-color: rgba(255, 202, 86, .38);
  background: rgba(255, 202, 86, .12);
  color: #ffd675;
}

.conquest-floor-tab:disabled {
  cursor: wait;
  opacity: .58;
}

.conquest-server-status {
  position: relative;
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255,255,255,.04);
  color: #9ca9bc;
  font-size: 10px;
}

.conquest-server-status.ok {
  color: #79dfa0;
}

.conquest-server-status.warn {
  color: #ffd16f;
}

.conquest-server-status.error {
  color: #ff9292;
}

.conquest-owner-card {
  position: relative;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border-radius: 13px;
  border: 1px solid rgba(255, 202, 86, .22);
  background: rgba(255, 202, 86, .065);
}

.conquest-owner-card.empty {
  border-style: dashed;
  opacity: .84;
}

.conquest-crown {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255, 202, 86, .10);
  font-size: 20px;
}

.conquest-owner-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.conquest-owner-copy span {
  color: #a7b1c2;
  font-size: 10px;
}

.conquest-owner-copy strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.conquest-owner-copy small {
  color: #d8bf7a;
  font-size: 10px;
}

.conquest-message {
  position: relative;
  margin: 10px 0;
  color: #aeb8c8;
  font-size: 11px;
  line-height: 1.5;
}

.conquest-battle {
  position: relative;
  margin: 11px 0;
  display: grid;
  grid-template-columns: 1fr 28px 1fr;
  align-items: center;
  gap: 8px;
}

.conquest-fighter {
  min-width: 0;
  padding: 9px;
  border-radius: 10px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.055);
}

.conquest-fighter-head {
  display: grid;
  gap: 2px;
}

.conquest-fighter-head span {
  color: #8996aa;
  font-size: 9px;
}

.conquest-fighter-head strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 11px;
}

.conquest-vs {
  text-align: center;
  color: rgba(255,255,255,.33);
  font-size: 11px;
  font-weight: 950;
  font-style: italic;
}

.conquest-battle-status {
  position: relative;
  min-height: 28px;
  margin: 8px 0;
  color: #c0c9d7;
  font-size: 10px;
  line-height: 1.5;
}

.conquest-my-rule {
  position: relative;
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 11px;
  border-radius: 11px;
  border: 1px solid rgba(255, 202, 86, .20);
  background: rgba(255, 202, 86, .055);
}

.conquest-my-rule strong {
  color: #ffd675;
  font-size: 12px;
}

.conquest-my-rule span {
  color: #9ca8ba;
  font-size: 10px;
  line-height: 1.5;
}

.conquest-my-rule .secondary-button {
  padding: 9px 10px;
  font-size: 10px;
}

@media (max-width: 520px) {
  .conquest-battle {
    grid-template-columns: 1fr;
  }

  .conquest-vs {
    padding: 2px 0;
  }
}


/* ============================================================
   REGION TERRITORY WAR
   ============================================================ */

.territory-screen {
  width: min(1420px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, .7fr);
  gap: 18px;
  min-height: calc(100vh - 190px);
  align-content: start;
}

.territory-map-panel,
.territory-panel {
  border-radius: 22px;
}

.territory-map-panel {
  padding: 22px;
}

.territory-side {
  display: grid;
  align-content: start;
  gap: 14px;
}

/* ==========================================================
   지역 보스 파티 원정대 (0.92)
   ========================================================== */
.territory-mode-tabs {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  padding: 7px;
  border-radius: 17px;
  height: 58px;
  min-height: 58px;
  max-height: 58px;
  align-items: center;
  align-self: start;
  box-sizing: border-box;
}

.territory-mode-button {
  min-width: 148px;
  width: 148px;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted-text);
  font: inherit;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  box-sizing: border-box;
  cursor: pointer;
}

.territory-mode-button:focus-visible {
  outline: 2px solid rgba(189, 151, 44, 0.45);
  outline-offset: -3px;
}

.territory-mode-button:hover {
  background: rgba(173, 143, 58, 0.08);
}

.territory-mode-button.active {
  border-color: rgba(189, 151, 44, 0.34);
  background: rgba(246, 224, 158, 0.48);
  color: #795813;
}

.region-boss-mode {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.65fr);
  gap: 18px;
  align-items: start;
}

.region-boss-main {
  min-width: 0;
  padding: 22px;
  border-radius: 22px;
}

.region-boss-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.region-boss-heading h1 {
  margin: 0;
  font-size: 2em;
}

.region-boss-heading p,
.region-boss-info p {
  color: var(--muted-text);
  line-height: 1.55;
}

.region-boss-heading p {
  margin: 6px 0 0;
  font-size: 12px;
}

.region-boss-region-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.region-boss-region-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  align-content: center;
  min-width: 0;
  padding: 10px 7px;
  border: 1px solid var(--soft-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted-text);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.region-boss-region-button small {
  color: inherit;
  font-size: 9px;
  font-weight: 800;
  opacity: 0.7;
}

.region-boss-region-button.closed {
  border-color: rgba(135, 139, 148, 0.22);
  background: rgba(242, 243, 246, 0.78);
  color: #90949d;
}

.region-boss-region-button.closed::before {
  content: "\1F512";
  font-size: 10px;
  opacity: 0.62;
}

.region-boss-region-button.closed.active {
  border-color: rgba(135, 139, 148, 0.38);
  background: #eceef2;
  color: #6f747e;
}

.region-boss-region-button.active {
  border-color: rgba(197, 145, 31, 0.55);
  background: #fff3d3;
  color: #825b08;
}

.region-boss-region-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.region-boss-stage {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1fr);
  gap: 24px;
  align-items: center;
  min-height: 360px;
  padding: 24px;
  border: 1px solid rgba(173, 143, 58, 0.18);
  border-radius: 19px;
  background: linear-gradient(145deg, rgba(250, 247, 239, 0.96), rgba(239, 237, 232, 0.94));
}

.region-boss-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 280px;
}

.region-boss-visual::after {
  position: absolute;
  right: 12%;
  bottom: 7%;
  left: 12%;
  height: 28px;
  border-radius: 50%;
  background: rgba(36, 31, 25, 0.17);
  filter: blur(12px);
  content: "";
}

#regionBossImage,
.region-boss-fallback {
  position: relative;
  z-index: 1;
  width: min(100%, 300px);
  height: 280px;
  object-fit: contain;
  filter: drop-shadow(0 18px 18px rgba(31, 25, 18, 0.2));
}

.region-boss-fallback {
  display: grid;
  place-items: center;
  font-size: 132px;
}

.region-boss-info h2 {
  margin: 7px 0 5px;
  font-size: clamp(24px, 2.7vw, 34px);
}

.region-boss-hp-label,
.region-boss-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  font-size: 13px;
}

.region-boss-hp-track {
  margin-top: 8px;
}

.region-boss-meta {
  margin-top: 14px;
  color: var(--muted-text);
}

.region-boss-room-status {
  margin-top: 14px;
  padding: 13px 15px;
  border-radius: 13px;
  background: rgba(245, 245, 247, 0.86);
  color: var(--muted-text);
  text-align: center;
}

.region-boss-room-status.victory {
  background: rgba(225, 247, 233, 0.92);
  color: #1c7a48;
}

.region-boss-room-status.failed {
  background: rgba(255, 234, 234, 0.94);
  color: #ad3838;
}

.region-boss-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}

.region-boss-actions > button {
  flex: 1 1 150px;
}

.region-boss-reward-workshop {
  display: grid;
  gap: 10px;
}

.region-boss-reward-wallet-status {
  padding: 9px 10px;
  border-radius: 10px;
  color: #75674f;
  background: rgba(153, 119, 53, .08);
  font-size: 10px;
  font-weight: 700;
}

.region-boss-treasure-row,
.region-boss-fragment-card {
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid rgba(120, 91, 39, .14);
  border-radius: 12px;
  background: rgba(255, 252, 244, .84);
}

.region-boss-treasure-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.region-boss-ore-loot-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.region-boss-ore-loot-table span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 9px;
  color: #66583f;
  background: rgba(122, 95, 45, .07);
  font-size: 10px;
}

.region-boss-ore-loot-table b { font-weight: 800; }
.region-boss-ore-loot-table em { color: #a26d16; font-style: normal; font-weight: 900; }

.region-boss-treasure-row > div,
.region-boss-fragment-card > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #66583f;
  font-size: 11px;
}

.region-boss-fragment-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(94, 73, 38, .12);
}

.region-boss-fragment-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b98420, #e3bb55);
  transition: width .2s ease;
}

.region-boss-fragment-card small {
  color: #88775d;
  font-size: 10px;
}

.region-boss-side {
  display: grid;
  align-content: start;
  gap: 14px;
}

.region-boss-members,
.region-boss-room-list {
  display: grid;
  gap: 8px;
}

.region-boss-member,
.region-boss-room-card {
  padding: 12px;
  border: 1px solid var(--soft-border);
  border-radius: 12px;
  background: rgba(248, 248, 249, 0.86);
}

.region-boss-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.region-boss-member > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.region-boss-member > div:first-child span {
  color: var(--muted-text);
  font-size: 12px;
}

.region-boss-member-result {
  display: grid;
  flex: 0 0 auto;
  gap: 3px;
  text-align: right;
}

.region-boss-member-result small {
  margin-top: 0;
}

.region-boss-member.loot-winner {
  border-color: rgba(198, 147, 33, 0.58);
  background: linear-gradient(135deg, rgba(255, 247, 218, 0.98), rgba(255, 252, 241, 0.94));
  box-shadow: 0 8px 22px rgba(139, 96, 13, 0.12);
}

.region-boss-dice-roll {
  color: #a66a00;
  font-size: 16px;
}

.region-boss-loot-result {
  display: grid;
  gap: 4px;
  margin-top: 9px;
  padding: 10px 12px;
  border: 1px solid rgba(198, 147, 33, 0.36);
  border-radius: 11px;
  background: rgba(255, 249, 226, 0.92);
  color: #6f5112;
}

.region-boss-loot-result small {
  color: #9d7119;
  font-weight: 800;
}

.region-boss-loot-result.no-drop {
  border-color: rgba(118, 111, 96, 0.3);
  background: rgba(247, 244, 236, 0.94);
  color: #655f53;
}

.region-boss-loot-result.no-drop small {
  color: #777064;
}

.region-boss-loot-name {
  color: #8b5a00;
  font-size: 15px;
}

.region-boss-member-head,
.region-boss-room-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.region-boss-member small,
.region-boss-room-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted-text);
}

.region-boss-ready {
  color: #17824b;
  font-size: 12px;
  font-weight: 800;
}

.region-boss-waiting {
  color: #a17010;
  font-size: 12px;
  font-weight: 800;
}

.region-boss-room-card button {
  width: 100%;
  margin-top: 9px;
  padding: 9px 11px;
  border: 1px solid rgba(189, 151, 44, 0.34);
  border-radius: 9px;
  background: #fff3d3;
  color: #795813;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.region-boss-empty {
  padding: 18px 8px;
  color: var(--muted-text);
  text-align: center;
}

@media (max-width: 1020px) {
  .region-boss-mode {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .territory-mode-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .territory-mode-button {
    min-width: 0;
    width: 100%;
    max-width: none;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    padding-inline: 4px;
    font-size: clamp(11px, 3.25vw, 14px);
  }

  .region-boss-main {
    padding: 14px;
  }

  .region-boss-region-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .region-boss-stage {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 16px;
  }

  .region-boss-visual,
  #regionBossImage,
  .region-boss-fallback {
    min-height: 210px;
    height: 210px;
  }

  .region-boss-fallback {
    font-size: 100px;
  }
}

.territory-panel {
  padding: 17px;
}

.territory-heading,
.territory-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.territory-heading h1,
.territory-panel-head h2 {
  margin: 0;
}

.territory-heading p {
  margin: 6px 0 0;
  color: #9da9bb;
  font-size: 12px;
}

.territory-kicker {
  margin-bottom: 4px;
  color: #ffc85b;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .15em;
}

.territory-server-status {
  margin-top: 13px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  color: #9da9bb;
  font-size: 10px;
}

.territory-server-status.ok {
  color: #7ee7a1;
}

.territory-server-status.warn {
  color: #ffd16f;
}

.territory-server-status.error {
  color: #ff9292;
}

.territory-map {
  position: relative;
  min-height: 690px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.09);
  background:
    radial-gradient(circle at 53% 33%, rgba(76, 102, 83, .32), transparent 21%),
    radial-gradient(circle at 28% 22%, rgba(91, 111, 137, .23), transparent 20%),
    radial-gradient(circle at 72% 63%, rgba(120, 77, 54, .18), transparent 20%),
    linear-gradient(145deg, #283244, #182131 58%, #111824);
}

.territory-map::before,
.territory-map::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 45% 55% 42% 58%;
  border: 1px solid rgba(255,255,255,.055);
  background: rgba(123, 141, 117, .07);
}

.territory-map::before {
  width: 68%;
  height: 63%;
  left: 9%;
  top: 18%;
  transform: rotate(-5deg);
}

.territory-map::after {
  width: 35%;
  height: 44%;
  right: 5%;
  top: 10%;
  transform: rotate(14deg);
}

#territoryMapImage {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.territory-map-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .62;
  background:
    linear-gradient(31deg, transparent 48%, rgba(255,255,255,.025) 50%, transparent 52%),
    linear-gradient(-22deg, transparent 48%, rgba(255,255,255,.018) 50%, transparent 52%);
  background-size: 90px 90px, 120px 120px;
}

.territory-routes {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: .45;
  background:
    linear-gradient(24deg, transparent 47%, rgba(215,195,145,.19) 48%, rgba(215,195,145,.19) 49%, transparent 50%) 12% 43% / 34% 20% no-repeat,
    linear-gradient(-28deg, transparent 47%, rgba(215,195,145,.16) 48%, rgba(215,195,145,.16) 49%, transparent 50%) 45% 48% / 35% 24% no-repeat,
    linear-gradient(18deg, transparent 47%, rgba(215,195,145,.14) 48%, rgba(215,195,145,.14) 49%, transparent 50%) 48% 18% / 30% 30% no-repeat;
}

.territory-region-nodes {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.territory-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 92px;
  min-height: 72px;
  padding: 7px 6px;
  display: grid;
  justify-items: center;
  gap: 2px;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(13,17,27,.90);
  color: #e9edf5;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,.20);
}

.territory-node:hover {
  transform: translate(-50%, -50%) scale(1.045);
}

.territory-node.selected {
  outline: 2px solid rgba(255,206,88,.82);
  outline-offset: 2px;
}

.territory-node.mine {
  border-color: rgba(95, 220, 147, .55);
  background: rgba(23, 67, 49, .92);
}

.territory-node.enemy {
  border-color: rgba(232, 100, 100, .42);
  background: rgba(68, 32, 38, .91);
}

.territory-node.neutral {
  border-style: dashed;
}

.territory-node-icon {
  font-size: 22px;
}

.territory-node-number {
  position: absolute;
  left: 5px;
  top: 5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  color: #bac4d3;
  font-size: 8px;
  font-weight: 900;
}

.territory-node-name {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 9px;
  font-weight: 850;
}

.territory-node-owner {
  max-width: 74px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #aeb9ca;
  font-size: 8px;
}

.territory-node.mine .territory-node-owner {
  color: #8ee8ae;
}

.territory-node.enemy .territory-node-owner {
  color: #ffaaaa;
}

.territory-map-legend {
  position: absolute;
  z-index: 6;
  left: 12px;
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(10,13,21,.82);
  border: 1px solid rgba(255,255,255,.08);
  color: #aeb8c8;
  font-size: 9px;
}

.territory-map-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7f8a9b;
}

.legend-dot.mine {
  background: #63da93;
}

.legend-dot.enemy {
  background: #e36970;
}

.territory-income-stats,
.territory-detail-grid {
  margin-top: 13px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.territory-income-stats > div,
.territory-detail-grid > div {
  min-width: 0;
  padding: 9px;
  border-radius: 10px;
  background: rgba(255,255,255,.045);
}

.territory-income-stats span,
.territory-detail-grid span {
  display: block;
  margin-bottom: 4px;
  color: #8f9bad;
  font-size: 9px;
}

.territory-income-stats strong,
.territory-detail-grid strong {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
}

.territory-income-panel .primary-button {
  margin-top: 10px;
}

.territory-helper {
  margin: 8px 1px 0;
  color: #818da1;
  font-size: 9px;
  line-height: 1.45;
}

.territory-selected-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  font-size: 20px;
}

.territory-action-message {
  margin: 10px 0;
  min-height: 32px;
  color: #aeb8c7;
  font-size: 10px;
  line-height: 1.5;
}

.territory-karma-notice {
  margin-top: 10px;
  padding: 10px 11px;
  border: 1px solid rgba(205, 86, 112, .24);
  border-radius: 10px;
  background: rgba(205, 86, 112, .08);
  color: #d9a3ae;
}

.territory-karma-notice strong,
.territory-karma-notice span {
  display: block;
}

.territory-karma-notice strong {
  color: #ffb0bd;
  font-size: 11px;
}

.territory-karma-notice span {
  margin-top: 3px;
  font-size: 9px;
  line-height: 1.5;
}

.territory-panel .secondary-button {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  font-size: 10px;
}

.territory-abandon-button {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid rgba(198, 68, 68, .22);
  border-radius: 12px;
  color: #a84242;
  background: rgba(198, 68, 68, .06);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.territory-abandon-button:hover {
  background: rgba(198, 68, 68, .11);
}

.territory-abandon-button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.territory-battle-panel {
  border-color: rgba(255,199,84,.20);
}

.territory-battle-fighters {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 30px 1fr;
  align-items: center;
  gap: 7px;
}

.territory-fighter {
  min-width: 0;
  padding: 9px;
  border-radius: 10px;
  background: rgba(255,255,255,.04);
}

.territory-fighter > span {
  display: block;
  color: #8f9bad;
  font-size: 8px;
}

.territory-fighter > strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 10px;
}

.territory-battle-vs {
  text-align: center;
  color: rgba(255,255,255,.34);
  font-size: 10px;
  font-weight: 950;
  font-style: italic;
}

.territory-battle-status {
  margin-top: 10px;
  min-height: 30px;
  color: #b8c1cf;
  font-size: 10px;
  line-height: 1.45;
}

.territory-owner-list {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.territory-owner-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 9px;
  background: rgba(255,255,255,.035);
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.territory-owner-row.mine {
  border-color: rgba(92, 218, 143, .25);
  background: rgba(59, 177, 112, .07);
}

.territory-owner-row-icon {
  text-align: center;
  font-size: 17px;
}

.territory-owner-row-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.territory-owner-row-copy strong,
.territory-owner-row-copy small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.territory-owner-row-copy strong {
  font-size: 10px;
}

.territory-owner-row-copy small {
  color: #8996a9;
  font-size: 8px;
}

.territory-owner-row.mine small {
  color: #78dfa0;
}

.territory-owner-row-income {
  color: #ffc85b;
  font-size: 9px;
  font-weight: 850;
  text-align: right;
}

.territory-owner-row-income small {
  display: block;
  margin-top: 2px;
  color: #d98d9e;
  font-size: 8px;
}

@media (max-width: 1020px) {
  .territory-screen {
    grid-template-columns: 1fr;
  }

  .territory-map {
    min-height: 620px;
  }
}

@media (max-width: 620px) {
  .game-tabs {
    grid-template-columns: repeat(3, 1fr);
  }

  .game-tab {
    padding: 10px 6px;
    font-size: 11px;
  }

  .territory-map-panel,
  .territory-panel {
    padding: 14px;
  }

  .territory-map {
    min-height: 520px;
  }

  .territory-node {
    width: 70px;
    min-height: 62px;
  }

  .territory-node-name {
    font-size: 8px;
  }

  .territory-income-stats,
  .territory-detail-grid {
    grid-template-columns: 1fr;
  }

  .territory-battle-fighters {
    grid-template-columns: 1fr;
  }

  .territory-battle-vs {
    padding: 2px 0;
  }
}


/* ============================================================
   ONLINE PLAYER AVATAR
   ============================================================ */

.rank-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
}

.rank-avatar img {
  width: 100%;
  height: 100%;
  display: none;
  object-fit: cover;
}

.rank-avatar span {
  font-size: 15px;
  line-height: 1;
}

.avatar-modal-card {
  width: min(520px, 100%);
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 6px;
}

.avatar-choice {
  min-width: 0;
  padding: 9px;
  display: grid;
  justify-items: center;
  gap: 7px;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.045);
  color: #fff;
  cursor: pointer;
}

.avatar-choice:hover {
  border-color: rgba(255,211,103,.42);
  background: rgba(255,211,103,.065);
}

.avatar-choice.selected {
  border-color: rgba(255,211,103,.8);
  background: rgba(255,211,103,.11);
  box-shadow: inset 0 0 0 1px rgba(255,211,103,.18);
}

.avatar-choice-visual {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 11px;
  background: rgba(255,255,255,.055);
}

.avatar-choice-visual img {
  width: 100%;
  height: 100%;
  display: none;
  object-fit: cover;
}

.avatar-choice-visual span {
  font-size: 33px;
  line-height: 1;
}

.avatar-choice-name {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 520px) {
  .avatar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .online-player {
    min-width: 140px;
  }
}

/* ============================================================
   LIGHT THEME — 2026-08-17
   UI structure/order is unchanged. Theme-only override layer.
   ============================================================ */

:root {
  color-scheme: light;
  color: #202123;
  background: #f7f7f8;
  --light-page: #f7f7f8;
  --light-surface: #ffffff;
  --light-surface-soft: #f3f4f6;
  --light-surface-hover: #eeeeef;
  --light-border: rgba(32, 33, 35, .10);
  --light-border-strong: rgba(32, 33, 35, .16);
  --light-text: #202123;
  --light-text-soft: #565869;
  --light-text-muted: #6f707a;
  --light-shadow: 0 10px 28px rgba(0, 0, 0, .065);
}

body {
  color: var(--light-text);
  background: var(--light-page);
}

button:focus-visible,
input:focus-visible {
  outline-color: rgba(202, 145, 27, .48);
}

#game {
  background: var(--light-page);
}

.fallback-bg {
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, .95), transparent 39%),
    linear-gradient(180deg, #fafafa 0%, #f7f7f8 56%, #f1f2f4 100%);
}

.character-image {
  filter: drop-shadow(0 24px 32px rgba(0, 0, 0, .14));
}

.character-fallback {
  opacity: .28;
  filter: drop-shadow(0 18px 20px rgba(0, 0, 0, .12));
}

.glass {
  background: rgba(255, 255, 255, .94);
  border-color: var(--light-border);
  box-shadow: var(--light-shadow);
  backdrop-filter: blur(12px);
}

.label,
.sub,
.save-state,
.ranking-status,
.ranking-note,
.compare,
.slot-label,
.inventory-meta,
.inventory-empty,
.gold-hint,
.modal-card p,
.territory-heading p,
.territory-server-status,
.territory-helper,
.territory-action-message,
.territory-battle-status,
.battle-log-row,
.dungeon-status,
.hp-label,
.progress-copy span,
.dungeon-side-head > span,
.conquest-message,
.conquest-battle-status,
.conquest-my-rule span,
.conquest-server-status {
  color: var(--light-text-muted);
}

.topbar strong,
.slot-name,
.inventory-name,
.rank-name,
.modal-card h2,
.enemy-card h2,
.player-battle-card h2,
.dungeon-title-row h1,
.dungeon-side-head h2,
.territory-heading h1,
.territory-panel-head h2,
.progress-copy strong,
.territory-owner-copy strong,
.territory-node-name,
.territory-income-stats strong,
.territory-detail-grid strong,
.territory-fighter > strong,
.territory-owner-row-copy strong {
  color: var(--light-text);
}

.player-avatar-button,
.rank-avatar,
.item-preview-icon,
.mini-item-icon,
.avatar-choice-visual,
.territory-selected-icon {
  border-color: var(--light-border);
  background: #f4f4f5;
  color: var(--light-text);
}

.player-avatar-button:hover {
  border-color: rgba(190, 136, 31, .38);
  background: #fff8e8;
}

.nickname-button {
  color: var(--light-text);
}

.nickname-button:hover {
  color: #a86f00;
}

.online-ok,
.territory-server-status.ok,
.conquest-server-status.ok {
  color: #178548;
}

.online-warn,
.territory-server-status.warn,
.conquest-server-status.warn {
  color: #a36400;
}

.online-error,
.territory-server-status.error,
.conquest-server-status.error {
  color: #c53b3b;
}

.chest-button:hover {
  background: rgba(0, 0, 0, .025);
}

#chestImage {
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, .13));
}

.secondary-button {
  color: #343541;
  background: #ececf1;
  border: 1px solid rgba(32, 33, 35, .08);
}

.secondary-button:hover {
  background: #e4e4e9;
}

.loot-result,
.equipment-slot,
.inventory-empty,
.inventory-item,
.dungeon-stats-grid > div,
.dungeon-progress-step,
.conquest-server-status,
.conquest-fighter,
.territory-server-status,
.territory-income-stats > div,
.territory-detail-grid > div,
.territory-fighter,
.territory-owner-row {
  background: #f7f7f8;
  border-color: var(--light-border);
}

.loot-result.empty {
  color: var(--light-text-muted);
}

.rarity {
  background: #f0f0f2;
}

.item-meta,
.slot-power,
.rank-power {
  color: #4b4d58;
}

.ranking-mode-tabs {
  border-color: var(--light-border);
  background: #f3f3f5;
}

.ranking-mode-tab {
  color: #747680;
}

.ranking-mode-tab.active {
  background: #fff4d8;
  color: #976800;
  box-shadow: inset 0 0 0 1px rgba(190, 136, 31, 0.2);
}

.rank-adventure-value small {
  color: var(--light-text-muted);
}

.compare.up {
  color: #168047;
}

.compare.down,
.danger-link,
.nickname-error {
  color: #c54141;
}

.inventory-item button,
.icon-button {
  background: #ececf1;
  color: #343541;
  border-color: var(--light-border);
}

.inventory-item button:hover,
.icon-button:hover {
  background: #e3e3e8;
}

.ranking-kicker,
.dungeon-kicker {
  color: #21804a;
}

.rank-row {
  background: #f7f7f8;
  border-color: var(--light-border);
}

.rank-row.me {
  border-color: rgba(190, 136, 31, .32);
  background: #fff8e8;
}

.rank-number {
  color: #747680;
}

.rank-row:nth-child(1) .rank-number { color: #b97a00; }
.rank-row:nth-child(2) .rank-number { color: #777b83; }
.rank-row:nth-child(3) .rank-number { color: #aa6840; }

.my-rank-card {
  border-color: rgba(190, 136, 31, .25);
  background: #fff9eb;
}

.my-rank-card > span:last-child {
  color: var(--light-text-muted);
}

.modal {
  background: rgba(32, 33, 35, .30);
  backdrop-filter: blur(8px);
}

.modal-card {
  color: var(--light-text);
  background: #ffffff;
  border-color: var(--light-border);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .18);
}

.modal-badge {
  background: #eaf7ef;
  color: #187944;
}

.nickname-input {
  border-color: var(--light-border-strong);
  background: #ffffff;
  color: var(--light-text);
}

.nickname-input::placeholder {
  color: #999aa3;
}

.r-common { color: #61636d; }
.r-uncommon { color: #268848; }
.r-rare { color: #3477c5; }
.r-epic { color: #8a50b7; }
.r-legendary { color: #b87500; }
.r-god { color: #d43b5f; }
.r-ancient { color: #087f76; text-shadow: 0 0 8px rgba(8, 127, 118, .16); }

.sell-button {
  color: #7b5100;
  background: #fff5d8;
  border-color: rgba(194, 135, 23, .24);
}

.sell-button:hover {
  background: #ffefc2;
}

.slot-actions button,
.inventory-actions .sell-inventory-button {
  color: #805500;
  background: #fff5dc;
  border: 1px solid rgba(194, 135, 23, .12);
}

.sell-price {
  color: #ad7100;
}

.notice-toast {
  background: rgba(255, 255, 255, .98);
  border-color: var(--light-border);
  color: var(--light-text);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .14);
}

/* Tabs */
.game-tab {
  border-color: var(--light-border);
  background: #ffffff;
  color: #62646e;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .025);
}

.game-tab:hover:not(.active) {
  background: #f0f0f2;
  color: #343541;
}

.game-tab.active {
  color: #352600;
  border-color: rgba(185, 128, 19, .18);
  background: linear-gradient(180deg, #ffe18a, #f5bd4b);
}

/* Dungeon */
.wave-badge {
  background: #f1f1f3;
  color: #6b6d76;
}

.wave-badge strong,
.hp-label strong {
  color: var(--light-text);
}

.dungeon-scene {
  border-color: var(--light-border);
  background:
    var(--dungeon-background),
    linear-gradient(180deg, #f4f1ea, #e9e9e8);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.enemy-card,
.player-battle-card {
  color: var(--light-text);
  background: rgba(255, 255, 255, .90);
  border-color: var(--light-border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .09);
}

.enemy-role,
.battle-label {
  color: #237c4a;
}

.enemy-role.boss {
  color: #bd4b36;
}

#dungeonEnemyImage,
.monster-fallback {
  filter: drop-shadow(0 16px 20px rgba(0, 0, 0, .18));
}

.versus-mark,
.conquest-vs,
.territory-battle-vs {
  color: rgba(32, 33, 35, .35);
}

.hp-track {
  background: #e5e5e8;
  border-color: rgba(32, 33, 35, .06);
}

.dungeon-status,
.battle-log-row {
  background: #f4f4f5;
}

.dungeon-progress-step.current {
  border-color: rgba(186, 130, 24, .30);
  background: #fff8e6;
}

.progress-dot {
  background: #e8e8eb;
  color: #555762;
}

.dungeon-progress-step.current .progress-dot {
  color: #3d2b00;
  background: #f6c653;
}

/* Floor conquest */
.conquest-panel::before {
  background: radial-gradient(circle at 88% 10%, rgba(230, 172, 50, .08), transparent 28%);
}

.conquest-kicker,
.territory-kicker {
  color: #a86f00;
}

.conquest-floor-tab {
  border-color: var(--light-border);
  background: #f6f6f8;
  color: var(--light-text-muted);
}

.conquest-floor-tab:hover:not(:disabled),
.conquest-floor-tab.active {
  border-color: rgba(190, 136, 31, .30);
  background: #fff4d4;
  color: #8f6000;
}

.dungeon-floor-replay-panel {
  border-color: var(--light-border);
  background: rgba(255,255,255,.58);
}

.dungeon-floor-replay-copy span {
  color: var(--light-text-muted);
}

.conquest-owner-card {
  border-color: rgba(190, 136, 31, .21);
  background: #fff9e9;
}

.conquest-crown {
  background: #fff2c9;
}

.conquest-owner-copy span {
  color: var(--light-text-muted);
}

.conquest-owner-copy small {
  color: #8c6b1f;
}

.conquest-my-rule {
  border-color: rgba(190, 136, 31, .20);
  background: #fff9ea;
}

.conquest-my-rule strong {
  color: #9a6500;
}

/* Territory map */
.territory-map {
  border-color: var(--light-border);
  background:
    radial-gradient(circle at 53% 33%, rgba(150, 177, 154, .30), transparent 22%),
    radial-gradient(circle at 28% 22%, rgba(171, 190, 211, .28), transparent 21%),
    radial-gradient(circle at 72% 63%, rgba(213, 173, 145, .23), transparent 20%),
    linear-gradient(145deg, #edf1ed, #e6ebef 58%, #e9eaec);
}

.territory-map::before,
.territory-map::after {
  border-color: rgba(32, 33, 35, .07);
  background: rgba(123, 141, 117, .08);
}

.territory-map-fallback {
  opacity: .60;
  background:
    linear-gradient(31deg, transparent 48%, rgba(32, 33, 35, .030) 50%, transparent 52%),
    linear-gradient(-22deg, transparent 48%, rgba(32, 33, 35, .022) 50%, transparent 52%);
  background-size: 90px 90px, 120px 120px;
}

.territory-node {
  border-color: var(--light-border-strong);
  background: rgba(255, 255, 255, .95);
  color: var(--light-text);
  box-shadow: 0 7px 18px rgba(0, 0, 0, .10);
}

.territory-node.selected {
  outline-color: rgba(190, 136, 31, .68);
}

.territory-node.mine {
  border-color: rgba(50, 153, 91, .38);
  background: rgba(234, 249, 239, .96);
}

.territory-node.enemy {
  border-color: rgba(194, 78, 78, .31);
  background: rgba(255, 239, 239, .96);
}

.territory-node-number {
  background: #ececf0;
  color: #666873;
}

.territory-node-owner {
  color: #70727c;
}

.territory-node.mine .territory-node-owner {
  color: #27854c;
}

.territory-node.enemy .territory-node-owner {
  color: #b64b4b;
}

.territory-map-legend {
  background: rgba(255, 255, 255, .91);
  border-color: var(--light-border);
  color: #646670;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .07);
}

.territory-income-stats span,
.territory-detail-grid span,
.territory-fighter > span,
.territory-owner-row-copy small {
  color: #747680;
}

.territory-battle-panel {
  border-color: rgba(190, 136, 31, .18);
}

.territory-owner-row {
  color: var(--light-text);
}

.territory-owner-row:hover {
  background: #f1f1f3;
}

.territory-owner-row.mine {
  border-color: rgba(50, 153, 91, .20);
  background: #eef9f2;
}

.territory-owner-row.mine small {
  color: #27854c;
}

.territory-owner-row-income {
  color: #a96f00;
}

.territory-karma-notice {
  border-color: rgba(181, 66, 90, .18);
  background: #fff2f4;
  color: #8f5360;
}

.territory-karma-notice strong {
  color: #a53f55;
}

.territory-owner-row-income small {
  color: #a64d60;
}

/* Avatar selection */
.avatar-choice {
  border-color: var(--light-border);
  background: #f7f7f8;
  color: var(--light-text);
}

.avatar-choice:hover {
  border-color: rgba(190, 136, 31, .30);
  background: #fff9ea;
}

.avatar-choice.selected {
  border-color: rgba(190, 136, 31, .58);
  background: #fff6dc;
  box-shadow: inset 0 0 0 1px rgba(190, 136, 31, .10);
}

/* ============================================================
   NOTICE / UPDATE LOG
   최신 공지 내용은 notice-data.js 에서 관리합니다.
   ============================================================ */

.notice-screen {
  width: min(1420px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, .75fr);
  gap: 18px;
  min-height: calc(100vh - 190px);
}

.notice-main,
.notice-history {
  border-radius: 22px;
  padding: 24px;
}

.notice-header,
.notice-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.notice-header h1,
.notice-history-head h2,
.notice-latest-card h2 {
  margin: 0;
}

.notice-header h1 {
  margin-top: 4px;
  font-size: 30px;
  letter-spacing: -.03em;
}

.notice-header p,
.notice-history-help {
  margin: 8px 0 0;
  color: #71737c;
  font-size: 13px;
  line-height: 1.6;
}

.notice-kicker {
  color: #23814d;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
}

.notice-date-badge,
.notice-count {
  flex: 0 0 auto;
  border: 1px solid rgba(187, 132, 28, .22);
  background: #fff8e7;
  color: #865900;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 850;
}

.notice-latest {
  margin-top: 22px;
}

.notice-event {
  margin-top: 14px;
}

.notice-event-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #e2e2e5;
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 211, 103, .20), transparent 34%),
    linear-gradient(180deg, #ffffff, #fbfbfc);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .045);
}

.notice-event-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #d85b4b, #8f201d);
}

.notice-event-card summary {
  position: relative;
  z-index: 1;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 26px;
  cursor: pointer;
  user-select: none;
}

.notice-event-card summary::-webkit-details-marker {
  display: none;
}

.notice-event-card summary:hover {
  background: rgba(255, 248, 235, .42);
}

.notice-event-heading {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.notice-event-meta {
  margin: 0 0 2px;
}

.notice-event-version {
  background: #fbe9e6;
  color: #a2312b;
}

.notice-event-title {
  overflow: hidden;
  color: #25262b;
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: -.02em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.notice-event-summary {
  overflow: hidden;
  color: #696b74;
  font-size: 13px;
  line-height: 1.55;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.notice-event-toggle {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(149, 48, 39, .18);
  border-radius: 50%;
  background: #fff5f0;
  color: #a33a31;
  font-size: 20px;
  transition: transform .18s ease, background .18s ease;
}

.notice-event-card[open] .notice-event-toggle {
  transform: rotate(180deg);
  background: #f7e4dc;
}

.notice-event-body {
  position: relative;
  padding: 24px 28px 28px;
  border-top: 1px solid rgba(141, 53, 43, .18);
  background:
    radial-gradient(circle at 100% 0%, rgba(161, 48, 39, .10), transparent 35%),
    linear-gradient(180deg, #fffaf6, #f8eee7);
}

.notice-event-schedule {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 9px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(153, 48, 43, .22);
  border-radius: 11px;
  background: linear-gradient(135deg, #fff7ee, #fae8e3);
  box-shadow: inset 4px 0 0 #a43a34;
}

.notice-event-schedule-label {
  grid-column: 1 / -1;
  color: #8d302c;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .03em;
}

.notice-event-schedule span {
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  color: #534640;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.45;
}

.notice-event-schedule-start {
  border-left: 3px solid #b43d35;
}

.notice-event-schedule-end {
  border-left: 3px solid #4e5966;
}

.notice-event-paragraph {
  margin: 0;
  color: #514540;
  font-size: 14px;
  line-height: 1.85;
}

.notice-event-paragraph + .notice-event-paragraph {
  margin-top: 13px;
}

.notice-event-quote {
  margin: 22px 0 0;
  padding: 16px 18px;
  border-left: 3px solid #a73b32;
  border-radius: 0 10px 10px 0;
  background: rgba(255, 255, 255, .62);
  color: #682c27;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.75;
}

.notice-event-ending {
  margin: 21px 0 0;
  color: #8c2823;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.6;
  text-align: center;
  letter-spacing: .01em;
}

/* ============================================================
   1.9 대륙전쟁 전장
   ============================================================ */

.battlefield-mode {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(330px, .72fr);
  gap: 18px;
  align-items: start;
}

.battlefield-mode-button.active {
  border-color: rgba(155, 53, 48, .30);
  background: rgba(250, 220, 211, .64);
  color: #8f302c;
}

.battlefield-map-panel {
  min-width: 0;
}

.battlefield-result-banner {
  display: grid;
  gap: 7px;
  margin: 12px 0 14px;
  padding: 15px;
  border: 1px solid rgba(151, 52, 45, .24);
  border-radius: 14px;
  background: linear-gradient(135deg, #fff7ea 0%, #fff 52%, #f8e8e4 100%);
  box-shadow: inset 4px 0 0 #a53b34, 0 8px 20px rgba(84, 47, 38, .08);
}

.battlefield-result-kicker {
  color: #a53b34;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .12em;
}

.battlefield-result-banner > strong {
  color: #392d29;
  font-size: 17px;
  line-height: 1.35;
}

.battlefield-result-banner > span {
  color: #6f625d;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.55;
}

.battlefield-result-banner > small {
  color: #94867f;
  font-size: 9px;
  line-height: 1.5;
}

.battlefield-result-scores {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 3px;
}

.battlefield-result-score {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e7dfda;
  border-top: 3px solid var(--war-faction, #777c84);
  border-radius: 9px;
  background: rgba(255, 255, 255, .78);
}

.battlefield-result-score.winner {
  background: #fff8d9;
  box-shadow: 0 0 0 1px rgba(196, 145, 39, .28);
}

.battlefield-result-score span {
  overflow: hidden;
  color: #615752;
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.battlefield-result-score strong {
  color: var(--war-faction, #4d4743);
  font-size: 13px;
}

.battlefield-result-score small {
  color: #8c827d;
  font-size: 8px;
  line-height: 1.4;
}

.battlefield-kicker {
  color: #a53b34 !important;
}

.battlefield-map {
  min-height: 690px;
}

#battlefieldMapImage {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.battlefield-node {
  border-width: 2px;
  background: rgba(255, 253, 248, .94);
  color: #342f2c;
}

.battlefield-node .territory-node-owner {
  color: #6d625c;
}

.battlefield-node.leading-valteon {
  border-color: #b53a3a;
  box-shadow: 0 9px 22px rgba(181, 58, 58, .20);
}

.battlefield-node.leading-arden {
  border-color: #405b86;
  box-shadow: 0 9px 22px rgba(64, 91, 134, .20);
}

.battlefield-node.leading-ash_banner {
  border-color: #777c84;
  box-shadow: 0 9px 22px rgba(82, 86, 93, .20);
}

.battlefield-node.capital::after {
  content: "본진";
  position: absolute;
  right: -7px;
  top: -8px;
  padding: 3px 6px;
  border-radius: 999px;
  background: #8d312c;
  color: #fff;
  font-size: 8px;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(73, 31, 29, .22);
}

.battlefield-node.mercenary-king {
  outline: 3px solid rgba(235, 180, 54, .72);
  outline-offset: 3px;
}

.battlefield-mercenary-king-marker {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: -19px;
  transform: translateX(-50%);
  min-width: max-content;
  padding: 3px 7px;
  border: 1px solid rgba(138, 91, 19, .24);
  border-radius: 999px;
  background: #ffd66b;
  color: #66430d;
  font-size: 8px;
  font-weight: 950;
  line-height: 1.2;
  box-shadow: 0 5px 13px rgba(86, 57, 15, .24);
}

.battlefield-map-legend .battlefield-valteon { background: #b53a3a; }
.battlefield-map-legend .battlefield-arden { background: #405b86; }
.battlefield-map-legend .battlefield-ash { background: #777c84; }

.battlefield-side {
  min-width: 0;
}

.battlefield-description {
  margin: 12px 0 0;
  color: #65605d;
  font-size: 12px;
  line-height: 1.7;
}

.battlefield-capital-notice {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(166, 91, 44, .20);
  border-radius: 11px;
  background: #fff5e7;
  color: #8a5525;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.55;
}

.battlefield-mercenary-king-notice {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(184, 134, 45, .32);
  border-radius: 11px;
  background: linear-gradient(135deg, #fff8df, #fff3c5);
  color: #6f511a;
  font-size: 10px;
  line-height: 1.55;
  box-shadow: inset 3px 0 0 #e1ac38;
}

.battlefield-mercenary-king-notice strong {
  color: #6c470b;
  font-size: 11px;
}

.battlefield-mercenary-king-notice span {
  color: #76623c;
}

.battlefield-balance-head,
.battlefield-balance-values {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.battlefield-balance-head {
  margin-top: 17px;
}

.battlefield-balance-head strong {
  overflow: hidden;
  color: #373331;
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.battlefield-balance-head strong:last-child,
.battlefield-balance-values strong:last-child {
  text-align: right;
}

.battlefield-balance-head span,
.battlefield-balance-values span {
  color: #8d8580;
  font-size: 9px;
  font-weight: 800;
}

.battlefield-balance-track {
  display: flex;
  width: 100%;
  height: 18px;
  margin-top: 9px;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #e8e5e2;
  box-shadow: 0 0 0 1px rgba(55, 42, 36, .12), inset 0 1px 2px rgba(0, 0, 0, .10);
}

.battlefield-balance-bar {
  min-width: 0;
  height: 100%;
  transition: width .35s ease;
}

.battlefield-balance-values {
  margin-top: 7px;
}

.battlefield-balance-values strong {
  color: #3c3734;
  font-size: 13px;
}

.battlefield-trend {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #e4e0dc;
  border-radius: 9px;
  background: #f8f7f5;
}

.battlefield-trend strong {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.battlefield-trend strong:last-child {
  text-align: right;
}

.battlefield-trend span {
  color: #817a75;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.battlefield-trend .rising { color: #2f8b5b; }
.battlefield-trend .falling { color: #bd4a4a; }
.battlefield-trend .steady { color: #8d8782; }

.battlefield-trend-summary {
  margin: 6px 2px 0;
  color: #706a66;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.battlefield-participant-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.battlefield-participant-grid > div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #e5e1dd;
  border-radius: 10px;
  background: #faf9f7;
}

.battlefield-participant-grid span {
  color: #8a837e;
  font-size: 9px;
  font-weight: 800;
}

.battlefield-participant-grid strong {
  color: #49433f;
  font-size: 11px;
}

.battlefield-faction-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 10px;
}

.battlefield-faction-button {
  min-height: 43px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.35;
  cursor: pointer;
  box-shadow: 0 7px 16px rgba(40, 32, 29, .13);
  transition: transform .15s ease, filter .15s ease;
}

.battlefield-faction-button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.07);
}

.battlefield-faction-button:disabled {
  cursor: not-allowed;
  opacity: .45;
  box-shadow: none;
}

.battlefield-daily-count {
  padding: 6px 9px;
  border-radius: 999px;
  background: #f2eee8;
  color: #74675e;
  font-size: 10px;
  font-weight: 900;
}

.battlefield-dispatch-state {
  margin-top: 13px;
  padding: 12px;
  border: 1px solid #e3dfdb;
  border-radius: 11px;
  background: #faf9f7;
  color: #6e6762;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.6;
}

.battlefield-dispatch-state.active {
  border-color: rgba(78, 111, 155, .23);
  background: #edf4fb;
  color: #3e5f84;
}

.battlefield-dispatch-state.completed {
  border-color: rgba(50, 139, 85, .22);
  background: #edf8f0;
  color: #287747;
}

.battlefield-dispatch-state.injured {
  border-color: rgba(174, 61, 53, .24);
  background: #fff0ed;
  color: #9a3a33;
}

.battlefield-dispatch-details {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  color: #5d5753;
  font-size: 11px;
  line-height: 1.55;
}

.battlefield-dispatch-details strong {
  color: #373230;
}

.battlefield-dispatch-panel .primary-button {
  width: 100%;
  margin-top: 11px;
}

.battlefield-report {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 13px;
}

.battlefield-report > div {
  display: grid;
  gap: 4px;
  padding: 10px 7px;
  border-radius: 10px;
  background: #f8f5f1;
  text-align: center;
}

.battlefield-report span {
  color: #8a817b;
  font-size: 9px;
}

.battlefield-report strong {
  color: #3f3936;
  font-size: 13px;
}

.battlefield-report-summary {
  grid-column: 1 / -1;
  padding: 11px !important;
  border-left: 3px solid #a53b34;
  text-align: left !important;
}

.battlefield-contribution-panel > p {
  margin: 9px 0 0;
  color: #7b746f;
  font-size: 10px;
  line-height: 1.55;
}

.battlefield-contribution-list {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.battlefield-contribution-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid #e7e3df;
  border-radius: 10px;
  background: #fbfaf8;
}

.battlefield-contribution-color {
  width: 8px;
  height: 28px;
  border-radius: 999px;
}

.battlefield-contribution-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.battlefield-contribution-copy strong {
  overflow: hidden;
  color: #47413d;
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.battlefield-contribution-copy small {
  color: #918983;
  font-size: 9px;
}

.battlefield-contribution-points {
  color: #8d5b18;
  font-size: 12px;
  font-weight: 900;
}

.battlefield-contribution-empty {
  padding: 12px;
  border-radius: 10px;
  background: #f7f5f2;
  color: #938b85;
  text-align: center;
  font-size: 10px;
}

.title-war-valteon,
.adventure-title-card.title-war-valteon h3,
#adventureEquippedTitle.title-war-valteon {
  color: #aa3934 !important;
}

.title-war-arden,
.adventure-title-card.title-war-arden h3,
#adventureEquippedTitle.title-war-arden {
  color: #405b86 !important;
}

.title-war-ash-banner,
.adventure-title-card.title-war-ash-banner h3,
#adventureEquippedTitle.title-war-ash-banner {
  color: #676c74 !important;
}

@media (max-width: 1020px) {
  .battlefield-mode {
    grid-template-columns: 1fr;
  }

  .battlefield-map {
    min-height: 620px;
  }
}

@media (max-width: 620px) {
  .territory-mode-tabs {
    overflow: hidden;
  }

  .territory-mode-button {
    min-width: 0;
    width: 100%;
    padding: 0 3px;
  }

  .battlefield-map {
    min-height: 520px;
  }

  .battlefield-result-scores {
    grid-template-columns: 1fr;
  }

  .battlefield-participant-grid,
  .battlefield-faction-actions {
    grid-template-columns: 1fr;
  }

  .battlefield-report {
    grid-template-columns: 1fr;
  }

  .battlefield-report-summary {
    grid-column: auto;
  }
}

.notice-latest-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #e2e2e5;
  border-radius: 18px;
  padding: 26px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 211, 103, .24), transparent 34%),
    linear-gradient(180deg, #ffffff, #fbfbfc);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .045);
}

.notice-latest-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #ffd969, #efa72d);
}

.notice-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
}

.notice-version {
  display: inline-flex;
  width: max-content;
  align-items: center;
  border-radius: 7px;
  padding: 4px 7px;
  background: #eaf7ef;
  color: #1f7b48;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
}

.notice-date {
  color: #858790;
  font-size: 12px;
  font-weight: 750;
}

.notice-latest-card h2 {
  color: #25262b;
  font-size: 25px;
  line-height: 1.35;
  letter-spacing: -.025em;
}

.notice-summary {
  margin: 10px 0 0;
  color: #696b74;
  font-size: 14px;
  line-height: 1.7;
}

.notice-items {
  margin: 20px 0 0;
  padding: 17px 18px 17px 38px;
  border-radius: 13px;
  background: #f6f6f7;
  color: #45464d;
  font-size: 14px;
  line-height: 1.75;
}

.notice-items li + li {
  margin-top: 5px;
}

.notice-items li::marker {
  color: #d8991f;
}

.notice-history-head {
  align-items: center;
}

.notice-history-head h2 {
  margin-top: 4px;
  font-size: 21px;
}

.notice-history-list {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.notice-log {
  overflow: hidden;
  border: 1px solid #e3e3e6;
  border-radius: 13px;
  background: #ffffff;
}

.notice-log summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  cursor: pointer;
  user-select: none;
}

.notice-log summary::-webkit-details-marker {
  display: none;
}

.notice-log summary:hover {
  background: #f8f8f9;
}

.notice-log-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.notice-log-title {
  overflow: hidden;
  color: #34353a;
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.notice-log-date {
  color: #8a8c94;
  font-size: 11px;
  font-weight: 700;
}

.notice-log-arrow {
  color: #8d8f97;
  font-size: 18px;
  transition: transform .18s ease;
}

.notice-log[open] .notice-log-arrow {
  transform: rotate(180deg);
}

.notice-log-body {
  padding: 0 16px 17px;
  border-top: 1px solid #eeeeef;
}

.notice-log-body .notice-version {
  margin-top: 14px;
}

.notice-log-body .notice-items {
  margin-top: 13px;
  padding-top: 13px;
  padding-bottom: 13px;
  font-size: 12px;
}

.notice-empty,
.notice-history-empty {
  border: 1px dashed #d7d7db;
  border-radius: 14px;
  padding: 25px;
  background: #fafafb;
  color: #8a8b92;
  text-align: center;
  font-size: 13px;
}

@media (max-width: 980px) {
  .notice-screen {
    grid-template-columns: 1fr;
  }

  .notice-main,
  .notice-history {
    padding: 19px;
  }
}

@media (max-width: 620px) {
  .notice-header {
    display: grid;
  }

  .notice-date-badge {
    justify-self: start;
  }

  .notice-header h1 {
    font-size: 26px;
  }

  .notice-latest-card {
    padding: 20px;
  }

  .notice-event-card summary {
    align-items: flex-start;
    padding: 19px 20px;
  }

  .notice-event-title {
    font-size: 18px;
  }

  .notice-event-summary {
    display: none;
  }

  .notice-event-body {
    padding: 20px;
  }

  .notice-event-schedule {
    grid-template-columns: 1fr;
  }

  .notice-event-schedule-label {
    grid-column: auto;
  }

  .notice-latest-card h2 {
    font-size: 21px;
  }
}

/* ============================================================
   REPLACEABLE BUTTON ICONS
   assets/ui/buttons/*.png 파일을 덮어쓰면 자동 교체됩니다.
   ============================================================ */
.button-icon-wrap {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.button-icon {
  width: 20px;
  height: 20px;
  display: none;
  object-fit: contain;
  pointer-events: none;
}

.button-icon-fallback {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.game-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.icon-text-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.button-icon-wrap-large {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
}

.button-icon-large {
  width: 24px;
  height: 24px;
}


/* ============================================================
   REPLACEABLE FULL BUTTON SKINS
   assets/ui/buttons/open-chest-button.png 파일을 덮어쓰면
   상자 열기 버튼의 배경 디자인 전체가 자동 교체됩니다.
   ============================================================ */
.image-skin-button {
  position: relative;
  min-height: 56px;
  overflow: hidden;
  isolation: isolate;
  background-image: var(--button-skin-image, linear-gradient(180deg, #ffd96a, #f2ad35));
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: none;
}

.image-skin-button > span {
  position: relative;
  z-index: 1;
}

.image-skin-button.has-button-skin {
  background-color: transparent;
  border-color: transparent;
}

.image-skin-button:hover {
  filter: brightness(1.04);
}

.image-skin-button:active {
  transform: translateY(1px);
}


/* ============================================================
   SHARED PRIMARY BUTTON SKIN
   assets/ui/buttons/common-button.png 한 장을 모든 노란색 주요 버튼에 사용.
   각 버튼의 기존 폭/높이를 유지한 채 배경만 자동으로 맞춰집니다.
   ============================================================ */
.has-common-button-skin .primary-button,
.has-common-button-skin .game-tab.active {
  background-color: transparent;
  background-image: var(--common-button-skin-image);
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  border-color: transparent;
  box-shadow: none;
  overflow: hidden;
}

.has-common-button-skin .primary-button:hover,
.has-common-button-skin .game-tab.active:hover {
  filter: brightness(1.04);
}

.has-common-button-skin .primary-button:active,
.has-common-button-skin .game-tab.active:active {
  transform: translateY(1px);
}

/* 기존 상자 버튼 전용 스킨 클래스도 공통 스킨을 따르도록 통일 */
.has-common-button-skin .image-skin-button {
  background-image: var(--common-button-skin-image);
}

/* ============================================================
   ADVENTURERS' TAVERN
   ============================================================ */

.tavern-screen {
  width: min(1420px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, .55fr);
  gap: 18px;
  min-height: calc(100vh - 190px);
}

.tavern-main,
.tavern-side {
  border-radius: 22px;
  padding: 24px;
}

.tavern-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.tavern-heading h1,
.tavern-side h2 {
  margin: 0;
  color: #26272c;
  letter-spacing: -.03em;
}

.tavern-heading h1 {
  margin-top: 4px;
  font-size: 30px;
}

.tavern-heading p,
.tavern-side > p {
  margin: 8px 0 0;
  color: #71737c;
  font-size: 13px;
  line-height: 1.65;
}

.tavern-kicker,
.tavern-side-kicker {
  color: #a56b11;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
}

.tavern-server-status {
  margin-top: 18px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f5f5f6;
  color: #777983;
  font-size: 11px;
  font-weight: 750;
}

.tavern-server-status.ok {
  background: #edf8f1;
  color: #25734a;
}

.tavern-server-status.warn {
  background: #fff8e8;
  color: #93620b;
}

.tavern-server-status.error {
  background: #fff0f0;
  color: #b04c4c;
}

.tavern-compose {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid #e3e3e6;
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0%, rgba(230, 188, 94, .10), transparent 32%),
    #fbfbfc;
}

.tavern-compose-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.tavern-message-input {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #dcdce0;
  border-radius: 12px;
  outline: none;
  background: #ffffff;
  color: #292a2f;
  font: inherit;
  font-size: 13px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.tavern-message-input:focus {
  border-color: rgba(184, 128, 25, .55);
  box-shadow: 0 0 0 3px rgba(211, 159, 55, .10);
}

.tavern-message-input:disabled {
  background: #f1f1f2;
  color: #999ba2;
  cursor: not-allowed;
}

.tavern-post-button {
  min-width: 140px;
  height: 46px;
  margin: 0;
  padding: 0 18px;
  white-space: nowrap;
}

.tavern-compose-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
  color: #909198;
  font-size: 10px;
}

.tavern-compose-meta strong {
  flex: 0 0 auto;
  color: #777983;
}

.tavern-message-list {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.tavern-message {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 15px;
  border: 1px solid #e4e4e7;
  border-radius: 15px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .025);
}

.tavern-message.mine {
  border-color: rgba(196, 143, 40, .28);
  background: #fffaf0;
}

.tavern-message.tavern-keeper {
  border-color: rgba(178, 137, 48, .3);
  background: linear-gradient(135deg, #fffaf0 0%, rgba(255, 255, 255, .98) 72%);
  box-shadow: 0 4px 14px rgba(133, 94, 22, .06);
}

.tavern-message.tavern-keeper .tavern-avatar {
  border-color: rgba(178, 137, 48, .32);
  background: #fff6df;
}

.tavern-avatar {
  position: relative;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border: 1px solid #dedee2;
  border-radius: 12px;
  background: #f3f3f4;
}

.tavern-avatar img,
.tavern-avatar span {
  width: 100%;
  height: 100%;
}

.tavern-avatar img {
  display: none;
  object-fit: cover;
}

.tavern-avatar span {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
}

.tavern-message-body {
  min-width: 0;
}

.tavern-message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tavern-message-name-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.tavern-message-name {
  overflow: hidden;
  color: #303136;
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tavern-mine-badge {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: #f6e9c9;
  color: #8a5a05;
  font-size: 9px;
  font-weight: 900;
}

.tavern-npc-badge {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid rgba(166, 121, 24, .18);
  border-radius: 999px;
  background: #f9edcf;
  color: #8a5a05;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .05em;
}

.tavern-message-time {
  flex: 0 0 auto;
  color: #9a9ba2;
  font-size: 10px;
  font-weight: 700;
}

.tavern-message-text {
  margin: 6px 0 0;
  color: #4b4c52;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.tavern-bloodmoon-entry {
  width: fit-content;
  margin-top: 7px;
  padding: 7px 11px;
  border: 1px solid #b9b18c;
  border-radius: 8px;
  background: #cec7a6;
  color: #3f3a29;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  cursor: pointer;
}

.tavern-bloodmoon-entry:hover {
  background: #c5bd98;
}

.tavern-message-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.tavern-delete-button {
  border: 0;
  padding: 3px 4px;
  background: transparent;
  color: #ad7777;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.tavern-delete-button:hover:not(:disabled) {
  color: #c24e4e;
  text-decoration: underline;
}

.tavern-delete-button.administrator {
  margin-left: 6px;
  padding: 3px 7px;
  border: 1px solid rgba(174, 71, 71, .2);
  border-radius: 999px;
  background: rgba(190, 74, 74, .06);
  color: #a74343;
}

.tavern-delete-button.administrator:hover:not(:disabled) {
  border-color: rgba(174, 71, 71, .38);
  background: rgba(190, 74, 74, .12);
}

.tavern-delete-button:disabled {
  opacity: .5;
  cursor: wait;
  text-decoration: none;
}

.tavern-empty {
  padding: 46px 18px;
  border: 1px dashed #d8d8dc;
  border-radius: 15px;
  background: #fafafb;
  color: #8b8d94;
  text-align: center;
  font-size: 12px;
}

.tavern-side {
  align-self: start;
}

.tavern-side h2 {
  margin-top: 4px;
  font-size: 22px;
}

.tavern-rule-list {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}

.tavern-rule-list > div {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-radius: 12px;
  background: #f7f7f8;
}

.tavern-rule-list span {
  display: flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #fff4d8;
  color: #98630b;
  font-size: 10px;
  font-weight: 900;
}

.tavern-rule-list p {
  margin: 2px 0 0;
  color: #676970;
  font-size: 11px;
  line-height: 1.55;
}

.travelers-rest-card {
  position: relative;
  overflow: hidden;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(188, 139, 42, .24);
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0%, rgba(230, 177, 65, .20), transparent 38%),
    linear-gradient(145deg, #fffaf0 0%, #fffdf8 74%);
  box-shadow: 0 5px 16px rgba(123, 82, 15, .055);
}

.travelers-rest-card::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -34px;
  width: 96px;
  height: 96px;
  border: 16px solid rgba(193, 137, 31, .045);
  border-radius: 50%;
  pointer-events: none;
}

.travelers-rest-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.travelers-rest-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid rgba(193, 137, 31, .18);
  border-radius: 13px;
  background: rgba(255, 244, 214, .88);
  font-size: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);
}

.travelers-rest-kicker {
  color: #a56b11;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .14em;
}

.travelers-rest-heading h3 {
  margin: 3px 0 0;
  color: #2f2b23;
  font-size: 18px;
  letter-spacing: -.03em;
}

.travelers-rest-description {
  position: relative;
  z-index: 1;
  margin: 12px 0 0;
  color: #716b60;
  font-size: 11px;
  line-height: 1.6;
}

.travelers-rest-reward {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
  padding: 11px 12px;
  border: 1px solid rgba(194, 148, 58, .16);
  border-radius: 12px;
  background: rgba(255, 255, 255, .68);
}

.travelers-rest-reward span {
  color: #8a8378;
  font-size: 10px;
  font-weight: 750;
}

.travelers-rest-reward strong {
  color: #9a6509;
  font-size: 16px;
  white-space: nowrap;
}

.travelers-rest-limit {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 5px 10px;
  margin-top: 9px;
  color: #969086;
  font-size: 9px;
  font-weight: 700;
}

.travelers-rest-button {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 43px;
  margin-top: 13px;
  border: 1px solid #c8b984;
  border-radius: 12px;
  background: linear-gradient(180deg, #d8cda7, #c9bd91);
  color: #322b19;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(99, 75, 24, .08);
  transition: transform .15s ease, filter .15s ease;
}

.travelers-rest-button:hover {
  filter: brightness(1.025);
  transform: translateY(-1px);
}

.travelers-rest-button:active {
  transform: translateY(0);
}

.travelers-rest-button.is-ready {
  border-color: #b89943;
  background: linear-gradient(180deg, #d8bd68, #caa64b);
}

.travelers-rest-status {
  position: relative;
  z-index: 1;
  min-height: 28px;
  margin: 8px 0 0;
  color: #999187;
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
}

.travelers-rest-status.is-error {
  color: #ae5656;
}

.tavern-identity {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e8e8ea;
}

.tavern-identity span {
  color: #96979e;
  font-size: 10px;
}

.tavern-identity strong {
  color: #34353a;
  font-size: 14px;
}

.tavern-identity-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.tavern-identity .tavern-admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid rgba(164, 93, 26, .24);
  border-radius: 999px;
  background: #fff3d8;
  color: #965b19;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .03em;
}

.tavern-identity .tavern-admin-badge.hidden {
  display: none;
}

@media (max-width: 980px) {
  .tavern-screen {
    grid-template-columns: 1fr;
  }

  .tavern-main,
  .tavern-side {
    padding: 19px;
  }
}

@media (max-width: 620px) {
  .tavern-heading h1 {
    font-size: 26px;
  }

  .tavern-compose-row {
    grid-template-columns: 1fr;
  }

  .tavern-post-button {
    width: 100%;
  }

  .tavern-compose-meta {
    align-items: flex-start;
  }

  .tavern-message {
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 12px;
  }

  .tavern-avatar {
    width: 40px;
    height: 40px;
  }

  .travelers-rest-card {
    padding: 14px;
  }

  .travelers-rest-limit {
    justify-content: flex-start;
  }
}
/* 몬스터 카드 배경 제거 */
.enemy-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* ============================================================
   WORLD BOSS
   ============================================================ */
.world-boss-screen {
  width: min(1420px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, .65fr);
  gap: 18px;
  align-items: start;
}

.world-boss-main,
.world-boss-ranking,
.world-boss-reward {
  padding: 24px;
  border-radius: 22px;
}

.world-boss-side { display: grid; gap: 14px; }
.world-boss-heading,
.world-boss-side-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.world-boss-heading h1,
.world-boss-side h2 { margin: 4px 0 0; }
.world-boss-heading p,
.world-boss-reward p {
  margin: 8px 0 0;
  color: var(--light-text-muted, #777);
  line-height: 1.55;
}

.world-boss-kicker {
  color: #a66b0b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
}

.world-boss-phase {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}
.world-boss-phase.active { color: #a52e36; background: #fff0f0; border: 1px solid #f4c6ca; }
.world-boss-phase.preparing { color: #765c24; background: #fff8e8; border: 1px solid #ead9ad; }

.world-boss-timer-card {
  margin-top: 18px;
  padding: 13px 16px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f5f5f6;
  border: 1px solid rgba(32, 33, 35, .09);
}
.world-boss-timer-card span { color: #6f707a; font-weight: 750; }
.world-boss-timer-card strong { font-size: 25px; font-variant-numeric: tabular-nums; }

.world-boss-stage {
  margin-top: 14px;
  padding: 20px;
  border-radius: 20px;
  background: radial-gradient(circle at 50% 36%, rgba(193, 75, 69, .13), transparent 34%), linear-gradient(180deg, #fbf7f2, #f4f1ed);
  border: 1px solid rgba(105, 73, 52, .12);
  overflow: hidden;
}

.world-boss-target {
  position: relative;
  width: min(760px, 96%);
  min-height: 440px;
  margin: 0 auto;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.world-boss-target:disabled { cursor: not-allowed; opacity: 1; }
.world-boss-target.sending { cursor: pointer; }
.world-boss-target.queued .world-boss-hit-guide {
  color: #845f13;
  background: rgba(255, 247, 218, .94);
  border-color: rgba(181, 137, 35, .28);
}
.world-boss-target img {
  display: none;
  width: 100%;
  height: 410px;
  object-fit: contain;
  filter: drop-shadow(0 22px 24px rgba(84, 28, 28, .18));
  user-select: none;
  pointer-events: none;
}
.world-boss-fallback {
  font-size: clamp(130px, 17vw, 240px);
  filter: drop-shadow(0 22px 24px rgba(84, 28, 28, .18));
  user-select: none;
  pointer-events: none;
}
.world-boss-hit-guide {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  padding: 7px 11px;
  border-radius: 999px;
  color: #6f543c;
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(92, 62, 40, .12);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}
.world-boss-target.hit img,
.world-boss-target.hit .world-boss-fallback { animation: worldBossHit .22s ease; }
@keyframes worldBossHit {
  0% { transform: scale(1); }
  45% { transform: scale(.94) rotate(-1deg); }
  100% { transform: scale(1); }
}
.world-boss-floating-damage {
  position: absolute;
  z-index: 3;
  left: 52%;
  top: 26%;
  color: #d23f48;
  font-size: 27px;
  font-weight: 950;
  text-shadow: 0 2px 0 #fff;
  pointer-events: none;
  animation: worldBossDamage .75s ease forwards;
}
@keyframes worldBossDamage {
  from { opacity: 1; transform: translate(-50%, 10px) scale(.85); }
  to { opacity: 0; transform: translate(-50%, -54px) scale(1.13); }
}

.world-boss-hp-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-size: 12px;
  color: #696a73;
}
.world-boss-hp-copy strong { color: #2c2d31; font-variant-numeric: tabular-nums; }
.world-boss-hp-track { height: 15px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: #dedfe3; }
.world-boss-hp-fill { width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #b9333e, #f05b61); transition: width .2s ease; }

.world-boss-status {
  margin-top: 14px;
  padding: 13px 15px;
  border-radius: 13px;
  text-align: center;
  color: #5d5e65;
  background: #f5f5f6;
  border: 1px solid rgba(32, 33, 35, .08);
  font-weight: 750;
}
.world-boss-status.active { color: #8d3137; background: #fff3f3; }
.world-boss-status.success { color: #267348; background: #edf8f1; }
.world-boss-status.error { color: #a23d44; background: #fff0f0; }

.world-boss-auto-panel {
  margin-top: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffaf1, #f8f1e4);
  border: 1px solid rgba(151, 105, 38, .18);
}
.world-boss-auto-button {
  min-width: 176px;
  min-height: 46px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(130, 83, 24, .24);
  border-radius: 12px;
  color: #5f4219;
  background: linear-gradient(180deg, #fff4cf, #ead29a);
  box-shadow: inset 0 1px rgba(255,255,255,.7), 0 5px 12px rgba(93, 59, 19, .1);
  font-weight: 900;
  cursor: pointer;
}
.world-boss-auto-button:hover:not(:disabled) { filter: brightness(1.03); transform: translateY(-1px); }
.world-boss-auto-button:active:not(:disabled) { transform: translateY(1px); }
.world-boss-auto-button:disabled { cursor: not-allowed; opacity: .48; }
.world-boss-auto-button.active {
  color: #fff;
  border-color: #8e2934;
  background: linear-gradient(180deg, #c64650, #922c36);
  box-shadow: inset 0 1px rgba(255,255,255,.22), 0 7px 15px rgba(139, 37, 48, .22);
}
.world-boss-auto-button.active:disabled { opacity: 1; cursor: pointer; }
.world-boss-auto-icon { font-size: 17px; }
.world-boss-auto-copy { min-width: 0; display: grid; gap: 3px; }
.world-boss-auto-copy strong { color: #51351c; font-size: 13px; }
.world-boss-auto-copy span { color: #77706a; font-size: 11px; line-height: 1.5; }
.world-boss-target.auto-running .world-boss-hit-guide {
  color: #8d3137;
  background: rgba(255, 240, 240, .94);
  border-color: rgba(181, 55, 65, .25);
}

.world-boss-player-row { margin-top: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.world-boss-player-row > div { padding: 13px; border-radius: 13px; background: #f7f7f8; border: 1px solid rgba(32, 33, 35, .08); }
.world-boss-player-row span,
.world-boss-rank-row span { display: block; color: #777883; font-size: 11px; }
.world-boss-player-row strong { display: block; margin-top: 5px; font-size: 18px; }

.world-boss-ranking-list { display: grid; gap: 7px; margin-top: 14px; max-height: 520px; overflow-y: auto; }
.world-boss-rank-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 11px;
  border-radius: 12px;
  background: #f6f6f7;
  border: 1px solid rgba(32, 33, 35, .07);
}
.world-boss-rank-row.mine { background: #fff8e8; border-color: #ead7a5; }
.world-boss-rank-number {
  display: grid !important;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #7a5a16 !important;
  background: #fff0c9;
  font-weight: 950;
}
.world-boss-rank-row b { font-size: 13px; font-variant-numeric: tabular-nums; }
.world-boss-empty { padding: 28px 12px; color: #777883; text-align: center; border-radius: 13px; background: #f7f7f8; }
.world-boss-reward h2 { color: #8d6017; }
.world-boss-reward .primary-button { width: 100%; margin-top: 16px; }
.world-boss-reward-status { min-height: 18px; margin-top: 9px; color: #6e6f78; font-size: 12px; line-height: 1.5; }

@media (max-width: 980px) {
  .world-boss-screen { grid-template-columns: 1fr; }
  .game-tabs { flex-wrap: wrap; }
}
@media (max-width: 620px) {
  .world-boss-main,
  .world-boss-ranking,
  .world-boss-reward { padding: 16px; }
  .world-boss-target { width: 100%; min-height: 300px; }
  .world-boss-target img { height: 275px; }
  .world-boss-auto-panel { flex-direction: column; align-items: stretch; text-align: center; }
  .world-boss-auto-button { width: 100%; }
  .world-boss-player-row { grid-template-columns: 1fr; }
}

/* Background music controls */
.bgm-control {
  min-width: 250px;
}

.bgm-control-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.bgm-toggle-button {
  min-width: 104px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--light-border-strong, rgba(255,255,255,.16));
  border-radius: 10px;
  background: var(--light-surface-soft, rgba(255,255,255,.08));
  color: var(--light-text, #f7f8fb);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.bgm-toggle-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(169, 132, 29, .45);
}

.bgm-toggle-button.is-playing {
  border-color: rgba(31, 157, 91, .32);
  background: rgba(31, 157, 91, .10);
  color: #167342;
}

.bgm-toggle-button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.bgm-volume-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--light-text-muted, #777);
  font-size: 12px;
}

.bgm-volume-input {
  width: 90px;
  accent-color: #a9841d;
  cursor: pointer;
}

.bgm-volume-input:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.bgm-status {
  max-width: 250px;
  min-height: 15px;
  color: var(--light-text-muted, #777);
  font-size: 10px;
  line-height: 1.3;
}

.bgm-status.error {
  color: #b43d43;
}

@media (max-width: 820px) {
  .bgm-control {
    width: 100%;
  }

  .bgm-control-row {
    width: 100%;
  }

  .bgm-volume-wrap {
    flex: 1;
  }

  .bgm-volume-input {
    width: min(180px, 100%);
  }
}

/* ============================================================
   0.71 — VERIFIED ACCOUNT LOGIN
   ============================================================ */

.account-control {
  min-width: 190px;
}

.account-control-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
}

.account-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(143, 145, 154, .24);
  border-radius: 999px;
  background: rgba(143, 145, 154, .10);
  color: var(--light-text-muted, #777);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.account-badge.verified {
  border-color: rgba(31, 157, 91, .28);
  background: rgba(31, 157, 91, .10);
  color: #167342;
}

.account-badge.blocked {
  border-color: rgba(196, 55, 64, .30);
  background: rgba(196, 55, 64, .10);
  color: #a62e36;
}

.account-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--light-border-strong, rgba(255,255,255,.16));
  border-radius: 9px;
  background: var(--light-surface-soft, rgba(255,255,255,.08));
  color: var(--light-text, #f7f8fb);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.account-button:hover:not(:disabled) {
  border-color: rgba(169, 132, 29, .45);
  background: rgba(169, 132, 29, .08);
}

.account-button:disabled {
  opacity: .55;
  cursor: wait;
}

.account-status {
  max-width: 220px;
  min-height: 14px;
  color: var(--light-text-muted, #777);
  font-size: 10px;
  line-height: 1.3;
}

.account-modal-card {
  width: min(500px, 100%);
}

.account-current-state {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--light-border, rgba(255,255,255,.12));
  border-radius: 12px;
  background: var(--light-surface-soft, rgba(255,255,255,.06));
  color: var(--light-text-soft, #b9c1ce);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.55;
}

.account-action-stack {
  display: grid;
  gap: 9px;
}

.account-action-stack > button {
  width: 100%;
}

.account-google-button {
  background: #fff;
  color: #252525;
  border: 1px solid rgba(32, 33, 35, .16);
}

.account-google-button:hover:not(:disabled) {
  background: #f1f2f4;
}

.account-help {
  margin: 2px 2px 0 !important;
  color: var(--light-text-muted, #777) !important;
  font-size: 10px !important;
}

.verified-account-email {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(31, 157, 91, .08);
  color: #167342;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

@media (max-width: 820px) {
  .account-control {
    width: 100%;
  }

  .account-status {
    max-width: none;
  }
}

/* ============================================================
   0.74 · 주점 하트 / TOP 3 랭커 장비 공개
   ============================================================ */

.rank-row.rank-equipment-enabled {
  width: 100%;
  appearance: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.rank-row.rank-equipment-enabled:hover,
.rank-row.rank-equipment-enabled:focus-visible {
  border-color: rgba(176, 134, 24, .42);
  background: rgba(176, 134, 24, .09);
  transform: translateY(-1px);
  outline: none;
}

.rank-name-wrap {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.rank-view-hint {
  color: #a27818;
  font-size: 9px;
  font-weight: 850;
}

.rank-equipment-modal-card {
  width: min(700px, 100%);
}

.rank-equipment-status {
  margin: 12px 0;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(176, 134, 24, .08);
  color: #7e621d;
  font-size: 11px;
  font-weight: 750;
}

.rank-equipment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.rank-equipment-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid #dedee2;
  border-radius: 14px;
  background: #fafafb;
}

.rank-equipment-icon {
  position: relative;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #f0f0f2;
  overflow: hidden;
}

.rank-equipment-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rank-equipment-icon span {
  font-size: 23px;
}

.rank-equipment-detail {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.rank-equipment-detail strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
}

.rank-equipment-detail > span:last-child {
  color: #777980;
  font-size: 10px;
  font-weight: 700;
}

.rank-equipment-type {
  color: #96989f;
  font-size: 9px;
  font-weight: 850;
}

.tavern-message-actions {
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.tavern-like-button {
  min-width: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid #dedee2;
  border-radius: 999px;
  background: #fff;
  color: #9a7b7f;
  font-size: 11px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.tavern-like-button:hover:not(:disabled) {
  border-color: #e5aeb6;
  background: #fff5f6;
  color: #c64d5c;
}

.tavern-like-button.active {
  border-color: #ec9eaa;
  background: #fff0f2;
  color: #d83f54;
}

.tavern-like-button:disabled {
  opacity: .45;
  cursor: wait;
}

.tavern-like-button span {
  font-size: 15px;
  line-height: 1;
}

.tavern-like-button strong {
  font-size: 10px;
}

@media (max-width: 620px) {
  .rank-equipment-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================
   0.76 모험가 길드 / 길드 버프
   ========================================================== */

.adventure-level-summary strong {
  white-space: nowrap;
}

.adventure-guild-screen {
  width: min(1420px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .65fr);
  gap: 18px;
  align-items: start;
}

.adventure-guild-main,
.adventure-guild-side {
  min-width: 0;
}

.adventure-guild-main,
.adventure-trait-detail,
.adventure-guild-guide {
  padding: 28px;
  border-radius: 22px;
}

.adventure-guild-side {
  display: grid;
  gap: 18px;
}

.adventure-guild-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.adventure-guild-heading h1,
.adventure-trait-detail h2,
.adventure-guild-guide h2 {
  margin: 5px 0 8px;
}

.adventure-guild-heading p,
.adventure-trait-detail > p,
.adventure-guild-guide > p {
  margin: 0;
  color: #777980;
  line-height: 1.7;
}

.adventure-guild-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.adventure-guild-emblem {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  overflow: hidden;
  border-radius: 13px;
  background: linear-gradient(145deg, #f5ead0, #fff9ea);
}

.adventure-guild-emblem img,
.adventure-guild-emblem > span {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.adventure-guild-emblem > span {
  display: grid;
  place-items: center;
  font-size: 22px;
}

.adventure-guild-kicker {
  color: #aa6c00;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
}

.adventure-level-seal {
  min-width: 112px;
  padding: 15px 17px;
  border: 1px solid rgba(185, 139, 44, .25);
  border-radius: 18px;
  background: linear-gradient(145deg, #fff8e8, #f4ead0);
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

.adventure-level-seal span {
  display: block;
  color: #a17014;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .16em;
}

.adventure-level-seal strong {
  display: block;
  margin-top: 4px;
  color: #5a3b00;
  font-size: 24px;
}

.adventure-progress-card {
  padding: 18px;
  border: 1px solid #e6e0d3;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,251,241,.98), rgba(248,246,241,.92));
}

.adventure-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
}

.adventure-progress-head > div {
  display: grid;
  gap: 3px;
}

.adventure-progress-head span,
.adventure-progress-card p {
  color: #84858b;
  font-size: 11px;
}

.adventure-progress-head strong {
  font-size: 21px;
}

.adventure-exp-track {
  height: 10px;
  margin: 13px 0 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7e5e0;
}

.adventure-exp-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b88a20, #e0bd5f);
  transition: width .3s ease;
}

.adventure-progress-card p {
  margin: 0;
  line-height: 1.5;
}

.adventure-trait-overview {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.adventure-trait-overview > div {
  min-width: 112px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f5f5f6;
}

.adventure-trait-overview span {
  display: block;
  color: #8b8c92;
  font-size: 10px;
}

.adventure-trait-overview strong {
  display: block;
  margin-top: 3px;
  font-size: 19px;
}

.adventure-trait-overview p {
  margin: 0;
  color: #777980;
  font-size: 11px;
  line-height: 1.6;
}

.adventure-trait-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.adventure-trait-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e1e1e4;
  border-radius: 15px;
  background: rgba(250,250,251,.9);
  color: #2f3034;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.adventure-trait-card:hover {
  transform: translateY(-1px);
  border-color: #d7bc79;
}

.adventure-trait-card.selected {
  border-color: #b98a22;
  background: #fff9e9;
}

.adventure-trait-card.equipped {
  box-shadow: inset 3px 0 0 #bd8d25;
}

.adventure-trait-icon,
.adventure-trait-detail-visual {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(145deg, #f5ead0, #fff9ea);
}

.adventure-trait-icon {
  width: 52px;
  height: 52px;
}

.adventure-trait-icon img,
.adventure-trait-icon > span,
.adventure-trait-detail-visual img,
.adventure-trait-detail-visual > span {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.adventure-trait-icon > span,
.adventure-trait-detail-visual > span {
  place-items: center;
  font-size: 24px;
}

.adventure-trait-card-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.adventure-trait-card-copy strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
}

.adventure-trait-card-copy small {
  overflow: hidden;
  color: #888a90;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 10px;
}

.adventure-trait-detail-visual {
  width: 92px;
  height: 92px;
  margin: 0 0 18px;
  box-shadow: 0 12px 28px rgba(137, 99, 17, .12);
}

.adventure-trait-detail-visual > span {
  font-size: 42px;
}

.adventure-trait-detail-list {
  display: grid;
  gap: 9px;
  margin: 19px 0;
}

.adventure-trait-detail-list > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border-radius: 11px;
  background: #f5f5f6;
}

.adventure-trait-detail-list dt {
  color: #8d8e94;
  font-size: 10px;
}

.adventure-trait-detail-list dd {
  margin: 0;
  color: #3c3d41;
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.adventure-trait-rank-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.adventure-trait-save {
  width: 100%;
  margin-top: 9px;
}

.adventure-guild-status {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 11px;
  background: #f4f4f5;
  color: #73757b;
  font-size: 10px;
  line-height: 1.55;
}

.adventure-guild-status.ok { background: #edf9f2; color: #23824e; }
.adventure-guild-status.warn { background: #fff8e8; color: #9a6a08; }
.adventure-guild-status.error { background: #fff0f0; color: #b23b42; }
.adventure-guild-status.loading { background: #eef4ff; color: #4b68a4; }

.adventure-guild-guide ul {
  margin: 16px 0 0;
  padding-left: 18px;
  color: #66686e;
  font-size: 11px;
  line-height: 1.9;
}

.adventure-tower-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 8;
  margin-bottom: 18px;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(145deg, #f5ead0, #f2f3f5);
}

.adventure-tower-preview img,
.adventure-tower-preview > span {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.adventure-tower-preview > span {
  display: grid;
  place-items: center;
  font-size: 48px;
}

@media (max-width: 1080px) {
  .adventure-guild-screen {
    grid-template-columns: 1fr;
  }

  .adventure-guild-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .adventure-guild-main,
  .adventure-trait-detail,
  .adventure-guild-guide {
    padding: 18px;
  }

  .adventure-guild-heading,
  .adventure-progress-head {
    align-items: flex-start;
  }

  .adventure-level-seal {
    min-width: 88px;
  }

  .adventure-trait-overview,
  .adventure-guild-side {
    grid-template-columns: 1fr;
  }

  .adventure-trait-overview p {
    grid-column: 1;
  }
}

@media (max-width: 520px) {
  .adventure-trait-grid {
    grid-template-columns: 1fr;
  }

  .adventure-guild-heading {
    flex-direction: column;
  }
}

/* ============================================================
   ITEM SALE LOCK
   Small, quiet, flat controls that protect items from selling.
   ============================================================ */

#itemResult {
  position: relative;
}

.slot-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.slot-header .slot-label {
  min-width: 0;
}

.item-lock-button,
.inventory-item .item-lock-button,
.slot-header .item-lock-button {
  width: 26px;
  min-width: 26px;
  height: 26px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 7px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
  color: #a2a3aa !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: color .16s ease, background .16s ease;
}

.item-lock-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.item-lock-button:hover,
.inventory-item .item-lock-button:hover,
.slot-header .item-lock-button:hover {
  color: #74767e !important;
  background: rgba(71, 73, 82, .065) !important;
}

.item-lock-button.locked,
.inventory-item .item-lock-button.locked,
.slot-header .item-lock-button.locked {
  color: #9b7b3c !important;
  background: #f5f1e8 !important;
}

.item-lock-button.locked:hover,
.inventory-item .item-lock-button.locked:hover,
.slot-header .item-lock-button.locked:hover {
  color: #826329 !important;
  background: #eee7d7 !important;
}

.item-lock-button:focus-visible {
  outline: 2px solid rgba(174, 132, 47, .32);
  outline-offset: 2px;
}

.pending-item-lock-button {
  position: absolute;
  top: 0;
  right: 0;
}

.sell-equipped-button:disabled,
.inventory-actions .sell-inventory-button:disabled {
  opacity: .34;
  cursor: not-allowed;
  filter: grayscale(.2);
}

/* ============================================================
   MOBILE INVENTORY LAYOUT
   Keep every inventory action inside its item card on narrow screens.
   ============================================================ */

@media (max-width: 820px) {
  .equipment-panel,
  .inventory-list,
  .inventory-item {
    min-width: 0;
  }

  .inventory-item {
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
    overflow: hidden;
  }

  .inventory-main-line {
    width: 100%;
    min-width: 0;
  }

  .inventory-actions {
    width: 100%;
    min-width: 0;
    margin-left: 0;
    display: grid;
    grid-template-columns: 26px repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .inventory-actions button {
    width: 100%;
    min-width: 0;
    padding: 8px 6px;
    white-space: nowrap;
  }

  .inventory-item .inventory-actions .item-lock-button {
    width: 26px;
    min-width: 26px;
  }
}

/* ============================================================
   0.97 — NAVER CAFE SUGGESTION LINK
   ============================================================ */
.suggestion-cafe-button {
  margin-left: auto;
  white-space: nowrap;
  text-decoration: none;
  border-color: rgba(3, 199, 90, .25);
  background: #f0fff6;
  color: #087a3d;
  box-shadow: 0 2px 7px rgba(3, 199, 90, .07);
}

.suggestion-cafe-button:hover {
  border-color: rgba(3, 199, 90, .42);
  background: #e4faed;
  color: #056331;
}

.suggestion-cafe-button:focus-visible {
  outline: 3px solid rgba(3, 199, 90, .35);
  outline-offset: 3px;
}

.suggestion-external-mark {
  margin-left: -2px;
  font-size: 12px;
  font-weight: 950;
  opacity: .72;
}

@media (max-width: 980px) {
  .suggestion-cafe-button {
    margin-left: 0;
  }
}

/* ============================================================
   1.2 · 영구 칭호 시스템
   ============================================================ */
.online-player-name-block { min-width: 0; max-width: 210px; display: grid; align-content: center; gap: 4px; }
.player-title-display,
.my-rank-title,
.rank-player-title,
.tavern-player-title,
.world-boss-player-title,
.region-boss-player-title { color: #8e6720; font-size: 10px; font-weight: 900; line-height: 1.25; letter-spacing: .015em; }
.player-title-display { max-width: 200px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.my-rank-title { margin-top: -1px; }
.rank-player-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.title-old-world-survivor { color: #9a6a18; text-shadow: 0 1px 0 rgba(255,255,255,.68); }
.tavern-message-name-wrap { align-items: flex-start; }
.tavern-message-identity { min-width: 0; display: grid; gap: 2px; }
.tavern-player-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.world-boss-player-title { margin: 2px 0 1px; color: #9a6a18 !important; font-size: 9px !important; }
.region-boss-player-title { margin-top: 0 !important; color: #9a6a18 !important; font-size: 9px !important; }
.region-boss-room-host { min-width: 0; display: grid; gap: 1px; }
@media (max-width: 620px) { .online-player-name-block { max-width: 180px; } .player-title-display { max-width: 175px; } }

/* ============================================================
   1.2 · 모험가 길드 칭호 관리
   ============================================================ */
.adventure-title-manager {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid rgba(151, 118, 50, 0.24);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255,255,255,.88), rgba(246,239,221,.84));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

.adventure-title-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 18px;
  align-items: stretch;
  margin-top: 18px;
}

.adventure-title-toggle h2 {
  margin: 5px 0 7px;
  color: #3b3020;
  font-size: 22px;
}

.adventure-title-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  list-style: none;
  cursor: pointer;
}
.adventure-title-toggle::-webkit-details-marker { display: none; }
.adventure-title-toggle::marker { content: ""; }
.adventure-title-toggle > div { min-width: 0; }
.adventure-title-toggle:focus-visible {
  outline: 3px solid #967036;
  outline-offset: 6px;
  border-radius: 4px;
}
.adventure-title-summary {
  color: #5b4b32;
  font-size: .875rem;
  overflow-wrap: anywhere;
}
.adventure-title-toggle-hint {
  flex-shrink: 0;
  padding: 8px 10px;
  border: 1px solid rgba(151, 118, 50, .3);
  border-radius: 8px;
  color: #59421d;
  background: rgba(255,255,255,.65);
  font-size: .875rem;
  font-weight: 700;
}
.adventure-title-label-open { display: none; }
.adventure-title-manager[open] .adventure-title-label-open { display: inline; }
.adventure-title-manager[open] .adventure-title-label-closed { display: none; }

.adventure-title-heading p {
  margin: 0;
  color: #746b5c;
  font-size: 13px;
  line-height: 1.65;
}

.adventure-title-equipped-card {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px solid rgba(169, 131, 48, .26);
  border-radius: 15px;
  background: rgba(255,255,255,.72);
}

.adventure-title-equipped-card > span {
  color: #8f7a55;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
}

.adventure-title-equipped-card > strong {
  color: #8e6218;
  font-size: 15px;
}

.adventure-title-equipped-card > small {
  min-height: 18px;
  color: #635b4d;
  font-size: 11px;
  font-weight: 700;
}

.adventure-title-equipped-card button {
  margin-top: 5px;
}

.adventure-title-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.adventure-title-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(123, 104, 70, .2);
  border-radius: 16px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 8px 20px rgba(71, 55, 27, .06);
}

.adventure-title-card.equipped {
  border-color: rgba(183, 132, 33, .55);
  box-shadow: 0 0 0 2px rgba(221, 177, 79, .12), 0 10px 26px rgba(85, 57, 11, .1);
}

.adventure-title-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.adventure-title-card h3 {
  margin: 3px 0 0;
  color: #8e6218;
  font-size: 16px;
  line-height: 1.35;
}

.adventure-title-rarity {
  color: #a27828;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .14em;
}

.adventure-title-equipped-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e9d59d;
  color: #67470f;
  font-size: 9px;
  font-weight: 900;
}

.adventure-title-card p {
  margin: 0;
  color: #71685a;
  font-size: 12px;
  line-height: 1.55;
}

.adventure-title-effect {
  color: #4d442f;
  font-size: 12px;
}

.adventure-title-card > small {
  color: #9a9182;
  font-size: 10px;
}

.adventure-title-card > button {
  align-self: end;
  width: 100%;
  margin-top: 2px;
}

.adventure-title-empty {
  grid-column: 1 / -1;
  padding: 22px;
  border: 1px dashed rgba(132, 111, 72, .3);
  border-radius: 14px;
  color: #877d6d;
  text-align: center;
  font-size: 12px;
}

.adventure-title-status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(238, 233, 219, .78);
  color: #6f6658;
  font-size: 11px;
  line-height: 1.5;
}

.adventure-title-status.ok { background: rgba(223, 239, 220, .82); color: #41643c; }
.adventure-title-status.warn { background: rgba(245, 236, 207, .82); color: #82671e; }
.adventure-title-status.loading { background: rgba(225, 233, 242, .82); color: #4a627e; }
.adventure-title-status.error { background: rgba(246, 222, 218, .86); color: #9b4437; }

.title-old-world-survivor,
.adventure-title-card.title-old-world-survivor h3,
#adventureEquippedTitle.title-old-world-survivor {
  color: #9a6a18;
  text-shadow: 0 1px 0 rgba(255,255,255,.68);
}

@media (max-width: 760px) {
  .adventure-title-heading { grid-template-columns: 1fr; }
  .adventure-title-manager { padding: 16px; }
  .adventure-title-list { grid-template-columns: 1fr; }
}

/* 1.2 hotfix · 전투력·모험가 랭킹 칭호 연한 회색 조정 */
.rank-player-title.title-old-world-survivor,
.my-rank-title.title-old-world-survivor {
  color: #969aa0 !important;
  text-shadow: none !important;
}

/* ============================================================
   1.4 · 마을 신입 용병 정착 의뢰
   ============================================================ */
.village-starter-card {
  margin-top: 22px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(88, 130, 73, .3);
  border-radius: 20px;
  background:
    radial-gradient(circle at 92% 10%, rgba(171, 210, 138, .26), transparent 34%),
    linear-gradient(145deg, rgba(251, 253, 244, .94), rgba(234, 242, 218, .9));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 12px 28px rgba(55, 84, 43, .08);
}

.village-starter-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 250px);
  gap: 18px;
  align-items: stretch;
  padding: 22px;
}

.village-starter-toggle {
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition: background .2s ease, box-shadow .2s ease;
}

.village-starter-toggle::-webkit-details-marker { display: none; }
.village-starter-toggle::marker { content: ""; }
.village-starter-toggle:hover { background: rgba(255,255,255,.28); }
.village-starter-toggle:focus-visible {
  outline: 3px solid rgba(110, 151, 78, .34);
  outline-offset: -3px;
}

.village-starter-card[open] .village-starter-toggle {
  background: rgba(255,255,255,.2);
  box-shadow: inset 0 -1px 0 rgba(88, 130, 73, .14);
}

.village-starter-card:not([open]) .village-starter-heading {
  align-items: center;
}

.village-starter-card:not([open]) .village-starter-heading p {
  display: none;
}

.village-starter-card:not([open]) .village-starter-heading h2 {
  margin-bottom: 0;
}

.village-starter-body {
  padding: 18px 22px 22px;
  animation: villageStarterReveal .22s ease-out;
}

@keyframes villageStarterReveal {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.village-starter-heading h2 {
  margin: 5px 0 7px;
  color: #33442c;
  font-size: 22px;
}

.village-starter-heading p {
  margin: 0;
  color: #687361;
  font-size: 13px;
  line-height: 1.65;
}

.village-starter-summary {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 15px;
  border: 1px solid rgba(76, 116, 62, .22);
  border-radius: 15px;
  background: rgba(255,255,255,.72);
}

.village-starter-toggle-hint {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  padding-top: 2px;
  color: #607553;
  font-size: 10px;
  font-weight: 900;
}

.village-starter-toggle-label-open { display: none; }
.village-starter-card[open] .village-starter-toggle-label-closed { display: none; }
.village-starter-card[open] .village-starter-toggle-label-open { display: inline; }

.village-starter-chevron {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e5edd5;
  color: #557044;
  font-size: 17px;
  line-height: 1;
  transform: translateY(-1px);
  transition: transform .2s ease, background .2s ease;
}

.village-starter-card[open] .village-starter-chevron {
  background: #d8e6c7;
  transform: rotate(180deg) translateY(1px);
}

#villageStarterBadge {
  justify-self: start;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e5edd5;
  color: #557044;
  font-size: 10px;
  font-weight: 900;
}

#villageStarterBadge.completed { background: #d3e8c7; color: #315d2e; }
#villageStarterProgressText { color: #40553a; font-size: 20px; }

.village-starter-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(74, 102, 61, .13);
}

.village-starter-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7da65d, #b3c96c);
  transition: width .25s ease;
}

.village-starter-mission-list {
  display: grid;
  gap: 10px;
  margin-top: 0;
}

.village-starter-mission {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(104, 120, 87, .18);
  border-radius: 15px;
  background: rgba(255,255,255,.68);
}

.village-starter-mission.current { border-color: rgba(122, 150, 82, .45); }
.village-starter-mission.ready {
  border-color: rgba(97, 148, 67, .62);
  box-shadow: 0 0 0 2px rgba(124, 170, 88, .1);
}
.village-starter-mission.claimed { opacity: .76; background: rgba(238, 243, 229, .76); }
.village-starter-mission.locked { opacity: .6; }

.village-starter-step {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e2ead6;
  color: #536c42;
  font-size: 13px;
  font-weight: 950;
}

.village-starter-mission.ready .village-starter-step,
.village-starter-mission.claimed .village-starter-step { background: #78a35f; color: #fff; }

.village-starter-mission-copy { min-width: 0; }
.village-starter-mission-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.village-starter-mission-title strong { color: #3d4b36; font-size: 14px; }
.village-starter-mission-title span { color: #75816d; font-size: 10px; font-weight: 900; }
.village-starter-mission-copy p { margin: 5px 0 8px; color: #737b6d; font-size: 11px; line-height: 1.5; }
.village-starter-mission-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.village-starter-mission-meta span { color: #65745c; font-size: 10px; font-weight: 800; }
.village-starter-mission-meta strong { color: #6b7f45; font-size: 11px; }
.village-starter-claim { min-width: 92px; }

.village-starter-rare-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: #5d6b55;
  font-size: 11px;
  font-weight: 800;
}

.village-starter-rare-choice select {
  min-width: 110px;
  padding: 7px 9px;
  border: 1px solid rgba(92, 118, 72, .35);
  border-radius: 9px;
  background: rgba(255,255,255,.9);
  color: #405238;
  font: inherit;
}

.village-starter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.village-starter-status {
  flex: 1;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(238, 233, 219, .78);
  color: #6f6658;
  font-size: 11px;
  line-height: 1.5;
}

.village-starter-status.ok { background: rgba(223, 239, 220, .82); color: #41643c; }
.village-starter-status.warn { background: rgba(245, 236, 207, .82); color: #82671e; }
.village-starter-status.loading { background: rgba(225, 233, 242, .82); color: #4a627e; }
.village-starter-status.error { background: rgba(246, 222, 218, .86); color: #9b4437; }
.village-starter-empty { padding: 22px; border: 1px dashed rgba(91, 119, 73, .3); border-radius: 14px; color: #788273; text-align: center; font-size: 12px; }

.title-village-new-mercenary,
.adventure-title-card.title-village-new-mercenary h3,
#adventureEquippedTitle.title-village-new-mercenary { color: #52753b; text-shadow: 0 1px 0 rgba(255,255,255,.74); }

@media (max-width: 760px) {
  .village-starter-heading { grid-template-columns: 1fr; padding: 16px; }
  .village-starter-body { padding: 14px 16px 16px; }
  .village-starter-card:not([open]) .village-starter-heading {
    grid-template-columns: minmax(0, 1fr) minmax(126px, 150px);
    gap: 10px;
  }
  .village-starter-card:not([open]) .village-starter-heading h2 { font-size: 18px; }
  .village-starter-card:not([open]) .village-starter-summary { gap: 6px; padding: 10px 11px; }
  .village-starter-card:not([open]) #villageStarterProgressText { font-size: 17px; }
  .village-starter-card:not([open]) .village-starter-toggle-label { display: none; }
  .village-starter-mission { grid-template-columns: 34px minmax(0, 1fr); }
  .village-starter-claim { grid-column: 2; width: 100%; }
  .village-starter-mission-title, .village-starter-mission-meta { align-items: flex-start; flex-direction: column; gap: 4px; }
  .village-starter-footer { align-items: stretch; flex-direction: column; }
  .village-starter-footer button { width: 100%; }
}

@media (max-width: 430px) {
  .village-starter-card:not([open]) .village-starter-heading {
    grid-template-columns: minmax(0, 1fr) 112px;
  }
  .village-starter-card:not([open]) .adventure-guild-kicker { font-size: 8px; }
  .village-starter-card:not([open]) .village-starter-heading h2 { font-size: 16px; line-height: 1.35; }
  .village-starter-card:not([open]) .village-starter-summary { padding: 9px; }
}

/* ============================================================
   1.3 · 보관함 500칸 보호 / 대장장이 장인
   ============================================================ */

.inventory-title-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.inventory-bulk-sell-button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 8px 12px;
  border-color: rgba(174, 112, 34, .24);
  color: #8a5718;
  background: #fff6e7;
  font-size: 11px;
  font-weight: 850;
}

.inventory-bulk-sell-button:not(:disabled):hover {
  border-color: rgba(174, 112, 34, .38);
  background: #ffedce;
}

@media (max-width: 520px) {
  .inventory-title {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .inventory-bulk-sell-button { width: 100%; }
}

.inventory-capacity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 66px;
  min-height: 24px;
  padding: 4px 9px;
  border: 1px solid rgba(75, 83, 96, .16);
  border-radius: 999px;
  background: #f0f1f3;
  color: #686d75;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .015em;
  font-variant-numeric: tabular-nums;
}

.inventory-capacity-badge.warning {
  border-color: rgba(186, 127, 25, .27);
  background: #fff5dc;
  color: #99620d;
}

.inventory-capacity-badge.full {
  border-color: rgba(190, 61, 54, .30);
  background: #ffebe8;
  color: #b23732;
}

.inventory-capacity-track {
  width: 100%;
  height: 7px;
  margin: 10px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8e9ec;
  box-shadow: inset 0 1px 2px rgba(37, 39, 43, .08);
}

.inventory-capacity-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #9aa3ae, #747f8c);
  transition: width .24s ease, background .24s ease;
}

.inventory-capacity-bar.warning {
  background: linear-gradient(90deg, #d9b04f, #c8871c);
}

.inventory-capacity-bar.full {
  background: linear-gradient(90deg, #dc756d, #bd3e38);
}

.inventory-capacity-warning {
  margin: 0 0 10px;
  padding: 9px 11px;
  border: 1px solid rgba(186, 127, 25, .20);
  border-radius: 11px;
  background: rgba(255, 246, 220, .90);
  color: #8d641b;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.45;
}

.inventory-capacity-warning.full {
  border-color: rgba(190, 61, 54, .22);
  background: rgba(255, 235, 232, .90);
  color: #a43c36;
}

.inventory-count-warning {
  color: #a46a0e !important;
}

.inventory-count-full {
  color: #b43832 !important;
}

.master-blacksmith-card {
  position: relative;
  margin-top: 22px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(129, 99, 42, .18);
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 4%, rgba(225, 181, 88, .15), transparent 34%),
    linear-gradient(145deg, rgba(255,255,255,.96), rgba(247,244,236,.96));
  box-shadow: 0 12px 28px rgba(68, 49, 18, .08);
}

.master-blacksmith-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #b5832e, #76501e);
  opacity: .76;
}

.master-blacksmith-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.master-blacksmith-head h2 {
  margin: 3px 0 0;
  color: #382e21;
  font-size: 18px;
  line-height: 1.28;
}

.master-blacksmith-kicker {
  color: #9a742e;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .15em;
}

.master-blacksmith-contract-badge {
  flex: 0 0 auto;
  max-width: 116px;
  padding: 6px 9px;
  border: 1px solid rgba(135, 104, 48, .18);
  border-radius: 999px;
  background: rgba(238, 226, 197, .74);
  color: #76561f;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.master-blacksmith-description {
  position: relative;
  margin: 12px 0;
  color: #6e6455;
  font-size: 11px;
  line-height: 1.58;
}

.master-blacksmith-rates {
  position: relative;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.master-blacksmith-rates span {
  padding: 5px 8px;
  border: 1px solid rgba(70, 64, 54, .10);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  font-size: 9px;
  font-weight: 950;
  box-shadow: 0 3px 9px rgba(51, 42, 26, .045);
}

.master-blacksmith-facts {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.master-blacksmith-facts > div {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid rgba(90, 76, 53, .10);
  border-radius: 11px;
  background: rgba(255,255,255,.70);
}

.master-blacksmith-facts span {
  color: #8d8374;
  font-size: 9px;
  font-weight: 750;
}

.master-blacksmith-facts strong {
  color: #494033;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.master-blacksmith-progress-card {
  position: relative;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(112, 87, 43, .12);
  border-radius: 12px;
  background: rgba(242, 236, 222, .72);
}

.master-blacksmith-progress-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.master-blacksmith-progress-head > div {
  display: grid;
  gap: 2px;
}

.master-blacksmith-progress-head span {
  color: #8b806f;
  font-size: 9px;
  font-weight: 800;
}

.master-blacksmith-progress-head strong {
  color: #504432;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.master-blacksmith-next {
  min-width: 0;
  text-align: right;
}

.master-blacksmith-next strong {
  overflow-wrap: anywhere;
}

.master-blacksmith-progress-track {
  height: 7px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(116, 96, 61, .13);
}

.master-blacksmith-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b17a25, #d1a14b);
  transition: width .28s ease;
}

.master-blacksmith-hire {
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
}

.master-blacksmith-hire:disabled,
.master-blacksmith-delivery-actions button:disabled {
  cursor: not-allowed;
  opacity: .52;
  filter: saturate(.45);
}

.master-blacksmith-delivery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 16px 0 8px;
}

.master-blacksmith-delivery-head h3 {
  margin: 0;
  color: #4a4033;
  font-size: 13px;
}

.master-blacksmith-delivery-head span {
  color: #8d8374;
  font-size: 9px;
  font-weight: 800;
}

.master-blacksmith-delivery-list {
  display: grid;
  gap: 7px;
}

.master-blacksmith-delivery,
.master-blacksmith-empty {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid rgba(90, 76, 53, .10);
  border-radius: 11px;
  background: rgba(255,255,255,.72);
}

.master-blacksmith-delivery.ready {
  border-color: rgba(173, 123, 33, .24);
  background: rgba(255, 249, 230, .90);
}

.master-blacksmith-delivery.processed {
  opacity: .74;
  background: rgba(241, 242, 243, .76);
}

.master-blacksmith-empty {
  grid-template-columns: 1fr;
  min-height: 64px;
  color: #817665;
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}

.master-blacksmith-slot-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #eee8dc;
  color: #735a2e;
  font-size: 10px;
  font-weight: 950;
}

.master-blacksmith-delivery-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.master-blacksmith-delivery-copy strong,
.master-blacksmith-item-name {
  min-width: 0;
  overflow: hidden;
  color: #4c4439;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.master-blacksmith-delivery-copy small {
  min-width: 0;
  overflow: hidden;
  color: #8b8275;
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.master-blacksmith-slot-state {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: #eeeef0;
  color: #797b82;
  font-size: 8px;
  font-weight: 900;
}

.master-blacksmith-slot-state.done {
  background: #e4efe2;
  color: #54734f;
}

.master-blacksmith-delivery-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.master-blacksmith-delivery-actions button {
  min-height: 29px;
  padding: 5px 8px;
  border: 1px solid rgba(92, 74, 44, .16);
  border-radius: 8px;
  background: #f0eee9;
  color: #5d503d;
  font-size: 8px;
  font-weight: 900;
  cursor: pointer;
}

.master-blacksmith-delivery-actions button:last-child {
  background: #755226;
  color: #fff;
}

.master-blacksmith-delivery-actions button:not(:disabled):hover {
  transform: translateY(-1px);
  filter: brightness(.98);
}

.master-blacksmith-status {
  margin-top: 9px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(235, 237, 240, .82);
  color: #656b73;
  font-size: 9px;
  line-height: 1.5;
}

.master-blacksmith-status.ok {
  background: rgba(228, 240, 225, .88);
  color: #4c7046;
}

.master-blacksmith-status.warn {
  background: rgba(249, 239, 209, .90);
  color: #84661d;
}

.master-blacksmith-status.loading {
  background: rgba(226, 234, 244, .86);
  color: #506a83;
}

.master-blacksmith-status.error {
  background: rgba(249, 226, 222, .90);
  color: #a24a41;
}

@media (max-width: 1120px) {
  .master-blacksmith-card {
    padding: 16px;
  }
}

@media (max-width: 560px) {
  .master-blacksmith-head {
    align-items: center;
  }

  .master-blacksmith-head h2 {
    font-size: 16px;
  }

  .master-blacksmith-facts {
    grid-template-columns: 1fr 1fr;
  }

  .master-blacksmith-delivery {
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .master-blacksmith-delivery-actions,
  .master-blacksmith-slot-state {
    grid-column: 2;
    justify-self: start;
  }

  .master-blacksmith-delivery-actions {
    width: 100%;
  }

  .master-blacksmith-delivery-actions button {
    flex: 1 1 0;
  }
}

#inventoryCountText {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   1.3 통합 패치 · 누군가의 미안한 마음
   ============================================================ */

.sorry-gift-card {
  position: relative;
  margin-top: 22px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(143, 79, 85, .18);
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 4%, rgba(211, 120, 129, .14), transparent 34%),
    linear-gradient(145deg, rgba(255,255,255,.97), rgba(250,243,244,.96));
  box-shadow: 0 12px 28px rgba(87, 46, 51, .075);
}

.sorry-gift-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #c27680, #8f4c57);
  opacity: .8;
}

.sorry-gift-card.error {
  border-color: rgba(190, 61, 54, .24);
  background: linear-gradient(145deg, #fff, #fff1ef);
}

.sorry-gift-card-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sorry-gift-card-head h2 {
  margin: 3px 0 0;
  color: #443035;
  font-size: 18px;
  line-height: 1.28;
}

.sorry-gift-kicker {
  color: #a45d68;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .15em;
}

.sorry-gift-card-badge {
  flex: 0 0 auto;
  max-width: 116px;
  padding: 6px 9px;
  border: 1px solid rgba(143, 76, 87, .16);
  border-radius: 999px;
  background: rgba(244, 220, 224, .82);
  color: #864a54;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.sorry-gift-card-description {
  position: relative;
  margin: 12px 0;
  color: #75656a;
  font-size: 11px;
  line-height: 1.58;
}

.sorry-gift-card-counter {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid rgba(143, 76, 87, .10);
  border-radius: 12px;
  background: rgba(250, 237, 239, .75);
}

.sorry-gift-card-counter > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sorry-gift-card-counter span {
  color: #8e7379;
  font-size: 9px;
  font-weight: 800;
}

.sorry-gift-card-counter strong {
  color: #6e4049;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.sorry-gift-card-progress-track,
.sorry-gift-modal-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(139, 83, 93, .12);
}

.sorry-gift-card-progress,
.sorry-gift-modal-progress {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b95f6c, #d99099);
  transition: width .28s ease;
}

.sorry-gift-card-button {
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  background: linear-gradient(135deg, #9d5661, #7b3f49);
  color: #fff;
}

.sorry-gift-card-button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.sorry-gift-card-status,
.sorry-gift-modal-status {
  margin-top: 9px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(238, 239, 242, .88);
  color: #666b73;
  font-size: 9px;
  line-height: 1.5;
}

.sorry-gift-card-status.ok,
.sorry-gift-modal-status.ok {
  background: rgba(228, 240, 225, .9);
  color: #4b7045;
}

.sorry-gift-card-status.waiting,
.sorry-gift-modal-status.waiting {
  background: rgba(248, 237, 239, .92);
  color: #7f5660;
}

.sorry-gift-card-status.loading,
.sorry-gift-modal-status.loading {
  background: rgba(226, 234, 244, .88);
  color: #506a83;
}

.sorry-gift-card-status.warn,
.sorry-gift-modal-status.warn {
  background: rgba(249, 239, 209, .92);
  color: #84661d;
}

.sorry-gift-card-status.complete,
.sorry-gift-modal-status.complete {
  background: rgba(232, 232, 235, .92);
  color: #696b72;
}

.sorry-gift-card-status.error,
.sorry-gift-modal-status.error {
  background: rgba(249, 226, 222, .92);
  color: #a24a41;
}

.sorry-gift-modal-card {
  width: min(560px, 100%);
  max-height: min(88vh, 760px);
  overflow-y: auto;
  border-color: rgba(194, 118, 128, .30);
  background:
    radial-gradient(circle at 92% 0%, rgba(214, 125, 137, .17), transparent 34%),
    linear-gradient(155deg, #fff, #fcf4f5);
  color: #3d2f33;
  box-shadow: 0 28px 90px rgba(48, 25, 29, .34);
}

.sorry-gift-modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.sorry-gift-modal-card h2 {
  color: #412e33;
}

.sorry-gift-modal-card p {
  color: #75676b;
}

.sorry-gift-modal-badge {
  background: rgba(177, 88, 102, .11);
  color: #9a4f5c;
}

.sorry-gift-box-visual {
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(156, 78, 91, .15);
  border-radius: 20px;
  background: linear-gradient(145deg, #fff6f7, #f4dfe3);
  box-shadow: 0 10px 24px rgba(107, 54, 63, .12);
  font-size: 32px;
}

.sorry-gift-modal-counter {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-top: 4px;
  padding: 12px 13px;
  border: 1px solid rgba(143, 76, 87, .11);
  border-radius: 13px 13px 0 0;
  background: rgba(249, 234, 237, .76);
}

.sorry-gift-modal-counter > div {
  display: grid;
  gap: 2px;
}

.sorry-gift-modal-counter span,
.sorry-gift-modal-counter small {
  color: #8a7278;
  font-size: 10px;
  font-weight: 800;
}

.sorry-gift-modal-counter strong {
  color: #713f49;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.sorry-gift-modal-progress-track {
  border-radius: 0 0 999px 999px;
  background: rgba(137, 77, 87, .13);
}

.sorry-gift-result {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(122, 83, 57, .12);
  border-radius: 13px;
  background: rgba(255,255,255,.78);
}

.sorry-gift-result-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.sorry-gift-result-head strong {
  color: #4f3e42;
  font-size: 12px;
}

.sorry-gift-result-head span {
  color: #969095;
  font-size: 8px;
  font-weight: 750;
}

.sorry-gift-result-summary {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.sorry-gift-result-chip {
  padding: 4px 7px;
  border: 1px solid rgba(72, 63, 65, .10);
  border-radius: 999px;
  background: #f5f3f3;
  font-size: 8px;
  font-weight: 900;
}

.sorry-gift-result-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
}

.sorry-gift-result-item {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid rgba(75, 64, 66, .09);
  border-radius: 10px;
  background: rgba(248, 247, 247, .94);
}

.sorry-gift-result-item > span {
  font-size: 8px;
  font-weight: 950;
}

.sorry-gift-result-item strong {
  overflow: hidden;
  color: #4f4648;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sorry-gift-result-item small {
  overflow: hidden;
  color: #8c8587;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sorry-gift-draw-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.sorry-gift-draw-buttons {
  display: grid;
  grid-template-columns: .8fr .8fr 1.4fr;
  gap: 7px;
}

.sorry-gift-draw-buttons button,
.sorry-gift-close-button {
  width: 100%;
  min-height: 42px;
}

.sorry-gift-draw-buttons .primary-button {
  background: linear-gradient(135deg, #9d5661, #783e48);
  color: #fff;
}

.sorry-gift-draw-buttons button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.sorry-gift-close-button {
  margin-top: 0;
}

@media (max-width: 560px) {
  .sorry-gift-card,
  .sorry-gift-modal-card {
    padding: 16px;
  }

  .sorry-gift-card-head {
    align-items: center;
  }

  .sorry-gift-card-head h2 {
    font-size: 16px;
  }

  .sorry-gift-modal-top {
    align-items: flex-start;
  }

  .sorry-gift-box-visual {
    width: 52px;
    height: 52px;
    border-radius: 17px;
    font-size: 27px;
  }

  .sorry-gift-modal-counter {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .sorry-gift-result-list {
    grid-template-columns: 1fr;
  }

  .sorry-gift-draw-buttons {
    grid-template-columns: 1fr 1fr;
  }

  .sorry-gift-draw-buttons .primary-button {
    grid-column: 1 / -1;
  }
}

/* ============================================================
   1.5 VILLAGE RESTORATION WORKSHOP
   ============================================================ */
.forge-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0 18px;
  padding: 5px;
  border: 1px solid rgba(77, 67, 52, .12);
  border-radius: 14px;
  background: rgba(92, 76, 52, .055);
}

.forge-mode-tab {
  min-width: 0;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #77746e;
  background: transparent;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .15s ease, color .15s ease, background .15s ease, border-color .15s ease;
}

.forge-mode-tab:hover {
  transform: translateY(-1px);
  color: #5f4b2e;
}

.forge-mode-tab.active {
  color: #684812;
  border-color: rgba(167, 121, 39, .26);
  background: linear-gradient(180deg, #fffdf8, #f8f1e3);
  box-shadow: 0 5px 14px rgba(91, 68, 31, .08);
}

.restoration-workshop {
  display: grid;
  gap: 16px;
}

.restoration-workshop.hidden {
  display: none !important;
}

#lootScreen.restoration-mode {
  width: min(920px, 100%);
  grid-template-columns: minmax(0, 1fr);
}

#lootScreen.restoration-mode .equipment-panel,
#lootScreen.restoration-mode .ranking-panel {
  display: none;
}

.restoration-hero,
.restoration-legend-progress,
.restoration-dismantle-card {
  border: 1px solid rgba(107, 82, 43, .13);
  border-radius: 17px;
  background: linear-gradient(155deg, rgba(255, 253, 248, .98), rgba(247, 242, 232, .96));
}

.restoration-hero {
  display: grid;
  gap: 13px;
  padding: 17px;
}

.restoration-kicker,
.restoration-step {
  color: #a16d1e;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .13em;
}

.restoration-hero h2 {
  margin: 5px 0 0;
  color: #34302a;
  font-size: 21px;
}

.restoration-hero p {
  margin: 8px 0 0;
  color: #77736c;
  font-size: 12px;
  line-height: 1.65;
}

.restoration-balance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(171, 126, 43, .18);
  border-radius: 13px;
  color: #7c6844;
  background: rgba(245, 228, 191, .38);
}

.restoration-balance-card span {
  font-size: 11px;
  font-weight: 800;
}

.restoration-balance-card strong {
  color: #9c6c18;
  font-size: 23px;
  font-variant-numeric: tabular-nums;
}

.restoration-legend-progress {
  padding: 15px;
}

.restoration-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #6f6658;
  font-size: 11px;
  font-weight: 850;
}

.restoration-progress-head strong {
  color: #9a6815;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.restoration-progress-track {
  height: 10px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5dfd3;
}

.restoration-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b37a1e, #e3b34f);
  transition: width .25s ease;
}

.restoration-legend-progress small {
  display: block;
  margin-top: 9px;
  color: #8a857c;
  font-size: 10px;
  line-height: 1.5;
}

.restoration-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.restoration-section-head h3 {
  margin: 4px 0 0;
  color: #3f3b35;
  font-size: 15px;
}

.restoration-recipe-heading {
  margin-top: 2px;
}

.restoration-type-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.restoration-type-button {
  min-height: 43px;
  padding: 9px;
  border: 1px solid rgba(66, 63, 58, .12);
  border-radius: 11px;
  color: #74716a;
  background: #f8f7f4;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.restoration-type-button.active {
  color: #6e4a13;
  border-color: rgba(176, 126, 37, .35);
  background: #fff7e7;
  box-shadow: inset 0 0 0 1px rgba(202, 154, 65, .08);
}

.restoration-recipes {
  display: grid;
  gap: 9px;
}

.restoration-recipe-card {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 14px;
  border: 1px solid rgba(73, 105, 148, .18);
  border-radius: 13px;
  text-align: left;
  background: linear-gradient(145deg, #f9fbff, #f1f5fa);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.restoration-recipe-card.epic {
  border-color: rgba(130, 72, 171, .18);
  background: linear-gradient(145deg, #fdf9ff, #f7f0fb);
}

.restoration-recipe-card.legendary {
  border-color: rgba(177, 125, 36, .25);
  background: linear-gradient(145deg, #fffaf0, #f7ecd5);
}

.restoration-recipe-card:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(69, 55, 32, .09);
}

.restoration-recipe-card:disabled {
  cursor: not-allowed;
  opacity: .48;
  filter: grayscale(.12);
}

.restoration-recipe-label {
  font-size: 12px;
  font-weight: 950;
}

.restoration-recipe-card strong {
  color: #3e3b36;
  font-size: 17px;
}

.restoration-recipe-card small {
  color: #807b73;
  font-size: 10px;
}

.restoration-last-result {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid rgba(170, 123, 36, .25);
  border-radius: 13px;
  background: #fff8e8;
}

.restoration-last-result span,
.restoration-last-result small {
  color: #807466;
  font-size: 10px;
}

.restoration-last-result strong {
  font-size: 15px;
}

.restoration-dismantle-card {
  padding: 15px;
}

.restoration-eligible-count {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  color: #71644d;
  background: #eee8dc;
  font-size: 9px;
  font-weight: 850;
}

.restoration-fragment-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
}

.restoration-fragment-rules span {
  padding: 5px 8px;
  border: 1px solid rgba(70, 68, 63, .09);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  font-size: 9px;
  font-weight: 900;
}

.restoration-protection-note {
  margin: 10px 0 0;
  color: #8a8174;
  font-size: 9px;
  line-height: 1.55;
}

.restoration-dismantle-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 12px;
}

.restoration-dismantle-controls button {
  min-height: 38px;
  padding: 8px;
  font-size: 10px;
}

.restoration-dismantle-list {
  display: grid;
  gap: 6px;
  max-height: 430px;
  margin-top: 12px;
  padding-right: 3px;
  overflow-y: auto;
}

.restoration-dismantle-row {
  display: grid;
  grid-template-columns: 20px 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(71, 69, 64, .09);
  border-radius: 11px;
  background: rgba(255, 255, 255, .68);
  cursor: pointer;
}

.restoration-dismantle-row.selected {
  border-color: rgba(176, 125, 35, .33);
  background: #fff7e8;
}

.restoration-dismantle-row input {
  width: 17px;
  height: 17px;
  accent-color: #b27b20;
}

.restoration-item-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(80, 74, 63, .065);
  font-size: 17px;
}

.restoration-item-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.restoration-item-copy strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restoration-item-copy small {
  color: #8b8881;
  font-size: 9px;
}

.restoration-item-fragments {
  color: #9f6d18;
  font-size: 11px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.restoration-empty {
  padding: 24px 12px;
  border-radius: 11px;
  color: #8b877f;
  background: rgba(255, 255, 255, .52);
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.restoration-dismantle-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.restoration-dismantle-summary > div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(229, 222, 209, .48);
}

.restoration-dismantle-summary span {
  color: #837d73;
  font-size: 9px;
}

.restoration-dismantle-summary strong {
  color: #5d5140;
  font-size: 12px;
}

.restoration-dismantle-button {
  width: 100%;
  min-height: 43px;
  margin-top: 9px;
}

.restoration-workshop-status {
  min-height: 20px;
  padding: 10px 12px;
  border-radius: 11px;
  color: #7b705f;
  background: #f3efe7;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.restoration-workshop-status.ok {
  color: #39704f;
  background: #eef7f1;
}

.restoration-workshop-status.loading {
  color: #765b29;
  background: #fff7e8;
}

.restoration-workshop-status.error {
  color: #984750;
  background: #fff0f1;
}

@media (max-width: 480px) {
  .forge-mode-tab {
    padding-inline: 6px;
    font-size: 11px;
  }

  .restoration-hero,
  .restoration-legend-progress,
  .restoration-dismantle-card {
    padding: 13px;
  }

  .restoration-dismantle-controls,
  .restoration-dismantle-summary {
    grid-template-columns: 1fr;
  }

  .restoration-dismantle-list {
    max-height: 60vh;
  }

  .restoration-dismantle-row {
    grid-template-columns: 20px 30px minmax(0, 1fr) auto;
    gap: 6px;
    padding: 8px 6px;
  }

  .restoration-item-icon {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }
}
.market-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 310px);
  gap: 18px;
  width: min(1240px, calc(100% - 32px));
  margin: 18px auto 40px;
  align-items: start;
}

.market-screen.hidden { display: none; }

.market-main,
.market-side {
  padding: 24px;
  border-radius: 22px;
}

.market-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.market-heading h1 { margin: 4px 0 8px; }
.market-heading p { margin: 0; color: var(--muted, #6d685c); }
.market-kicker,
.market-side-kicker { color: #a36b00; font-size: 12px; font-weight: 900; letter-spacing: .16em; }

.market-server-status,
.market-policy {
  margin-top: 16px;
  padding: 11px 14px;
  border: 1px solid rgba(157, 128, 65, .2);
  border-radius: 12px;
  background: rgba(255, 249, 232, .72);
  color: #6b5630;
  font-size: 13px;
}

.market-server-status.success { color: #26653b; background: rgba(231, 248, 234, .78); }
.market-server-status.error { color: #9e3232; background: rgba(255, 235, 235, .82); }

.market-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.market-subtab {
  border: 1px solid rgba(126, 106, 68, .23);
  border-radius: 10px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, .72);
  color: #605642;
  font-weight: 800;
  cursor: pointer;
}

.market-subtab.active {
  border-color: #b98a32;
  background: #c9963a;
  color: #fff;
}

.market-view.hidden { display: none; }

.market-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) repeat(3, minmax(120px, .8fr)) auto;
  gap: 8px;
  margin-bottom: 14px;
}

.market-input {
  min-width: 0;
  height: 42px;
  border: 1px solid rgba(126, 106, 68, .28);
  border-radius: 10px;
  padding: 0 12px;
  background: rgba(255, 255, 255, .9);
  color: #2e2a23;
}

.market-search-button { min-width: 72px; }
.market-wide-input { width: 100%; }

.market-register-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(200px, .7fr);
  gap: 12px;
  margin: 15px 0 10px;
}

.market-field-label { display: block; margin: 0 0 6px; color: #5d5548; font-size: 13px; font-weight: 800; }
.market-net-amount { margin: 0 0 12px; color: #5c523e; font-size: 14px; }
.market-register-preview { margin-top: 16px; }

.market-list { display: grid; gap: 10px; }

.market-listing-card,
.market-mini-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(130, 108, 65, .19);
  border-radius: 14px;
  background: rgba(255, 255, 255, .77);
}

.market-mini-item { padding: 11px 14px; }
.market-item-copy { display: grid; gap: 4px; min-width: 0; }
.market-item-name { overflow-wrap: anywhere; font-size: 15px; }
.market-item-copy span { color: #736b5d; font-size: 12px; }

.market-price-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.market-price-actions > strong { color: #8a600a; white-space: nowrap; }
.market-empty { padding: 34px 16px; text-align: center; color: #7b7468; }
.market-side h2 { margin: 7px 0 12px; }
.market-side ul { margin: 0; padding-left: 20px; color: #635d52; line-height: 1.75; font-size: 13px; }

@media (max-width: 900px) {
  .market-screen { grid-template-columns: 1fr; width: min(100% - 20px, 760px); }
  .market-side { order: 2; }
  .market-filters { grid-template-columns: 1fr 1fr; }
  .market-search { grid-column: 1 / -1; }
  .market-search-button { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .market-main, .market-side { padding: 16px; border-radius: 16px; }
  .market-heading p { font-size: 13px; }
  .market-subtabs { display: grid; grid-template-columns: 1fr 1fr; }
  .market-subtab { padding: 9px 7px; }
  .market-filters, .market-register-grid { grid-template-columns: 1fr; }
  .market-search, .market-search-button { grid-column: auto; }
  .market-listing-card { align-items: stretch; flex-direction: column; }
  .market-price-actions { justify-content: space-between; }
}

/* 1.8 유물 도감 가독성 핫픽스: 밝은 테마에서도 잠금 정보가 읽히도록 대비를 보강합니다. */
.dungeon-relic-modal-card {
  background: rgba(255, 255, 255, .98);
  border-color: rgba(124, 99, 51, .18);
}

.dungeon-relic-card {
  border-color: rgba(132, 105, 54, .18);
  background: rgba(255, 252, 244, .92);
  color: #35312a;
}

.dungeon-relic-card.acquired {
  border-color: rgba(175, 127, 34, .32);
  background: rgba(255, 249, 232, .95);
}

.dungeon-relic-card.locked {
  opacity: .8;
}

.dungeon-relic-card h3 {
  color: #8a6212;
}

.dungeon-relic-source {
  color: #746c5e !important;
}

.dungeon-relic-effect {
  color: #514b42 !important;
}

.dungeon-relic-power,
.dungeon-relic-floor {
  color: #986b12;
}

.dungeon-relic-icon {
  background: rgba(139, 112, 60, .1);
  color: #595247;
}

.dungeon-relic-card button:disabled {
  background: rgba(91, 82, 67, .1);
  color: #737b88;
}

/* ============================================================
   2.4 · 용병단 연대기
   ============================================================ */

.story-launch-card {
  display: grid;
  grid-template-columns: minmax(230px, .78fr) minmax(0, 1.22fr);
  gap: 18px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(132, 45, 52, .28);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(55, 24, 31, .1), rgba(255,255,255,.72));
  box-shadow: inset 0 1px rgba(255,255,255,.68);
  overflow: hidden;
}

.story-launch-visual {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  border-radius: 16px;
  background: #281b20;
}

.story-launch-visual img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
  display: none;
}

.story-launch-vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(14, 8, 12, .82));
  pointer-events: none;
}

.story-launch-seal {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 215, 170, .34);
  border-radius: 999px;
  background: rgba(30, 13, 20, .72);
  color: #ffe4c1;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .14em;
}

.story-launch-copy {
  min-width: 0;
  align-self: center;
}

.story-launch-copy h2 {
  margin: 5px 0 9px;
  color: #382027;
  font-size: clamp(21px, 2vw, 28px);
}

.story-launch-copy > p {
  margin: 0;
  color: #6e6063;
  line-height: 1.7;
}

.story-launch-progress-row {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr);
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.story-launch-progress-row > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.story-launch-progress-row span {
  color: #85777a;
  font-size: 12px;
  font-weight: 800;
}

.story-launch-progress-row strong {
  color: #7a2536;
  font-size: 18px;
}

.story-launch-progress-track,
.story-chapter-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(91, 38, 49, .12);
}

.story-launch-progress-bar,
.story-chapter-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7d2639, #d4626d);
  transition: width .25s ease;
}

.story-launch-status {
  margin-top: 12px;
  color: #836e73;
  font-size: 12px;
  line-height: 1.5;
}

.story-launch-button {
  width: 100%;
  margin-top: 12px;
}

.story-chronicle-screen {
  width: min(1420px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.story-chronicle-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(210px, auto);
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  border-radius: 22px;
}

.story-back-button {
  align-self: stretch;
  min-width: 126px;
}

.story-chronicle-kicker {
  color: #9b4052;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .16em;
}

.story-chronicle-heading h1 {
  margin: 3px 0 4px;
  color: #35262a;
  font-size: clamp(25px, 3vw, 36px);
}

.story-chronicle-heading p {
  margin: 0;
  color: #797074;
  font-size: 13px;
}

.story-chronicle-header-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px 10px;
}

.story-release-badge {
  grid-column: 1 / -1;
  justify-self: end;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(149, 95, 38, .12);
  color: #9b6924;
  font-size: 10px;
  font-weight: 900;
}

.story-release-badge.released {
  background: rgba(99, 137, 87, .14);
  color: #4e7f44;
}

.story-chapter-progress-copy {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  color: #817579;
  font-size: 11px;
}

.story-chapter-progress-copy strong {
  color: #7e2639;
  font-size: 15px;
}

.story-chapter-progress-track {
  grid-column: 1;
  min-width: 150px;
}

.story-chronicle-header-side .icon-button {
  grid-column: 2;
  grid-row: 2 / span 2;
}

.story-chronicle-layout {
  display: grid;
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
  gap: 14px;
}

.story-chronicle-sidebar,
.story-player-shell {
  border-radius: 22px;
}

.story-chronicle-sidebar {
  padding: 16px;
  align-self: start;
}

.story-cover-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 16px;
  background: #25181d;
}

.story-cover-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.story-cover-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 20%, rgba(18, 9, 13, .88));
}

.story-cover-caption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  color: #fff3df;
}

.story-cover-caption span {
  display: block;
  color: #e3aab2;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .15em;
}

.story-cover-caption strong {
  display: block;
  margin-top: 2px;
  font-size: 20px;
}

.story-sidebar-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
  margin: 16px 2px 10px;
}

.story-sidebar-heading.compact {
  margin-top: 18px;
}

.story-sidebar-heading h2 {
  margin: 2px 0 0;
  color: #3c3033;
  font-size: 17px;
}

.story-sidebar-heading small {
  color: #92868a;
  font-size: 10px;
  text-align: right;
}

.story-episode-list {
  display: grid;
  gap: 8px;
}

.story-episode-card {
  width: 100%;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 11px;
  border: 1px solid rgba(88, 70, 75, .12);
  border-radius: 13px;
  background: rgba(255,255,255,.58);
  color: #3f3437;
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.story-episode-card:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(131, 42, 60, .28);
}

.story-episode-card.active {
  border-color: rgba(131, 42, 60, .42);
  background: rgba(134, 43, 61, .08);
  box-shadow: inset 3px 0 #8c2f43;
}

.story-episode-card.completed {
  background: rgba(77, 121, 77, .07);
}

.story-episode-card:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.story-episode-number {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(94, 52, 62, .1);
  color: #7c3242;
  font-size: 12px;
  font-weight: 950;
}

.story-episode-copy {
  min-width: 0;
}

.story-episode-copy strong,
.story-episode-copy small,
.story-episode-copy em {
  display: block;
}

.story-episode-copy strong {
  overflow: hidden;
  color: #403336;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-episode-copy small {
  margin-top: 3px;
  overflow: hidden;
  color: #8a7e82;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-episode-copy em {
  margin-top: 4px;
  color: #9d6f2e;
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
}

.story-episode-state {
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(92, 75, 80, .08);
  color: #7e7175;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.story-choice-archive {
  padding-top: 2px;
  border-top: 1px solid rgba(80, 62, 68, .1);
}

.story-choice-record-list {
  display: grid;
  gap: 7px;
  max-height: 260px;
  overflow: auto;
}

.story-choice-empty,
.story-log-empty {
  padding: 14px;
  border-radius: 11px;
  background: rgba(93, 76, 81, .05);
  color: #94888c;
  font-size: 11px;
  text-align: center;
}

.story-choice-record {
  padding: 9px 10px;
  border-radius: 11px;
  background: rgba(111, 49, 64, .06);
}

.story-choice-record span,
.story-choice-record strong {
  display: block;
}

.story-choice-record span {
  color: #92868a;
  font-size: 9px;
}

.story-choice-record strong {
  margin-top: 3px;
  color: #5b3b43;
  font-size: 11px;
  line-height: 1.45;
}

.story-player-shell {
  min-width: 0;
  padding: 18px;
}

.story-player-empty {
  min-height: 640px;
  display: grid;
  place-items: center;
  padding: 40px;
  color: #8c8185;
  text-align: center;
}

.story-player-content {
  display: grid;
  gap: 12px;
}

.story-player-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.story-episode-label {
  color: #9c4052;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .12em;
}

.story-player-heading h2 {
  margin: 3px 0 3px;
  color: #372a2e;
  font-size: 24px;
}

.story-player-heading p {
  margin: 0;
  color: #867b7f;
  font-size: 12px;
}

.story-player-meta {
  display: grid;
  justify-items: end;
  gap: 5px;
  color: #8a7d81;
  font-size: 11px;
  white-space: nowrap;
}

.story-player-meta strong {
  color: #6f4d55;
  font-size: 14px;
}

.story-scene-visual {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border: 1px solid rgba(30, 18, 23, .25);
  border-radius: 18px;
  background: #21171b;
  box-shadow: 0 16px 36px rgba(32, 19, 24, .22);
  isolation: isolate;
}

.story-background-image,
.story-illustration-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-background-image {
  display: none;
  z-index: -4;
}

.story-background-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: -5;
  color: rgba(255,255,255,.35);
  font-size: 90px;
}

.story-scene-gradient {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(14,8,12,.58), transparent 33%, transparent 67%, rgba(14,8,12,.58)),
    linear-gradient(180deg, rgba(11,7,9,.04), transparent 50%, rgba(11,7,9,.55));
  pointer-events: none;
}

.story-scene-grain {
  position: absolute;
  inset: 0;
  z-index: 5;
  opacity: .05;
  pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.9) .6px, transparent .8px);
  background-size: 5px 5px;
}

.story-portrait {
  position: absolute;
  bottom: -7%;
  width: min(37%, 360px);
  height: 92%;
  z-index: 1;
  opacity: .66;
  filter: saturate(.78) brightness(.78);
  transition: opacity .25s ease, filter .25s ease, transform .25s ease;
  pointer-events: none;
}

.story-portrait.focused {
  z-index: 2;
  opacity: 1;
  filter: saturate(1) brightness(1);
  transform: translateY(-1.5%);
}

.story-portrait-left {
  left: 1.5%;
}

.story-portrait-right {
  right: 1.5%;
}

.story-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 18px 18px 0 0;
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
}

.story-portrait span,
.story-monster span {
  width: 100%;
  height: 100%;
  display: none;
  place-items: center;
  color: rgba(255,255,255,.7);
  font-weight: 900;
}

.story-monster {
  position: absolute;
  left: 50%;
  bottom: 5%;
  width: min(44%, 430px);
  height: 78%;
  z-index: 2;
  transform: translateX(-50%);
  pointer-events: none;
}

.story-monster img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 24px rgba(0,0,0,.48));
  -webkit-mask-image: radial-gradient(ellipse 72% 70% at 50% 46%, #000 62%, transparent 100%);
  mask-image: radial-gradient(ellipse 72% 70% at 50% 46%, #000 62%, transparent 100%);
}

.story-monster.battle-active {
  animation: storyMonsterBreath 1.8s ease-in-out infinite alternate;
}

@keyframes storyMonsterBreath {
  from { transform: translateX(-50%) translateY(0) scale(1); }
  to { transform: translateX(-50%) translateY(-5px) scale(1.015); }
}

.story-illustration-image {
  z-index: 4;
  animation: storyIllustrationReveal 5s ease-out both;
}

@keyframes storyIllustrationReveal {
  from { transform: scale(1.08); opacity: .2; }
  to { transform: scale(1); opacity: 1; }
}

.story-battle-panel {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(108, 43, 57, .18);
  border-radius: 14px;
  background: rgba(60, 28, 37, .05);
}

.story-battle-side {
  min-width: 0;
}

.story-battle-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: #625158;
  font-size: 11px;
}

.story-battle-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-battle-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(77, 55, 62, .12);
}

.story-battle-fill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  transition: width .16s linear;
}

.story-battle-fill.enemy {
  background: linear-gradient(90deg, #7d2438, #d04f5e);
}

.story-battle-fill.player {
  background: linear-gradient(90deg, #467f58, #78b36c);
}

.story-battle-vs {
  color: #8d4b58;
  font-size: 11px;
  font-weight: 950;
}

.story-battle-log {
  grid-column: 1 / -1;
  min-height: 52px;
  max-height: 76px;
  margin: 0;
  padding: 9px 10px;
  overflow: auto;
  border-radius: 10px;
  background: rgba(28, 19, 23, .72);
  color: #e5dadd;
  font: 11px/1.45 inherit;
  white-space: pre-wrap;
}

.story-dialogue-panel {
  padding: 15px;
  border: 1px solid rgba(82, 61, 68, .12);
  border-radius: 16px;
  background: rgba(255,255,255,.75);
}

.story-dialogue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.story-dialogue-head > strong {
  color: #742a3b;
  font-size: 14px;
}

.story-dialogue-tools {
  display: flex;
  gap: 6px;
}

.story-tool-button {
  border: 1px solid rgba(80, 60, 67, .13);
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(86, 65, 72, .06);
  color: #706268;
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

.story-tool-button.active {
  border-color: rgba(137, 43, 62, .3);
  background: rgba(137, 43, 62, .12);
  color: #7b2a3d;
}

.story-dialogue-text {
  min-height: 66px;
  margin: 12px 0 14px;
  color: #4c4145;
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-line;
}

.story-choice-buttons {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.story-choice-button {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(113, 46, 61, .18);
  border-radius: 12px;
  background: rgba(120, 43, 59, .05);
  color: #523d43;
  text-align: left;
  cursor: pointer;
}

.story-choice-button:hover:not(:disabled) {
  border-color: rgba(126, 39, 58, .38);
  background: rgba(126, 39, 58, .1);
}

.story-choice-button.selected {
  border-color: rgba(96, 125, 78, .3);
  background: rgba(96, 125, 78, .08);
}

.story-choice-button span,
.story-choice-button strong,
.story-choice-button small {
  display: block;
}

.story-choice-button span {
  color: #5d8a54;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .1em;
}

.story-choice-button strong {
  font-size: 13px;
}

.story-choice-button small {
  margin-top: 4px;
  color: #8a7d81;
  font-size: 10px;
  line-height: 1.45;
}

.story-primary-action {
  width: 100%;
}

.story-primary-action.story-battle-action {
  background: linear-gradient(180deg, #cb5966, #8d2e43);
  color: #fff;
}

.story-primary-action.story-reward-action {
  background: linear-gradient(180deg, #f0ce76, #c7932f);
}

.story-chronicle-status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(95, 77, 83, .06);
  color: #807478;
  font-size: 11px;
  line-height: 1.5;
}

.story-chronicle-status.ok {
  background: rgba(75, 126, 79, .08);
  color: #567b50;
}

.story-chronicle-status.warn {
  background: rgba(157, 112, 40, .09);
  color: #8b672d;
}

.story-chronicle-status.error {
  background: rgba(153, 55, 55, .09);
  color: #a04444;
}

.story-chronicle-status.loading {
  color: #6c5d82;
}

.story-log-modal-card {
  width: min(680px, 100%);
}

.story-dialogue-log-list {
  display: grid;
  gap: 9px;
  max-height: min(58vh, 560px);
  overflow: auto;
  padding-right: 3px;
}

.story-log-entry {
  padding: 12px 13px;
  border-radius: 12px;
  background: rgba(91, 69, 76, .06);
}

.story-log-entry strong {
  color: #7b2f40;
  font-size: 12px;
}

.story-log-entry p {
  margin: 5px 0 0;
  color: #5f5558;
  font-size: 12px;
  line-height: 1.65;
}

@media (max-width: 1040px) {
  .story-chronicle-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .story-scene-visual {
    min-height: 380px;
  }

  .story-portrait {
    width: min(42%, 320px);
  }
}

@media (max-width: 820px) {
  .story-launch-card {
    grid-template-columns: 1fr;
  }

  .story-launch-visual {
    min-height: 190px;
  }

  .story-chronicle-header {
    grid-template-columns: 1fr auto;
  }

  .story-back-button {
    grid-column: 1 / -1;
    min-height: 42px;
  }

  .story-chronicle-layout {
    grid-template-columns: 1fr;
  }

  .story-chronicle-sidebar {
    display: grid;
    grid-template-columns: minmax(160px, .8fr) minmax(0, 1.2fr);
    gap: 12px;
  }

  .story-cover-frame {
    grid-row: 1 / span 3;
  }

  .story-sidebar-heading {
    margin-top: 0;
  }

  .story-choice-archive {
    grid-column: 1 / -1;
  }

  .story-episode-list {
    max-height: 360px;
    overflow: auto;
  }
}

@media (max-width: 600px) {
  .story-chronicle-header {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .story-chronicle-header-side {
    grid-template-columns: 1fr auto;
  }

  .story-release-badge {
    justify-self: start;
  }

  .story-chronicle-sidebar {
    display: block;
  }

  .story-cover-frame {
    margin-bottom: 15px;
  }

  .story-player-shell {
    padding: 12px;
  }

  .story-player-heading {
    display: grid;
  }

  .story-player-meta {
    grid-auto-flow: column;
    justify-content: space-between;
    justify-items: start;
  }

  .story-scene-visual {
    min-height: 330px;
  }

  .story-portrait {
    width: 52%;
    height: 84%;
  }

  .story-monster {
    width: 64%;
    height: 72%;
  }

  .story-battle-panel {
    grid-template-columns: 1fr;
  }

  .story-battle-vs {
    display: none;
  }

  .story-dialogue-head {
    align-items: flex-start;
  }

  .story-dialogue-tools {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .story-dialogue-text {
    min-height: 78px;
    font-size: 14px;
  }
}

/* ============================================================
   2.4 BUILD 240003 · CHAPTER 0 / RPG DIALOGUE LAYOUT
   Background, portraits and dialogue are intentionally separated.
   ============================================================ */

.story-chapter-tabs {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.story-chapter-tab {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid rgba(103, 73, 80, .14);
  border-radius: 12px;
  background: rgba(255, 255, 255, .5);
  color: #55474c;
  text-align: left;
  cursor: pointer;
}

.story-chapter-tab:hover {
  border-color: rgba(129, 45, 63, .3);
  background: rgba(132, 47, 66, .06);
}

.story-chapter-tab.active {
  border-color: rgba(136, 42, 62, .38);
  background: linear-gradient(135deg, rgba(151, 52, 72, .12), rgba(196, 162, 104, .1));
  box-shadow: inset 3px 0 #a23d54;
}

.story-chapter-tab.locked {
  opacity: .72;
}

.story-chapter-tab-number {
  min-width: 42px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(126, 48, 65, .1);
  color: #8b3348;
  font-size: 11px;
  font-weight: 950;
}

.story-chapter-tab-copy {
  min-width: 0;
}

.story-chapter-tab-copy strong,
.story-chapter-tab-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-chapter-tab-copy strong {
  color: #45363b;
  font-size: 12px;
}

.story-chapter-tab-copy small {
  margin-top: 2px;
  color: #8d8084;
  font-size: 9px;
}

.story-chapter-tab-state {
  color: #8c6770;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.story-scene-visual {
  min-height: 390px;
}

.story-scene-gradient {
  background:
    linear-gradient(180deg, rgba(11,7,9,.02), transparent 64%, rgba(11,7,9,.42)),
    linear-gradient(90deg, rgba(14,8,12,.12), transparent 28%, transparent 72%, rgba(14,8,12,.12));
}

.story-dialogue-panel {
  padding: 12px;
  background: rgba(255,255,255,.84);
}

.story-dialogue-layout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
}

.story-dialogue-portraits {
  display: flex;
  align-items: stretch;
  gap: 7px;
}

.story-dialogue-portraits:has(.story-portrait:not(.hidden)) {
  min-width: 108px;
}

.story-dialogue-panel .story-portrait {
  position: relative;
  inset: auto;
  bottom: auto;
  width: 100px;
  height: 100px;
  flex: 0 0 100px;
  z-index: auto;
  overflow: hidden;
  border: 2px solid rgba(103, 72, 79, .16);
  border-radius: 12px;
  background: #e9e3d3;
  opacity: .55;
  filter: saturate(.72) brightness(.92);
  transform: none;
  transition: opacity .2s ease, filter .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.story-dialogue-panel .story-portrait.focused,
.story-dialogue-panel .story-portrait:only-child {
  opacity: 1;
  filter: none;
  transform: none;
  border-color: rgba(143, 45, 65, .5);
  box-shadow: 0 8px 18px rgba(65, 39, 45, .13);
}

.story-dialogue-panel .story-portrait img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  border-radius: 9px;
  image-rendering: auto;
  -webkit-mask-image: none;
  mask-image: none;
}

.story-dialogue-panel .story-portrait span {
  font-size: 11px;
  color: #786b65;
}

.story-dialogue-copy {
  min-width: 0;
  padding: 4px 4px 0;
}

.story-dialogue-text {
  min-height: 58px;
  margin: 10px 0 4px;
}

.story-choice-buttons {
  margin-top: 12px;
}

@media (max-width: 820px) {
  .story-chapter-tabs {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .story-scene-visual {
    min-height: 340px;
  }
}

@media (max-width: 600px) {
  .story-chapter-tabs {
    grid-template-columns: 1fr;
  }

  .story-dialogue-layout {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .story-dialogue-portraits {
    min-width: 0 !important;
  }

  .story-dialogue-panel .story-portrait {
    width: 76px;
    height: 76px;
    flex-basis: 76px;
  }

  .story-dialogue-copy {
    padding: 0;
  }

  .story-dialogue-text {
    min-height: 64px;
  }
}

/* 3.0: entries stay hidden until the server approves the private owner. */
[data-bloodmoon-entry][hidden] { display: none !important; }

/* Visible dungeon tabs share one mobile row, including the private Blood Moon tab. */
.dungeon-mode-tabs{max-width:100%;min-width:0}

/* BUILD300016: keep all game buttons still under the pointer. */
button,button:hover,button:active,button:focus-visible{
 transition:none!important;animation:none!important;transform:none!important;
}
