/* =========================
   GENERIC PANEL WINDOW
========================= */

.game-window {

  background: var(--ui-bg-panel);

  border: 2px solid var(--ui-border-strong);

  border-radius: 16px;

  box-shadow: var(--ui-shadow);

  display: flex;

  flex-direction: column;

  width: 900px;

  max-height: 80vh;

}


/* =========================
   SECTION BLOCK
========================= */

.skill-section {

  background: var(--ui-bg-soft);

  border-radius: 10px;

  padding: 12px 16px;

}

.skill-section h3 {

  margin: 0 0 8px;

  font-size: 13px;

  opacity: 0.8;

  text-transform: uppercase;

  letter-spacing: 0.6px;

  color: var(--ui-text-muted);

}


/* =========================
   XP BAR
========================= */

.xp-bar {

  width: 100%;

  height: 8px;

  background: rgba(0,0,0,0.55);

  border-radius: 4px;

  margin-top: 6px;

  overflow: hidden;

}

.xp-fill {

  height: 100%;

  background: linear-gradient(
    90deg,
    var(--ui-accent),
    var(--ui-accent-soft)
  );

  transition: width 0.25s ease;

}

.xp-pulse {

  filter: brightness(1.35);

}


/* =========================
   BUTTONS
========================= */

button,
.login-box button,
.enter-world-btn,
.skill-switch-btn,
.smithing-tab,
.start-resource-btn,
.bank-close,
.skill-close,
.char-close,
.overlay-close {

  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 10px;
  border: 1px solid rgba(214, 184, 116, 0.18);
  color: var(--ui-text);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03)),
    rgba(28, 24, 18, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 8px 20px rgba(0,0,0,0.24);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease,
    filter 0.18s ease;

}

button {
  padding: 10px 14px;
}

button:hover,
.login-box button:hover,
.enter-world-btn:hover,
.skill-switch-btn:hover,
.smithing-tab:hover,
.start-resource-btn:hover,
.bank-close:hover,
.skill-close:hover,
.char-close:hover,
.overlay-close:hover {
  transform: translateY(-1px);
  border-color: rgba(214, 184, 116, 0.38);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04)),
    rgba(40, 33, 22, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.1),
    0 12px 24px rgba(0,0,0,0.3);
}

button:active,
.login-box button:active,
.enter-world-btn:active,
.skill-switch-btn:active,
.smithing-tab:active,
.start-resource-btn:active,
.bank-close:active,
.skill-close:active,
.char-close:active,
.overlay-close:active {
  transform: translateY(1px) scale(0.985);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 6px 14px rgba(0,0,0,0.2);
}

button:disabled,
.login-box button:disabled,
.enter-world-btn:disabled,
.skill-switch-btn:disabled,
.smithing-tab:disabled,
.start-resource-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(0.2);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    none;
}

button.primary,
.login-box button:first-of-type,
.start-resource-btn,
#startCraftBtn,
#loginBtn,
#registerBtn,
.enter-world-btn {
  color: #112015;
  border-color: rgba(173, 205, 151, 0.42);
  background:
    linear-gradient(180deg, #c7d4a4, #88a56f 54%, #5f7d4e);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.24),
    0 10px 24px rgba(52, 81, 42, 0.26);
}

button.primary:hover,
.login-box button:first-of-type:hover,
.start-resource-btn:hover,
#startCraftBtn:hover,
#loginBtn:hover,
#registerBtn:hover,
.enter-world-btn:hover {
  filter: saturate(1.05) brightness(1.04);
}

button.danger,
#stopBtn,
#cancelCraftBtn {
  color: #ffe7df;
  border-color: rgba(219, 110, 83, 0.36);
  background:
    linear-gradient(180deg, #a84f3f, #7c3128 60%, #56211d);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 10px 24px rgba(83, 25, 21, 0.24);
}

button.danger:hover,
#stopBtn:hover,
#cancelCraftBtn:hover {
  filter: brightness(1.06);
}

#backToList,
#backBtn,
#returnBtn,
.login-box button:nth-of-type(2) {
  color: #f3e6c5;
}

/* =========================
   RESOURCE LIST'@, 1)
$content = [regex]::Replace($content, '\.resource-item \.start-resource-btn \{[\s\S]*?\}', @'
.resource-item .start-resource-btn {

  padding: 8px 14px;
  font-size: 0.9rem;
  min-width: 104px;

}
========================= */

