/* ===================================================================== */
/* NPC dialog (#npc-interact-overlay .npc-interact-card): the CoreCraftia  */
/* fantasy frame - bright blue border, wooden name plank, 3D action        */
/* buttons, framed chat lines and leaf corners. Presentation only: the     */
/* markup (built in items.js), ids and behaviour are untouched.            */
/* ===================================================================== */

body #npc-interact-overlay{
  --np-frame: #2f93ff;
  --np-wood: linear-gradient(180deg, #d79a58 0%, #b87438 52%, #8d5226 100%);
  --np-grain: repeating-linear-gradient(92deg, rgba(60, 28, 6, 0) 0 22px, rgba(60, 28, 6, 0.16) 22px 24px);
  --np-card: linear-gradient(180deg, #0c2144, #081a38);
  --np-card-on: linear-gradient(180deg, #4aa6ff 0%, #2677e6 52%, #1757bd 100%);
  --np-leaf-tl: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2090%2070%27%3E%3Cg%20transform=%27translate%280%200%29%20scale%281%201%29%27%3E%3Cdefs%3E%3ClinearGradient%20id=%27g%27%20x1=%270%27%20y1=%270%27%20x2=%271%27%20y2=%271%27%3E%3Cstop%20offset=%270%27%20stop-color=%27%23a6e864%27/%3E%3Cstop%20offset=%271%27%20stop-color=%27%232f8a3a%27/%3E%3C/linearGradient%3E%3Cg%20id=%27l%27%3E%3Cpath%20d=%27M2%2012C10%200%2028%200%2038%2012%2028%2024%2010%2024%202%2012Z%27%20fill=%27url%28%23g%29%27%20stroke=%27%2316501f%27%20stroke-width=%272%27%20stroke-linejoin=%27round%27/%3E%3Cpath%20d=%27M6%2012H34%27%20stroke=%27%23d8f8ad%27%20stroke-opacity=%27.75%27%20stroke-width=%271.6%27%20stroke-linecap=%27round%27/%3E%3C/g%3E%3C/defs%3E%3Cuse%20href=%27%23l%27%20x=%272%27%20y=%2726%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-38%2019%2036%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2722%27%20y=%278%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-8%2039%2018%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2740%27%20y=%2734%27%20width=%2730%27%20height=%2718%27%20transform=%27rotate%2834%2055%2043%29%27/%3E%3C/g%3E%3C/svg%3E");
  --np-leaf-tr: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2090%2070%27%3E%3Cg%20transform=%27translate%2890%200%29%20scale%28-1%201%29%27%3E%3Cdefs%3E%3ClinearGradient%20id=%27g%27%20x1=%270%27%20y1=%270%27%20x2=%271%27%20y2=%271%27%3E%3Cstop%20offset=%270%27%20stop-color=%27%23a6e864%27/%3E%3Cstop%20offset=%271%27%20stop-color=%27%232f8a3a%27/%3E%3C/linearGradient%3E%3Cg%20id=%27l%27%3E%3Cpath%20d=%27M2%2012C10%200%2028%200%2038%2012%2028%2024%2010%2024%202%2012Z%27%20fill=%27url%28%23g%29%27%20stroke=%27%2316501f%27%20stroke-width=%272%27%20stroke-linejoin=%27round%27/%3E%3Cpath%20d=%27M6%2012H34%27%20stroke=%27%23d8f8ad%27%20stroke-opacity=%27.75%27%20stroke-width=%271.6%27%20stroke-linecap=%27round%27/%3E%3C/g%3E%3C/defs%3E%3Cuse%20href=%27%23l%27%20x=%272%27%20y=%2726%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-38%2019%2036%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2722%27%20y=%278%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-8%2039%2018%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2740%27%20y=%2734%27%20width=%2730%27%20height=%2718%27%20transform=%27rotate%2834%2055%2043%29%27/%3E%3C/g%3E%3C/svg%3E");
  --np-leaf-bl: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2090%2070%27%3E%3Cg%20transform=%27translate%280%2070%29%20scale%281%20-1%29%27%3E%3Cdefs%3E%3ClinearGradient%20id=%27g%27%20x1=%270%27%20y1=%270%27%20x2=%271%27%20y2=%271%27%3E%3Cstop%20offset=%270%27%20stop-color=%27%23a6e864%27/%3E%3Cstop%20offset=%271%27%20stop-color=%27%232f8a3a%27/%3E%3C/linearGradient%3E%3Cg%20id=%27l%27%3E%3Cpath%20d=%27M2%2012C10%200%2028%200%2038%2012%2028%2024%2010%2024%202%2012Z%27%20fill=%27url%28%23g%29%27%20stroke=%27%2316501f%27%20stroke-width=%272%27%20stroke-linejoin=%27round%27/%3E%3Cpath%20d=%27M6%2012H34%27%20stroke=%27%23d8f8ad%27%20stroke-opacity=%27.75%27%20stroke-width=%271.6%27%20stroke-linecap=%27round%27/%3E%3C/g%3E%3C/defs%3E%3Cuse%20href=%27%23l%27%20x=%272%27%20y=%2726%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-38%2019%2036%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2722%27%20y=%278%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-8%2039%2018%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2740%27%20y=%2734%27%20width=%2730%27%20height=%2718%27%20transform=%27rotate%2834%2055%2043%29%27/%3E%3C/g%3E%3C/svg%3E");
  --np-leaf-br: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2090%2070%27%3E%3Cg%20transform=%27translate%2890%2070%29%20scale%28-1%20-1%29%27%3E%3Cdefs%3E%3ClinearGradient%20id=%27g%27%20x1=%270%27%20y1=%270%27%20x2=%271%27%20y2=%271%27%3E%3Cstop%20offset=%270%27%20stop-color=%27%23a6e864%27/%3E%3Cstop%20offset=%271%27%20stop-color=%27%232f8a3a%27/%3E%3C/linearGradient%3E%3Cg%20id=%27l%27%3E%3Cpath%20d=%27M2%2012C10%200%2028%200%2038%2012%2028%2024%2010%2024%202%2012Z%27%20fill=%27url%28%23g%29%27%20stroke=%27%2316501f%27%20stroke-width=%272%27%20stroke-linejoin=%27round%27/%3E%3Cpath%20d=%27M6%2012H34%27%20stroke=%27%23d8f8ad%27%20stroke-opacity=%27.75%27%20stroke-width=%271.6%27%20stroke-linecap=%27round%27/%3E%3C/g%3E%3C/defs%3E%3Cuse%20href=%27%23l%27%20x=%272%27%20y=%2726%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-38%2019%2036%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2722%27%20y=%278%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-8%2039%2018%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2740%27%20y=%2734%27%20width=%2730%27%20height=%2718%27%20transform=%27rotate%2834%2055%2043%29%27/%3E%3C/g%3E%3C/svg%3E");
  background:
    radial-gradient(circle at 20% 0%, rgba(73, 168, 255, 0.18), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(34, 199, 255, 0.12), transparent 24%),
    rgba(2, 10, 18, 0.74) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  font-family: Georgia, "Times New Roman", serif !important;
}

/* ---- frame ---- */
body #npc-interact-overlay .npc-interact-card{
  position: relative;
  margin-top: 34px;
  overflow: visible !important;
  border: 4px solid var(--np-frame) !important;
  border-radius: 22px !important;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(90, 170, 255, 0.22), transparent 60%),
    linear-gradient(180deg, #123c72 0%, #0b2750 52%, #081b38 100%) !important;
  box-shadow:
    0 0 0 2px #082f66,
    0 18px 44px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(150, 210, 255, 0.35),
    inset 0 3px 0 rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body #npc-interact-overlay .npc-interact-card::before{ display: none !important; }
body #npc-interact-overlay .npc-interact-card::after{
  content: "";
  position: absolute;
  left: -12px;
  top: -12px;
  width: calc(100% + 24px) !important;
  height: calc(100% + 24px) !important;
  max-width: none !important;
  max-height: none !important;
  z-index: 6;
  display: block !important;
  pointer-events: none;
  border: 0 !important;
  background:
    var(--np-leaf-tl) left top / 54px 42px no-repeat,
    var(--np-leaf-tr) right top / 54px 42px no-repeat,
    var(--np-leaf-bl) left bottom / 54px 42px no-repeat,
    var(--np-leaf-br) right bottom / 54px 42px no-repeat !important;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35));
}

