.window--pc {
  --pc-ink: #f8fafc;
  --pc-muted: #64748b;
  --pc-line: rgba(148, 163, 184, 0.2);
  --pc-panel: rgba(11, 18, 32, 0.94);
  --pc-panel-soft: rgba(15, 23, 42, 0.8);
  --pc-biome-color: #7fb86d;
  width: min(940px, calc(100vw - 28px));
  max-height: min(86vh, 720px);
  border: 1px solid color-mix(in srgb, var(--pc-biome-color) 48%, #1e293b);
  border-radius: 16px;
  background: #07101e;
  box-shadow:
    0 0 0 1px rgba(2, 6, 23, 0.8),
    0 26px 70px rgba(0, 0, 0, 0.58);
  overflow: hidden;
  z-index: 5200;
}

.window--pc .window__bar {
  min-height: 58px;
  padding: 10px 14px;
  gap: 14px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--pc-biome-color) 22%, transparent), transparent 48%),
    #0b1728;
  border-bottom: 1px solid color-mix(in srgb, var(--pc-biome-color) 38%, #1e293b);
}

.pc__title-wrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.window--pc .window__title {
  color: var(--pc-ink);
  font-family: "Syne", "Segoe UI", sans-serif;
  font-size: 15px;
  letter-spacing: 0.1em;
}

.pc__title-theme {
  overflow: hidden;
  color: color-mix(in srgb, var(--pc-biome-color) 78%, white);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.pc__close {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: 7px;
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.pc__close:hover {
  background: rgba(248, 113, 113, 0.28);
  transform: translateY(-1px);
}

.pc__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  max-height: min(86vh, 662px);
  padding: 14px;
  overflow: hidden;
}

.pc__status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 42px;
  padding: 0 2px;
}

.pc__status-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.pc__summary {
  overflow: hidden;
  margin: 0;
  color: var(--pc-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc__hint {
  margin: 0;
  color: var(--pc-muted);
  font-size: 11px;
  line-height: 1.35;
}

.pc__status-mark {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 1px solid var(--pc-line);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.42);
}

.pc__status-mark-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pc-biome-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc-biome-color) 18%, transparent);
}

.pc__status-mark-line {
  width: 24px;
  height: 1px;
  background: color-mix(in srgb, var(--pc-biome-color) 55%, transparent);
}

.pc__layout {
  display: grid;
  grid-template-columns: minmax(210px, 0.72fr) minmax(0, 1.9fr);
  gap: 14px;
  min-height: 0;
  flex: 1;
}

.pc__pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
}

.pc__party-pane {
  padding: 14px;
  border: 1px solid var(--pc-line);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(30, 41, 59, 0.58), transparent 44%),
    var(--pc-panel);
}

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

.pc__pane-title {
  margin: 0;
  color: var(--pc-ink);
  font-family: "Syne", "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.pc__pane-subtitle {
  display: block;
  margin-top: 5px;
  color: var(--pc-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.pc__pane-index {
  color: color-mix(in srgb, var(--pc-biome-color) 68%, #64748b);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.pc__grid {
  display: grid;
  min-height: 0;
}

.pc__grid--party {
  grid-template-columns: 1fr;
  gap: 8px;
  overflow-y: auto;
  padding: 2px;
}

.pc__box-pane {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--pc-line);
  border-radius: 12px;
  background: var(--pc-panel);
}

.pc__box-tabs {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 5px;
}

.pc__box-tab {
  position: relative;
  min-width: 0;
  min-height: 30px;
  padding: 5px 4px 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 7px;
  background: rgba(30, 41, 59, 0.58);
  color: #94a3b8;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.pc__box-tab::after {
  position: absolute;
  right: 5px;
  bottom: 3px;
  color: #64748b;
  content: attr(data-count);
  font-size: 8px;
  font-weight: 700;
}

.pc__box-tab:hover,
.pc__box-tab:focus-visible {
  border-color: color-mix(in srgb, var(--pc-biome-color) 64%, #64748b);
  color: var(--pc-ink);
  outline: none;
}

.pc__box-tab.is-active {
  border-color: var(--pc-biome-color);
  background: color-mix(in srgb, var(--pc-biome-color) 22%, #0f172a);
  color: var(--pc-ink);
}

.pc__box-tab.is-active::after {
  color: color-mix(in srgb, var(--pc-biome-color) 82%, white);
}

.pc__box-stage {
  position: relative;
  isolation: isolate;
  display: flex;
  align-self: center;
  aspect-ratio: 1;
  width: min(100%, 600px, calc(100vh - 220px));
  min-height: 0;
  flex: 0 1 auto;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--pc-biome-color) 48%, #334155);
  border-radius: 10px;
  background-color: color-mix(in srgb, var(--pc-biome-color) 34%, #0f172a);
  background-image: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08),
    transparent 42%,
    rgba(2, 6, 23, 0.2)
  );
}

.pc__theme-ground {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0.9;
  image-rendering: pixelated;
  pointer-events: none;
}

.pc__box-stage::after {
  position: absolute;
  inset: 0;
  z-index: 4;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.pc__box-stage::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(2, 6, 23, 0.02),
    transparent 48%,
    rgba(2, 6, 23, 0.2)
  );
  content: "";
  pointer-events: none;
}

.pc__theme-art {
  position: absolute;
  right: -2px;
  bottom: -12px;
  z-index: 2;
  width: 28%;
  max-width: 170px;
  opacity: 0.27;
  pointer-events: none;
}

.pc__theme-art-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 190px;
  object-fit: contain;
  object-position: right bottom;
  image-rendering: pixelated;
}