.resource-list-section {

  margin: 1.2rem 0;

}

.resource-items {

  display: flex;

  flex-direction: column;

  gap: 0.7rem;

}

.resource-item {

  display: flex;

  align-items: center;

  gap: 1rem;

  padding: 0.9rem 1.2rem;

  border-radius: 10px;

  background: rgba(40, 55, 40, 0.32);

  border: 1px solid rgba(120,160,120,0.25);

  transition: all 0.15s ease;

}

.resource-item:hover {

  background: rgba(60,80,60,0.5);

  transform: translateY(-1px);

}

.resource-item.locked {

  opacity: 0.55;

  background: rgba(70,70,70,0.25);

  border-color: rgba(140,140,140,0.2);

  pointer-events: none;

}

.resource-item .icon {

  font-size: 1.9rem;

  min-width: 40px;

}

.resource-item .info {

  flex: 1;

}

.resource-item .info strong {

  font-size: 1.05rem;

}

.resource-item .start-resource-btn {

  padding: 6px 12px;

  font-size: 0.9rem;

  background: var(--ui-accent);

  border: none;

  border-radius: 6px;

  color: white;

  cursor: pointer;

}

.resource-item .lock-icon {

  font-size: 1.6rem;

  color: #ff9800;

}


/* =========================
   FLOATING TEXT
========================= */

#floating-text-container {

  position: fixed;

  inset: 0;

  pointer-events: none;

  z-index: 9999;

}

.floating-text {

  position: fixed;

  left: 50%;

  bottom: 120px;

  min-width: 220px;

  max-width: min(460px, calc(100vw - 40px));

  padding: 16px 20px;

  border-radius: 18px;

  font-weight: 800;

  font-size: 18px;

  line-height: 1.35;

  text-align: center;

  opacity: 0;

  transform: translate3d(-50%, 0, 0);

  animation: dopamineFloat 1.6s cubic-bezier(.2,.9,.2,1) forwards;

  text-shadow: 0 1px 0 rgba(0,0,0,0.35);

  white-space: pre-line;

  border: 1px solid rgba(255,255,255,0.18);

  box-shadow: 0 24px 60px rgba(0,0,0,0.42);

  backdrop-filter: blur(10px);

  background:
    radial-gradient(circle at top, rgba(255,255,255,0.18), transparent 56%),
    linear-gradient(180deg, rgba(31,26,14,0.94), rgba(14,12,8,0.9));

}

.floating-text.reward-burst {

  animation: none;

  transform: translate3d(-50%, 14px, 0) scale(0.78);

  filter: blur(0);

}

.floating-text.reward-burst.is-visible {

  animation: rewardBurstIn 0.24s cubic-bezier(.2,.9,.24,1) forwards;

}

.floating-text.reward-burst.is-resolving {

  animation: rewardResolve 0.4s ease forwards;

}

.floating-resource {

  color: #ffe39b;

  border-color: rgba(255, 190, 84, 0.34);

  box-shadow: 0 26px 60px rgba(255, 170, 70, 0.2), 0 24px 60px rgba(0,0,0,0.42);

}

.floating-xp {

  color: #8fd0ff;

  border-color: rgba(115, 198, 255, 0.34);

  box-shadow: 0 26px 60px rgba(77, 163, 255, 0.2), 0 24px 60px rgba(0,0,0,0.42);

}

.floating-coins {

  color: #ffd571;

  border-color: rgba(255, 208, 102, 0.38);

  box-shadow: 0 26px 60px rgba(255, 200, 82, 0.22), 0 24px 60px rgba(0,0,0,0.42);

}

.floating-quest {

  color: #d7f0a4;

  animation: questFloatingText 4.2s cubic-bezier(.2,.9,.2,1) forwards;

  border-color: rgba(177, 218, 107, 0.42);

  box-shadow: 0 28px 70px rgba(147, 199, 73, 0.26), 0 24px 60px rgba(0,0,0,0.42);

  background:
    radial-gradient(circle at top, rgba(221, 255, 166, 0.22), transparent 56%),
    linear-gradient(180deg, rgba(28, 40, 17, 0.95), rgba(12, 18, 9, 0.92));

}

.reward-bubble {

  position: fixed;

  width: 14px;

  height: 14px;

  border-radius: 999px;

  opacity: 0;

  animation: xpBubbleFly 1.08s cubic-bezier(.2,.82,.22,1) forwards;

  box-shadow: 0 0 18px currentColor;

}