/* ---- name plank + red X ---- */
body #npc-interact-overlay .npc-interact-head{
  position: relative;
  z-index: 5;
  display: flex !important;
  justify-content: center !important;
  margin: -38px auto 12px !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
}
body #npc-interact-overlay .npc-interact-head::before,
body #npc-interact-overlay .npc-interact-head::after,
body #npc-interact-overlay .npc-interact-head-copy::before,
body #npc-interact-overlay .npc-interact-head-copy::after{ display: none !important; }
body #npc-interact-overlay .npc-interact-head-copy{
  min-width: min(300px, 70%);
  padding: 7px 34px 9px;
  border: 3px solid #4a2a10;
  border-radius: 12px;
  background: var(--np-grain), var(--np-wood);
  box-shadow: 0 4px 0 #2a1507, inset 0 3px 0 rgba(255, 233, 190, 0.45), inset 0 -4px 0 rgba(60, 28, 6, 0.35);
  text-align: center;
}
body #npc-interact-overlay .npc-interact-title{
  margin: 0 !important;
  color: #fff !important;
  font: 900 clamp(22px, 2.6vw, 34px)/1.05 Georgia, "Times New Roman", serif !important;
  letter-spacing: 0.02em !important;
  -webkit-text-stroke: 5px #0a1c3c;
  paint-order: stroke fill;
  text-shadow: 0 4px 0 rgba(6, 14, 34, 0.85) !important;
}
body #npc-interact-overlay .npc-interact-close{
  position: absolute !important;
  top: -6px;
  right: -22px;
  width: 40px !important;
  height: 40px !important;
  min-height: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border: 3px solid #fff !important;
  border-radius: 10px !important;
  background: linear-gradient(180deg, #ff6a5c 0%, #d3201a 52%, #a31410 100%) !important;
  box-shadow: 0 0 0 2px #4a1210, 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 3px 0 rgba(255, 255, 255, 0.4) !important;
  color: #fff !important;
  font: 900 20px/1 Georgia, serif !important;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6) !important;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}
