/* ===================================================================== */
/* PLAYER PROFILE (#player-info-modal): the CoreCraftia fantasy look -     */
/* bright blue frame, wooden "Equipment / Stats / Current World" signs,    */
/* framed equipment slots, dark-blue cards and 3D action buttons.          */
/* Presentation only: markup and behaviour live in items.js. Card styling  */
/* is scoped to the other-player layout (.pi-other); the frame, close      */
/* button and shared slot look apply to both profile layouts.              */
/* ===================================================================== */

body #player-info-modal{
  --pf-frame: #2f93ff;
  --pf-wood: linear-gradient(180deg, #d79a58 0%, #b87438 52%, #8d5226 100%);
  --pf-grain: repeating-linear-gradient(92deg, rgba(60, 28, 6, 0) 0 22px, rgba(60, 28, 6, 0.16) 22px 24px);
  --pf-card: linear-gradient(180deg, #0c2144, #081a38);
  --pf-btn-blue: linear-gradient(180deg, #4aa6ff 0%, #2677e6 52%, #1757bd 100%);
  --pf-btn-green: linear-gradient(180deg, #7ddc5a 0%, #3fae2f 52%, #25801f 100%);
  --pf-btn-violet: linear-gradient(180deg, #a98bff 0%, #7a55e6 52%, #5636b8 100%);
  --pf-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");
  --pf-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");
  --pf-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");
  --pf-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;
}

/* ---- frame ---- */
body #player-info-modal .player-info-card{
  position: relative;
  overflow: visible !important;
  border: 4px solid var(--pf-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;
}
body #player-info-modal .player-info-card::before{ display: none !important; }
body #player-info-modal .player-info-card::after{
  content: "";
  position: absolute;
  left: -12px;
  top: -12px;
  right: auto;
  width: calc(100% + 24px) !important;
  height: calc(100% + 24px) !important;
  max-width: none !important;
  max-height: none !important;
  z-index: 6;
  border: 0;
  pointer-events: none;
  background:
    var(--pf-leaf-tl) left top / 54px 42px no-repeat,
    var(--pf-leaf-tr) right top / 54px 42px no-repeat,
    var(--pf-leaf-bl) left bottom / 54px 42px no-repeat,
    var(--pf-leaf-br) right bottom / 54px 42px no-repeat;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35));
}

/* ---- red X ---- */
body #player-info-modal .pinfobutton{
  z-index: 8 !important;
  border: 3px solid #fff !important;
  border-radius: 12px !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 22px/1 Georgia, serif !important;
  text-shadow: 0 2px 0 rgba(90, 8, 4, 0.9);
}
body #player-info-modal .pinfobutton:hover{ filter: brightness(1.12) !important; border-color: #fff !important; }
body #player-info-modal .pinfobutton:active{ transform: translateY(2px); }

/* ---- other-player layout: dark-blue cards ---- */
body #player-info-modal .pi-other-grid{ gap: 18px; padding-top: 18px; }
body #player-info-modal .pi-other .pi-card{
  position: relative;
  border: 3px solid rgba(120, 190, 255, 0.5) !important;
  border-radius: 18px !important;
  background: var(--pf-card) !important;
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.45), 0 3px 0 #061a38 !important;
  padding-top: 30px !important;
}
body #player-info-modal .pi-other .pi-equipment-info-card{
  padding-top: 0 !important;
  border-radius: 14px !important;
}

/* ---- wooden signs ---- */
body #player-info-modal .pi-other-card-title{
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  margin: 0;
  padding: 5px 30px 7px;
  border: 3px solid #4a2a10;
  border-radius: 12px;
  background: var(--pf-grain), var(--pf-wood);
  box-shadow: 0 4px 0 #2a1608, 0 6px 10px rgba(0, 0, 0, 0.45), inset 0 2px 0 rgba(255, 224, 170, 0.5);
  color: #fff;
  font: 900 clamp(16px, 2vw, 22px)/1.1 Georgia, "Times New Roman", serif;
  letter-spacing: 0.04em;
  white-space: nowrap;
  -webkit-text-stroke: 5px #0a1c3c;
  paint-order: stroke fill;
  text-shadow: 0 3px 0 rgba(10, 28, 60, 0.9);
}
body #player-info-modal .pi-other-card-head{
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
  border-bottom: 0;
  padding: 0 0 6px;
}
body #player-info-modal .pi-other-name-chip{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 14px;
  border: 2px solid rgba(120, 190, 255, 0.45);
  border-radius: 999px;
  background: rgba(3, 14, 32, 0.7);
}
body #player-info-modal .pi-other-name{ font: 900 16px/1 Georgia, serif; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.7); }

/* ---- equipment slots (framed, both layouts) ---- */
body #player-info-modal .pi-equipped-item{
  border: 3px solid #4aa8ff !important;
  border-radius: 14px !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 3px 0 #061a38 !important;
  transition: transform 120ms ease, filter 120ms ease;
}
body #player-info-modal .pi-equipped-item.is-active{
  border-color: #ffd34a !important;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.45), 0 3px 0 #061a38, 0 0 12px rgba(255, 211, 74, 0.4) !important;
}
body #player-info-modal .pi-equipped-item:hover{ filter: brightness(1.15); transform: translateY(-1px); }
body #player-info-modal .pi-equipped-slot{
  color: #cfe9ff !important;
  font-family: Georgia, serif !important;
  font-weight: 900 !important;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.7);
}
body #player-info-modal .pi-equipped-value{ color: #fff !important; font-family: Georgia, serif !important; }