.reward-bubble-item {

  color: #ffd27a;

  background: radial-gradient(circle at 30% 30%, #fff4cf, #ffbf47 60%, rgba(255,191,71,0.2) 100%);

}

.reward-bubble-xp {

  color: #77c6ff;

  background: radial-gradient(circle at 30% 30%, #eef9ff, #74bfff 60%, rgba(116,191,255,0.2) 100%);

}

.reward-bubble-coin {

  color: #ffd16a;

  background: radial-gradient(circle at 30% 30%, #fff6d8, #ffca52 60%, rgba(255,202,82,0.2) 100%);

}

.coins-pulse {

  filter: brightness(1.16) saturate(1.08);

}

.skill-event-box {

  pointer-events: auto;

  background: rgba(20,18,10,0.95);

  border: 2px solid var(--ui-accent);

  border-radius: 10px;

  padding: 12px 16px;

  margin-top: 10px;

  text-align: center;

  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;

  animation: pop 0.2s ease-out;

}

.interaction-area {
  background: rgba(20,30,20,0.8);
  border: 1px solid rgba(120,160,120,0.4);
  border-radius: 8px;
  overflow: hidden;
}

.interaction-info {
  margin-top: 6px;
  font-size: 13px;
  opacity: 0.8;
}

/* =========================
   TOOLTIP
========================= */

.item-tooltip {

  position: fixed;

  z-index: 2000;

  background: rgba(10,20,15,0.96);

  border: 1px solid var(--ui-border);

  border-radius: 8px;

  padding: 8px 10px;

  max-width: 240px;

  pointer-events: none;

  box-shadow: 0 8px 24px rgba(0,0,0,0.45);

  opacity: 0;

  transform: translateY(4px);

  transition: opacity 0.12s ease, transform 0.12s ease;

  font-size: 13px;

}

.item-tooltip.visible {

  opacity: 1;

  transform: translateY(0);

}


/* =========================
   STACK COUNT
========================= */

.stack {

  position: absolute;

  bottom: 4px;

  right: 4px;

  background: rgba(0,0,0,0.85);

  color: #ffd700;

  padding: 2px 6px;

  font-size: 10px;

  border-radius: 6px;

  font-weight: 700;

  min-width: 16px;

  text-align: center;

}


/* =========================
   SIDEBAR BUTTON
========================= */

.bank-button {

  margin-top: auto;

  padding: 12px;

  border-radius: 8px;

  background: rgba(255,255,255,0.05);

  cursor: pointer;

  display: flex;

  justify-content: space-between;

  align-items: center;

  transition: background 0.15s ease, transform 0.1s ease;

}

.bank-button:hover {

  background: rgba(255,255,255,0.12);

}

.bank-button:active {

  transform: translateY(1px);

}


/* =========================
   GENERIC ITEM ICON
========================= */

.item-icon {

  position: relative;

  width: 34px;

  height: 34px;

  object-fit: contain;

  filter: var(--item-extra-filter, none);

  z-index: 2;

}

.city-hub-window {
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  overflow: hidden;
}

.city-hub-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.city-overview-card {
  flex-shrink: 0;
}

.city-locations-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.city-location-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
}






@media (max-width: 768px) {
  .game-window {
    width: 100%;
    max-width: 100%;
    max-height: none;
    min-height: calc(100dvh - 190px);
    border-radius: 20px;
    border-width: 1px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.3);
    overflow: hidden;
  }

  .skill-section {
    padding: 12px;
    border-radius: 14px;
  }

  button,
  .login-box button,
  .enter-world-btn,
  .skill-switch-btn,
  .smithing-tab,
  .start-resource-btn,
  .bank-close,
  .skill-close,
  .char-close,
  .overlay-close {
    min-height: 44px;
  }

  .resource-list-section {
    margin: 0.9rem 0;
  }

  .resource-item {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.9rem;
    border-radius: 14px;
  }

  .resource-item .icon {
    min-width: 32px;
    font-size: 1.5rem;
  }

  .resource-item .info {
    min-width: 0;
    flex: 1 1 140px;
  }

  .resource-item .start-resource-btn {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
  }

  .floating-text {
    bottom: calc(92px + env(safe-area-inset-bottom));
    min-width: 0;
    width: min(92vw, 420px);
    padding: 14px 16px;
    font-size: 16px;
    border-radius: 16px;
  }
}

.mobile-sidebar-toggle {
  display: none;
}

@media (max-width: 768px) {
  .mobile-sidebar-toggle {
    display: inline-flex;
    color: #112015;
    border-color: rgba(173, 205, 151, 0.42);
    background: linear-gradient(180deg, #c7d4a4, #88a56f 54%, #5f7d4e);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.24), 0 10px 24px rgba(52, 81, 42, 0.26);
  }

  #skillList {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    min-width: 0;
  }

  #skillList li {
    min-width: 0;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.06);
  }
}