body #npc-interact-overlay .npc-interact-close:hover{ transform: scale(1.08); filter: brightness(1.12); }
body #npc-interact-overlay .npc-interact-close:active{ transform: scale(0.94); }

/* ---- left column: portrait + actions ---- */
body #npc-interact-overlay .npc-interact-portrait-frame{
  border: 3px solid #4aa8ff !important;
  border-radius: 16px !important;
  background:
    radial-gradient(circle at 50% 40%, rgba(58, 160, 255, 0.28), transparent 72%),
    linear-gradient(180deg, #15264e, #0a1431) !important;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.45), 0 0 12px rgba(58, 160, 255, 0.25) !important;
}
body #npc-interact-overlay .npc-interact-action{
  border: 3px solid #0b2c5e !important;
  border-radius: 14px !important;
  background: var(--np-card) !important;
  box-shadow: 0 3px 0 #061a38, inset 0 2px 0 rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  font: 900 clamp(13px, 1.2vw, 16px)/1.1 Georgia, serif !important;
  text-shadow: 0 2px 0 rgba(0, 20, 60, 0.85);
  transition: filter 120ms ease, transform 120ms ease;
}
body #npc-interact-overlay .npc-interact-action:hover{ filter: brightness(1.12); transform: translateY(-1px); }
body #npc-interact-overlay .npc-interact-action:active{ filter: brightness(0.94); transform: translateY(2px); }
body #npc-interact-overlay .npc-interact-action.is-active{
  background: var(--np-card-on) !important;
  box-shadow: 0 3px 0 #061a38, 0 0 0 2px #8fd2ff, inset 0 3px 0 rgba(255, 255, 255, 0.45) !important;
}
body #npc-interact-overlay .npc-interact-goodbye,
body #npc-interact-overlay .npc-interact-goodbye.is-active{
  border-color: #5a0f0c !important;
  background: linear-gradient(180deg, #ff6a5c 0%, #d3201a 52%, #a31410 100%) !important;
  box-shadow: 0 3px 0 #2f0907, inset 0 3px 0 rgba(255, 255, 255, 0.4) !important;
}
body #npc-interact-overlay .npc-interact-quest-attention{
  border: 2px solid #5a3a02 !important;
  background: linear-gradient(180deg, #ffe27a, #f5a623) !important;
  color: #3b2300 !important;
  font-weight: 900 !important;
  text-shadow: none !important;
}