/* ---- stats ---- */
body #player-info-modal .pi-other .pi-stats-card{
  padding-top: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
}
body #player-info-modal .pi-other .pi-stat-item{
  border-radius: 10px;
  font-family: Georgia, serif;
}
body #player-info-modal .pi-other .pi-stat-item-label{ color: #cfe9ff; font-weight: 800; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6); }
body #player-info-modal .pi-other .pi-stat-item-value{ color: #fff; font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6); }
body #player-info-modal .pi-other .pi-stat-divider{ background: rgba(120, 190, 255, 0.3); }

/* ---- current world ---- */
body #player-info-modal .pi-other-world-icon{
  border: 3px solid #4aa8ff;
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.45), 0 3px 0 #061a38;
}
body #player-info-modal .pi-other-world-name{ color: #fff; font: 900 18px/1.1 Georgia, serif; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6); }
body #player-info-modal .pi-other-world-floor{ color: #8fd2ff; font-weight: 800; }
body #player-info-modal .pi-other-world-players{
  border: 2px solid rgba(120, 190, 255, 0.4);
  border-radius: 12px;
  background: rgba(3, 14, 32, 0.6);
  padding: 4px 10px;
  gap: 6px;
  min-width: 0;
}
body #player-info-modal .pi-other-world-players-copy{ line-height: 1.1; }
body #player-info-modal .pi-other-world-players-count{ color: #ffe9a0; font-weight: 900; }
body #player-info-modal .pi-other-world-players-label{ color: #cfe9ff; font-weight: 800; }

/* ---- action buttons ---- */
body #player-info-modal .pi-other-actions{
  border-top: 2px solid rgba(120, 190, 255, 0.3);
  padding-top: 14px;
  gap: 14px;
}
body #player-info-modal .pi-other-action{
  border: 3px solid #0b2c5e !important;
  border-radius: 14px !important;
  background: var(--pf-btn-blue) !important;
  box-shadow: 0 4px 0 #061a38, inset 0 3px 0 rgba(255, 255, 255, 0.4) !important;
  color: #fff !important;
  font: 900 clamp(15px, 1.8vw, 20px)/1 Georgia, serif !important;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 0 rgba(0, 20, 60, 0.85);
  transition: filter 120ms ease, transform 120ms ease;
}
body #player-info-modal .pi-other-action-friend{
  border-color: #124a12 !important;
  background: var(--pf-btn-green) !important;
  box-shadow: 0 4px 0 #0c3a0c, inset 0 3px 0 rgba(255, 255, 255, 0.4) !important;
  text-shadow: 0 2px 0 rgba(8, 50, 8, 0.85);
}
body #player-info-modal .pi-other-action-message{
  border-color: #2a1670 !important;
  background: var(--pf-btn-violet) !important;
  box-shadow: 0 4px 0 #1b0e4c, inset 0 3px 0 rgba(255, 255, 255, 0.4) !important;
  text-shadow: 0 2px 0 rgba(30, 10, 80, 0.85);
}
body #player-info-modal .pi-other-action-owner{ background: var(--pf-btn-blue) !important; }
body #player-info-modal .pi-other-action.mmo-btn-danger{
  border-color: #5a1210 !important;
  background: linear-gradient(180deg, #ff6a5c 0%, #d3201a 52%, #a31410 100%) !important;
  box-shadow: 0 4px 0 #3a0a08, inset 0 3px 0 rgba(255, 255, 255, 0.4) !important;
}
body #player-info-modal .pi-other-action:hover{ filter: brightness(1.12); transform: translateY(-1px); }
body #player-info-modal .pi-other-action:active{ transform: translateY(3px); box-shadow: 0 1px 0 #061a38 !important; }
body #player-info-modal button:focus-visible{ outline: 3px solid #ffe27a; outline-offset: 2px; }

@media (max-width: 720px){
  body #player-info-modal{ overflow-y: auto !important; align-items: flex-start !important; padding: 16px 12px 24px !important; }
  body #player-info-modal .player-info-card{ max-height: none !important; height: auto !important; margin: 8px 0 0 !important; }
  body #player-info-modal .player-info-card::after{ left: -8px; top: -8px; width: calc(100% + 16px) !important; height: calc(100% + 16px) !important; background-size: 38px 30px; }
  body #player-info-modal .pi-other-card-title{ top: -17px; padding: 4px 22px 6px; font-size: 16px; -webkit-text-stroke-width: 4px; }
  body #player-info-modal .pi-other-grid{ grid-template-columns: minmax(0, 1fr) !important; gap: 26px !important; padding-top: 20px; }
  body #player-info-modal .pi-other-actions{ flex-wrap: wrap; }
  body #player-info-modal .pi-other-action{ font-size: 14px !important; }
}
@media (prefers-reduced-motion: reduce){
  body #player-info-modal .pi-equipped-item, body #player-info-modal .pi-other-action{ transition: none; }
}