.skill-nav-section-label {
  padding: 8px 2px 2px;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(233, 229, 205, 0.58);
  cursor: default;
  pointer-events: none;
}

.skill-nav-section-label:first-child {
  margin-top: 0;
}

.skill-nav-item.is-disabled {
  cursor: default;
  opacity: 0.5;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.03);
}

.skill-nav-item.is-disabled:hover {
  background: rgba(255,255,255,0.04);
}

.skill-nav-item.has-unread {
  border: 1px solid rgba(177, 216, 107, 0.38);
  color: #e4f3bd;
  box-shadow: 0 0 0 1px rgba(177, 216, 107, 0.1), 0 0 16px rgba(177, 216, 107, 0.16);
  animation: chatUnreadGlow 1.9s ease-in-out infinite;
}

.skill-nav-icon.is-disabled {
  filter: grayscale(1) opacity(0.8) drop-shadow(0 2px 6px rgba(0,0,0,0.2));
}

.skill-nav-level.soon {
  color: rgba(233, 229, 205, 0.5);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.skill-nav-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.skill-nav-name {
  min-width: 0;
}

.skill-nav-level {
  flex-shrink: 0;
}

.skill-nav-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.32));
}

@media (max-width: 768px) {
  .skill-nav-icon {
    width: 24px;
    height: 24px;
  }
}


.npc-list {
  display: grid;
  gap: 8px;
}

.npc-entry {
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
}

.npc-entry:hover {
  background: rgba(255, 255, 255, 0.08);
}

.npc-entry-name {
  font-weight: 700;
}

.npc-entry-subtitle {
  font-size: 12px;
  opacity: 0.75;
  margin-top: 2px;
}

.npc-list-empty {
  font-size: 13px;
  opacity: 0.75;
}

.npc-conversation-open .game-window,
.npc-conversation-open .city-hub-window,
.npc-conversation-open .location-view-window {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(18px) scale(0.985);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.npc-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background:
    radial-gradient(circle at 18% 32%, rgba(227, 190, 119, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(7, 6, 4, 0.18), rgba(7, 6, 4, 0.56));
}

.npc-dialog-shell {
  width: 100%;
  min-height: 100dvh;
  padding: 28px;
  box-sizing: border-box;
  overflow-y: auto;
}

.npc-dialog-shell-loading {
  display: flex;
  align-items: flex-end;
}

.npc-dialog-stage {
  position: relative;
  min-height: calc(100dvh - 56px);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.npc-dialog-portrait-panel {
  position: absolute;
  right: max(20px, calc(50% - 620px));
  bottom: 360px;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: flex-end;
  pointer-events: none;
  animation: npcPortraitEnter 280ms ease-out;
}

.npc-dialog-portrait-frame {
  width: min(380px, 32vw);
  aspect-ratio: 3 / 4;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(227, 196, 138, 0.28);
  background: linear-gradient(180deg, rgba(36, 30, 20, 0.9), rgba(16, 13, 9, 0.96));
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.42);
}

.npc-dialog-portrait,
.npc-dialog-portrait-placeholder {
  width: 100%;
  height: 100%;
  display: block;
}

.npc-dialog-portrait {
  object-fit: contain;
  object-position: center bottom;
}

.npc-dialog-portrait-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 108px;
  color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.05);
}



.npc-dialog-speaker-kicker {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(233, 222, 199, 0.62);
}

.npc-dialog-name {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.05;
  color: #f7f1e4;
}