/* ---- right column: chat, quests, inventory ---- */
body #npc-interact-overlay .npc-interact-main{
  border: 3px solid rgba(120, 190, 255, 0.5) !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, rgba(4, 14, 32, 0.78), rgba(6, 20, 42, 0.62)) !important;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.4) !important;
}
body #npc-interact-overlay .npc-interact-dialog p{
  border: 2px solid rgba(120, 190, 255, 0.4) !important;
  border-radius: 12px !important;
  background: var(--np-card) !important;
  box-shadow: 0 3px 0 #061a38, inset 0 2px 0 rgba(255, 255, 255, 0.07) !important;
  color: #fff !important;
  font: 700 clamp(13px, 1.2vw, 16px)/1.35 Georgia, serif !important;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}
body #npc-interact-overlay .npc-interact-quest-card{
  border: 3px solid rgba(120, 190, 255, 0.4) !important;
  border-radius: 14px !important;
  background: var(--np-card) !important;
  box-shadow: 0 3px 0 #061a38, inset 0 2px 0 rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}
body #npc-interact-overlay .npc-interact-quest-title{ color: #fff !important; font: 900 clamp(14px, 1.3vw, 17px)/1.15 Georgia, serif !important; text-shadow: 0 2px 0 rgba(0, 20, 60, 0.75); }
body #npc-interact-overlay .npc-interact-quest-objective{ color: #d4e8ff !important; font-weight: 700 !important; }
body #npc-interact-overlay .npc-interact-quest-progress{ color: #ffe9a0 !important; font-weight: 900 !important; }
body #npc-interact-overlay .npc-interact-quest-action{
  min-height: 38px;
  padding: 0 18px 2px;
  border: 3px solid #0b4a1a !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, #7dff6a 0%, #2fd13f 48%, #139a28 100%) !important;
  box-shadow: 0 0 0 2px #062a10, 0 4px 0 2px #062a10, inset 0 3px 0 rgba(255, 255, 255, 0.5) !important;
  color: #fff !important;
  font: 900 14px/1 Georgia, serif !important;
  text-shadow: 0 2px 0 rgba(0, 60, 10, 0.85);
  cursor: pointer;
}
body #npc-interact-overlay .npc-interact-quest-action:hover:not(:disabled){ filter: brightness(1.1); }
body #npc-interact-overlay .npc-interact-quest-action:disabled{ opacity: 0.55; filter: grayscale(0.5); cursor: not-allowed; }
body #npc-interact-overlay .npc-interact-empty{ color: rgba(207, 233, 255, 0.78) !important; font-weight: 800 !important; }

/* ---- scrollbars + focus ---- */
body #npc-interact-overlay .npc-interact-dialog,
body #npc-interact-overlay .npc-interact-pane,
body #npc-interact-overlay .npc-interact-pane-copy,
body #npc-interact-overlay .npc-interact-inventory-grid{ scrollbar-color: #2f93ff rgba(0, 0, 0, 0.25); scrollbar-width: thin; }
body #npc-interact-overlay button:focus-visible{ outline: 3px solid #ffe27a; outline-offset: 2px; }

@media (max-width: 900px){
  body #npc-interact-overlay .npc-interact-card{ margin-top: 30px; }
  body #npc-interact-overlay .npc-interact-card::after{ left: -8px; top: -8px; width: calc(100% + 16px) !important; height: calc(100% + 16px) !important; background-size: 38px 30px; }
  body #npc-interact-overlay .npc-interact-close{ right: -8px; top: -14px; }
  body #npc-interact-overlay .npc-interact-title{ -webkit-text-stroke-width: 4px; }
}
@media (max-width: 520px){
  body #npc-interact-overlay .npc-interact-action{ font-size: 12px !important; gap: 6px; padding-left: 8px !important; padding-right: 8px !important; }
  body #npc-interact-overlay .npc-interact-action-label{ min-width: 0; overflow-wrap: anywhere; line-height: 1.1; }
}
@media (prefers-reduced-motion: reduce){
  body #npc-interact-overlay .npc-interact-action, body #npc-interact-overlay .npc-interact-close{ transition: none; }
}
