* {
  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);
}

.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-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;
  }
}


/* Gold / selling */
.gold-hint {
  margin-top: 8px;
  color: #9aa7bd;
  font-size: 12px;
  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: wrap;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 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);
}


/* 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);
}

.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);
}

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

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

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

.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-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-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-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 {
  color: #c24e4e;
  text-decoration: underline;
}

.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;
}

@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(390px, 86%);
  min-height: 340px;
  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: .62; }
.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: 310px;
  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-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 { min-height: 260px; }
  .world-boss-target img { height: 235px; }
  .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;
    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;
  }
}