.npc-dialog-lowerbar {
  position: relative;
  width: min(1120px, calc(100% - 36px));
  margin-left: auto;
  margin-right: auto;

  border-radius: 28px;
  padding: 24px 28px 22px;
  background: linear-gradient(180deg, rgba(24, 20, 15, 0.96), rgba(10, 8, 6, 0.98));
  border: 1px solid rgba(227, 196, 138, 0.14);
  box-shadow: 0 28px 60px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.04);
  animation: npcLowerBarEnter 260ms ease-out;

  min-height: 350px;
  max-height: 1150px;

  display: flex;
  flex-direction: column;

  overflow: hidden;
}


/* leichter overlay-gloss */
.npc-dialog-lowerbar::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), transparent 36%);
  pointer-events: none;
}


.npc-dialog-lowerbar-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.npc-dialog-speaker-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.npc-dialog-body {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  color: #f3ecde;
}


.npc-dialog-copy-block,
.npc-dialog-module-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.npc-dialog-greeting,
.npc-talk-prompt-text,
.quest-row-description {
  margin: 0;
  font-size: 18px;
  line-height: 1.7;
  color: rgba(246, 239, 226, 0.95);
}

.npc-dialog-actions {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  margin-top: 18px;
}

.npc-dialog-actions-row,
.npc-talk-topic-list,
.npc-talk-prompt-choices,
.npc-talk-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.npc-dialog-btn {
  border: 1px solid rgba(227, 196, 138, 0.12);
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: #f8f1e1;
  background: linear-gradient(180deg, rgba(64, 51, 35, 0.84), rgba(35, 27, 18, 0.9));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.npc-dialog-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(227, 196, 138, 0.28);
  background: linear-gradient(180deg, rgba(86, 68, 47, 0.9), rgba(44, 33, 22, 0.94));
}

.npc-dialog-btn.secondary {
  color: rgba(248, 241, 225, 0.9);
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.08);
}

.npc-dialog-btn.secondary:hover {
  background: rgba(255,255,255,0.09);
}

.npc-dialog-body h3,
.shop-header h3,
.quest-header h3 {
  margin: 0 0 6px;
  font-size: 20px;
  color: #f7f1e4;
}

.shop-item-list,
.quest-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@keyframes npcPortraitEnter {
  from {
    opacity: 0;
    transform: translate3d(-24px, 10px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes npcLowerBarEnter {
  from {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (max-width: 900px) {
  .npc-dialog-shell {
    padding: 16px;
  }

  .npc-dialog-stage {
    min-height: calc(100dvh - 32px);
    align-items: stretch;
    justify-content: flex-end;
  }

  .npc-dialog-portrait-panel {
    position: relative;
    left: auto;
    bottom: auto;
    width: 100%;
    margin-bottom: 14px;
    align-items: center;
  }

  .npc-dialog-portrait-frame {
    width: min(300px, 74vw);
  }

  .npc-dialog-lowerbar {
    width: 100%;
    border-radius: 22px;
    padding: 18px;
  }

  .npc-dialog-name {
    font-size: 24px;
  }

  .npc-dialog-greeting,
  .npc-talk-prompt-text,
  .quest-row-description {
    font-size: 16px;
  }

  .npc-dialog-actions-row,
  .npc-talk-topic-list,
  .npc-talk-prompt-choices,
  .npc-talk-inline-actions {
    gap: 10px;
  }

  .npc-dialog-btn {
    width: 100%;
  }
}
.shop-item-row {
  display: grid;
  grid-template-columns: 1fr 80px 100px;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
}

.shop-item-name {
  font-weight: 500;
}

.shop-item-price {
  text-align: right;
  opacity: 0.8;
}

.shop-item-action {
  text-align: right;
}

.quest-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
}

.quest-row-title {
  font-weight: 600;
}

.quest-row-description {
  opacity: 0.85;
  font-size: 0.95rem;
  margin-top: 4px;
}

.quest-row-status {
  margin-top: 6px;
  font-size: 0.85rem;
  opacity: 0.75;
}

.quest-row-action {
  text-align: right;
}

.service-row {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
}

.service-row-title {
  font-weight: 600;
}

.service-row-description {
  opacity: 0.85;
  font-size: 0.95rem;
  margin-top: 4px;
}

.service-row-action {
  text-align: right;
}

.npc-talk-topic-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.npc-talk-topic-response {
  margin-top: 12px;
}

.npc-talk-inline-actions {
  margin-top: 14px;
}

.quest-complete-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 20px;
  background: rgba(8, 10, 14, 0.72);
  z-index: 1300;
}

.quest-complete-card {
  width: min(620px, calc(100% - 20px));
  border-radius: 20px;
  padding: 26px;
  border: 1px solid rgba(246, 231, 176, 0.24);
  background:
    radial-gradient(circle at top, rgba(246, 231, 176, 0.14), transparent 58%),
    linear-gradient(180deg, rgba(30, 24, 14, 0.98), rgba(13, 12, 10, 0.96));
  box-shadow: 0 28px 80px rgba(0,0,0,0.5);
}

.quest-complete-kicker {
  display: inline-flex;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(246, 231, 176, 0.12);
  border: 1px solid rgba(246, 231, 176, 0.18);
  color: #f6e7b0;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.quest-complete-title {
  margin: 14px 0 0;
  font-size: 28px;
  line-height: 1.1;
  color: #fff4cf;
}

.quest-complete-copy {
  margin: 12px 0 0;
  color: rgba(244, 240, 220, 0.84);
  line-height: 1.55;
}

.quest-complete-section-title {
  margin-top: 22px;
  margin-bottom: 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(244, 240, 220, 0.64);
}

.quest-complete-rewards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quest-complete-reward-block {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.quest-complete-reward-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(244, 240, 220, 0.64);
}

.quest-complete-reward-coins {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quest-complete-reward-coin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #f6e7b0;
}

.quest-complete-reward-coin img {
  width: 16px;
  height: 16px;
}

.quest-complete-reward-xp {
  color: #8fd0ff;
}

.quest-complete-item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quest-complete-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
}

.quest-complete-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

@media (max-width: 768px) {
  .quest-complete-card {
    width: 100%;
    padding: 20px;
  }

  .quest-complete-title {
    font-size: 24px;
  }

  .quest-complete-actions .npc-dialog-btn {
    width: 100%;
  }
}
.away-summary-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 20px;
  background: rgba(5, 8, 10, 0.64);
  z-index: 1200;
}

.away-summary-card {
  width: min(560px, calc(100% - 20px));
  max-height: min(72vh, 720px);
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.12), transparent 58%),
    linear-gradient(180deg, rgba(25, 24, 18, 0.98), rgba(13, 12, 10, 0.96));
  box-shadow: 0 26px 70px rgba(0,0,0,0.46);
  padding: 22px;
}