.pc__grid--box {
  position: relative;
  z-index: 3;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-content: start;
  gap: 7px;
  width: 100%;
  padding: 10px;
  overflow-y: auto;
}

.pc__slot {
  position: relative;
  display: grid;
  align-items: center;
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(226, 232, 240, 0.22);
  border-radius: 9px;
  background: rgba(7, 16, 30, 0.64);
  color: var(--pc-ink);
  font: inherit;
  cursor: grab;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    opacity 0.15s ease,
    transform 0.15s ease;
}

.pc__slot--party {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 66px;
  padding: 7px;
  text-align: left;
}

.pc__slot--box {
  align-content: center;
  grid-template-rows: auto minmax(0, auto);
  justify-items: center;
  min-height: 112px;
  padding: 4px 4px 5px;
  border-color: rgba(226, 232, 240, 0.16);
  background: rgba(7, 16, 30, 0.18);
  text-align: center;
}

.pc__slot:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--pc-biome-color) 78%, white);
  background: rgba(15, 23, 42, 0.82);
  transform: translateY(-1px);
}

.pc__slot:focus-visible,
.pc__box-tab:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--pc-biome-color) 82%, white);
  outline-offset: 2px;
}

.pc__slot.is-selected {
  border-color: #facc15;
  background: rgba(113, 63, 18, 0.46);
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.45);
}

.pc__slot.is-deployed {
  border-color: color-mix(in srgb, var(--pc-biome-color) 82%, #38bdf8);
}

.pc__slot.is-loan {
  border-color: #fbbf24;
}

.pc__slot.is-empty {
  border-style: dashed;
  border-color: rgba(226, 232, 240, 0.18);
  background: rgba(7, 16, 30, 0.32);
  cursor: pointer;
}

.pc__slot.is-empty .pc__slot-icon::before {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(226, 232, 240, 0.28);
  border-radius: 4px;
  content: "";
}

.pc__slot.is-dragging-source {
  opacity: 0.4;
  cursor: grabbing;
}

.pc__slot.is-drop-target {
  border-color: #34d399;
  background: rgba(16, 185, 129, 0.32);
  box-shadow: inset 0 0 0 2px rgba(52, 211, 153, 0.35);
}

.pc__slot.is-drop-invalid {
  border-color: #f87171;
  background: rgba(127, 29, 29, 0.32);
}

.pc__slot:disabled {
  cursor: default;
}

.pc__slot.is-fainted {
  opacity: 0.76;
}

.pc__slot.is-fainted .pokemon-portrait {
  filter: brightness(0.42) saturate(0.5) grayscale(0.25);
}

.pc__slot-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid color-mix(in srgb, var(--poke, #64748b) 62%, transparent);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.48);
}

.pc__slot--box .pc__slot-icon {
  display: grid;
  place-items: center;
  position: absolute;
  top: -17%;
  left: -7%;
  width: 94px;
  height: 94px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.pc__overworld-sprite {
  display: block;
  aspect-ratio: 1;
  justify-self: center;
  max-width: 100%;
  width: 92px;
  height: 92px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}

.pc__slot-icon:empty::before {
  display: block;
}

.pc__slot-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pc__slot--box .pc__slot-meta {
  position: absolute;
  right: 0;
  bottom: 5px;
  left: 0;
  width: 100%;
  gap: 2px;
  text-align: center;
}

.pc__slot-name {
  overflow: hidden;
  color: var(--pc-ink);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc__slot-hp {
  overflow: hidden;
  color: #86efac;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pc__slot--box .pc__slot-name {
  font-size: 10px;
}

.pc__box-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 18px;
  color: var(--pc-muted);
  font-size: 10px;
}

.pc__box-occupancy {
  color: color-mix(in srgb, var(--pc-biome-color) 76%, white);
  font-weight: 800;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.pc__box-hint {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.window--pc.is-readonly .pc__slot {
  cursor: default;
  opacity: 0.7;
}

.window--pc.is-readonly .pc__hint {
  color: #fbbf24;
}

.window--pc.is-readonly .pc__status-mark-dot {
  background: #fbbf24;
}

@media (max-width: 820px) {
  .window--pc {
    width: min(720px, calc(100vw - 20px));
  }

  .pc__layout {
    grid-template-columns: minmax(170px, 0.6fr) minmax(0, 1.7fr);
    gap: 10px;
  }

  .pc__party-pane,
  .pc__box-pane {
    padding: 10px;
  }

  .pc__box-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .pc__grid--box {
    gap: 5px;
    padding: 7px;
  }

  .pc__slot--box {
    min-height: 112px;
  }
}

@media (max-width: 620px) {
  .window--pc {
    max-height: calc(100vh - 14px);
  }

  .pc__body {
    max-height: calc(100vh - 72px);
    padding: 10px;
  }

  .pc__status {
    align-items: flex-start;
  }

  .pc__status-mark {
    display: none;
  }

  .pc__layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .pc__party-pane {
    min-height: 0;
  }

  .pc__grid--party {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .pc__box-stage {
    min-height: 0;
  }

  .pc__theme-art {
    width: 24%;
  }
}

@media (max-width: 420px) {
  .pc__title-theme,
  .pc__box-hint {
    display: none;
  }

  .pc__title-wrap {
    gap: 0;
  }

  .pc__grid--party {
    grid-template-columns: 1fr;
  }

  .pc__grid--box {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .pc__slot,
  .pc__box-tab,
  .pc__close {
    transition: none;
  }
}