.away-summary-header {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
}

.away-summary-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(246, 231, 176, 0.12);
  border: 1px solid rgba(246, 231, 176, 0.18);
  color: #f6e7b0;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.away-summary-loading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(143, 208, 255, 0.1);
  border: 1px solid rgba(143, 208, 255, 0.18);
  color: #dbeeff;
  font-size: 13px;
  font-weight: 700;
}

.away-summary-loading-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #8fd0ff;
  box-shadow: 0 0 0 0 rgba(143, 208, 255, 0.6);
  animation: away-summary-pulse 1.1s ease-in-out infinite;
}

.away-summary-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 18px;
}

.away-summary-columns.has-levelups {
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.95fr);
}

.away-summary-panel {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.away-summary-levelup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.away-summary-levelup-row {
  display: block;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(143, 208, 255, 0.08);
  border: 1px solid rgba(143, 208, 255, 0.14);
}

.away-summary-levelup-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.away-summary-levelup-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.away-summary-levelup-skill {
  color: #dbeeff;
}

.away-summary-levelup-range {
  color: #8fd0ff;
}

.away-summary-unlock-groups {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.away-summary-unlock-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.away-summary-unlock-level {
  font-size: 12px;
  font-weight: 700;
  color: rgba(246, 231, 176, 0.88);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.away-summary-unlock-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.away-summary-unlock-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  color: #f4f8ff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.away-summary-unlock-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex: 0 0 auto;
}

.away-summary-stat-xp strong {
  color: #8fd0ff;
}

.away-summary-stat-coins strong {
  color: #f6e7b0;
}

@keyframes away-summary-pulse {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(143, 208, 255, 0.5);
  }

  70% {
    transform: scale(1.08);
    box-shadow: 0 0 0 10px rgba(143, 208, 255, 0);
  }

  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(143, 208, 255, 0);
  }
}

@media (max-width: 640px) {
  .away-summary-levelup-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .away-summary-unlock-item {
    width: 100%;
  }
}
.reward-popup {
  position: fixed;
  top: 80px;
  right: 20px;
  background: rgba(0,0,0,0.85);
  padding: 10px 14px;
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
  z-index: 9999;
  animation: fadeInOut 2.5s ease forwards;
}

.reward-popup img {
  width: 14px;
  height: 14px;
  vertical-align: middle;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(-10px); }
  10% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-10px); }
}









.shop-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.shop-role-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.shop-role-badge,
.shop-role-mode,
.shop-item-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}

.shop-role-badge {
  color: #f4dfad;
}

.shop-copy,
.shop-item-meta {
  color: rgba(255,255,255,0.72);
}

.shop-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  margin-top: 4px;
}

.shop-item-tag.muted {
  opacity: 0.72;
}

.shop-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shop-section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.78);
}

.shop-item-row {
  grid-template-columns: minmax(0, 1fr) 90px 110px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.04);
}

.shop-item-row.is-disabled {
  opacity: 0.6;
}

.shop-item-main {
  min-width: 0;
}

.shop-item-price.positive {
  color: #8fd69f;
}
.npc-dialog-lowerbar {
  display: flex;
  flex-direction: column;
  max-height: min(46vh, 420px);
}

.npc-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(30vh, 270px);
  overflow-y: auto;
  padding-right: 6px;
}

.npc-dialog-actions {
  flex: 0 0 auto;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(180deg, rgba(16, 13, 10, 0), rgba(16, 13, 10, 0.88) 36%);
}

.shop-view {
  gap: 12px;
}

.shop-copy {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

.shop-section {
  gap: 8px;
}

.shop-item-list {
  gap: 8px;
}

.shop-item-row {
  padding: 8px 10px;
}

.shop-item-price,
.shop-item-action {
  align-self: center;
}

@media (max-width: 768px) {
  .npc-dialog-lowerbar {
    max-height: min(52vh, 440px);
  }

  .npc-dialog-body {
    max-height: min(34vh, 300px);
  }
}
.npc-dialog-lowerbar {
  display: flex;
  flex-direction: column;
  max-height: min(68vh, 760px);
}

.npc-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(52vh, 620px);
  overflow-y: auto;
  padding-right: 6px;
}

.trade-window {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.trade-window-header h3 {
  margin: 0;
}

.trade-role-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.trade-role-badge,
.trade-role-mode {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}

.trade-role-badge {
  color: #f4dfad;
}

.trade-window-copy {
  margin: 0;
  color: rgba(255,255,255,0.74);
  font-size: 13px;
  line-height: 1.35;
}

.trade-window-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.trade-pane {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.05);
}

.trade-pane.is-active {
  border-color: rgba(227, 196, 138, 0.18);
  box-shadow: inset 0 0 0 1px rgba(227, 196, 138, 0.06);
}

.trade-pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.trade-pane-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.78);
}

.trade-pane-meta {
  font-size: 12px;
  color: rgba(255,255,255,0.62);
}

.trade-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 10px;
}

.trade-slot {
  position: relative;
  min-height: 102px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 16px;
  background: rgba(19, 17, 13, 0.92);
  color: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.trade-slot:hover {
  transform: translateY(-2px);
  border-color: rgba(227, 196, 138, 0.14);
}

.trade-slot.is-selected {
  border-color: rgba(227, 196, 138, 0.26);
  background: rgba(34, 28, 20, 0.98);
}

.trade-slot.is-disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.trade-slot-art {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background-image: url('/assets/ui/slots/bankslot.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.trade-slot-art img {
  width: 64%;
  height: 64%;
  object-fit: contain;
  filter: var(--item-extra-filter, none);
}

.trade-slot-footer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.trade-slot-price {
  font-size: 12px;
  font-weight: 700;
}

.trade-slot-stack {
  font-size: 11px;
  color: rgba(255,255,255,0.62);
}

.trade-grid-empty,
.trade-detail-empty {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.025);
  color: rgba(255,255,255,0.68);
}

.trade-detail-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
}

.trade-detail-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.trade-detail-art {
  width: 84px;
  height: 84px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 11, 8, 0.84);
  border: 1px solid rgba(255,255,255,0.06);
  flex: 0 0 auto;
}

.trade-detail-art img {
  width: 66%;
  height: 66%;
  object-fit: contain;
}

.trade-detail-copy {
  min-width: 0;
}

.trade-detail-copy h4 {
  margin: 0 0 6px;
  font-size: 20px;
  color: #f7f1e4;
}

.trade-detail-copy p {
  margin: 0;
  color: rgba(255,255,255,0.72);
  line-height: 1.4;
}

.trade-detail-kicker {
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ui-text-muted);
}

.trade-detail-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.trade-detail-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
}

.trade-detail-stat span {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.62);
}

.trade-detail-stat strong {
  font-size: 18px;
}

.trade-quantity-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trade-quantity-label {
  font-size: 12px;
  color: rgba(255,255,255,0.72);
}

.trade-quantity-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.trade-quantity-input {
  width: 88px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.22);
  color: #fff;
  font: inherit;
}

.trade-qty-btn {
  min-width: 46px;
}

.trade-detail-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 980px) {
  .trade-window-layout {
    grid-template-columns: 1fr;
  }

  .trade-detail-stats {
    grid-template-columns: 1fr;
  }
}
.npc-dialog-lowerbar {
  min-height: 350px;
  max-height: calc(100dvh - 96px);
}

.npc-dialog-body {
  max-height: calc(100dvh - 260px);
}

.npc-dialog-lowerbar:has(.trade-window) {
  min-height: max(350px, calc(100dvh - 132px));
  max-height: calc(100dvh - 88px);
}

.npc-dialog-lowerbar:has(.trade-window) .npc-dialog-body {
  max-height: calc(100dvh - 250px);
}

.npc-dialog-stage {
  min-height: calc(100dvh - 32px);
}

@media (max-width: 900px) {
  .npc-dialog-lowerbar {
    min-height: 350px;
    max-height: calc(100dvh - 72px);
  }

  .npc-dialog-body {
    max-height: calc(100dvh - 230px);
  }

  .npc-dialog-lowerbar:has(.trade-window) {
    min-height: max(350px, calc(100dvh - 104px));
    max-height: calc(100dvh - 64px);
  }

  .npc-dialog-lowerbar:has(.trade-window) .npc-dialog-body {
    max-height: calc(100dvh - 214px);
  }
}


.npc-dialog-lowerbar:not(:has(.trade-window)) {
  box-sizing: border-box !important;
  min-height: 350px !important;
  height: 350px !important;
  max-height: 350px !important;
  overflow: hidden;
}

.npc-dialog-lowerbar:not(:has(.trade-window)) .npc-dialog-body {
  max-height: none !important;
}

#npcDialogOverlay .npc-dialog-lowerbar {
  box-sizing: border-box;
  height: 350px;
  min-height: 350px;
  max-height: 350px;
}

#npcDialogOverlay .npc-dialog-lowerbar .npc-dialog-body {
  max-height: none;
}

#npcDialogOverlay .npc-dialog-lowerbar.is-trade-view {
  height: auto;
  min-height: max(350px, calc(100dvh - 132px));
  max-height: calc(100dvh - 88px);
}

#npcDialogOverlay .npc-dialog-lowerbar.is-trade-view .npc-dialog-body {
  max-height: calc(100dvh - 250px);
}

#npcDialogOverlay .trade-window,
#npcDialogOverlay .trade-window-layout,
#npcDialogOverlay .trade-pane {
  min-width: 0;
}

.trade-slot-price,
.trade-detail-stat strong {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.trade-coins {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.trade-coin-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.trade-coin-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.trade-coin-value {
  line-height: 1;
}

@media (max-width: 900px) {
  #npcDialogOverlay .npc-dialog-lowerbar.is-trade-view {
    min-height: max(350px, calc(100dvh - 104px));
    max-height: calc(100dvh - 64px);
  }

  #npcDialogOverlay .npc-dialog-lowerbar.is-trade-view .npc-dialog-body {
    max-height: calc(100dvh - 214px);
  }
}

.service-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.service-row-meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  opacity: 0.9;
}

.activity-session-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 14px;
}

.activity-session-label,
.location-activity-session-note {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.78;
}

.activity-session-timer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(225, 207, 160, 0.22);
  border-radius: 6px;
  background: rgba(10, 9, 7, 0.28);
  color: var(--text);
}

.activity-session-timer span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.78;
}

.activity-session-timer strong {
  font-size: 14px;
}

.activity-session-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.activity-session-btn {
  min-width: 120px;
}

.activity-session-btn.active {
  box-shadow: inset 0 0 0 1px rgba(255, 224, 170, 0.45);
  background: linear-gradient(180deg, rgba(109, 79, 42, 0.9), rgba(74, 52, 26, 0.92));
}


